Files
swift-mirror/include/swift/SILPasses/PrettyStackTrace.h
Michael Gottesman b2d9833259 Add PrettyStackTrace support for SILFunctionTransforms and SILModuleTransforms.
In the case of a crash in the optimizer or verifier, this prints out information
about the source of the crash. This saves engineering time by allowing one to
get some quick information about the crash without needing to jump into the
buffer.

In the case of a SILFunctionTransform, this prints out the name of the function
being optimized and the name of the transform.

In the case of a SILModuleTransform, this prints out the name of the transform.

<rdar://problem/19946491>

Swift SVN r25831
2015-03-07 03:08:28 +00:00

43 lines
1.2 KiB
C++

//===--- PrettyStackTrace.h - PrettyStackTrace for Transforms -*- C++ -*---===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2015 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
#ifndef SWIFT_SILPASSES_PRETTYSTACKTRACE_H
#define SWIFT_SILPASSES_PRETTYSTACKTRACE_H
#include "llvm/Support/PrettyStackTrace.h"
namespace swift {
class SILFunctionTransform;
class SILModuleTransform;
class PrettyStackTraceSILFunctionTransform
: public llvm::PrettyStackTraceEntry {
SILFunctionTransform *SFT;
public:
PrettyStackTraceSILFunctionTransform(SILFunctionTransform *SFT) : SFT(SFT) {}
virtual void print(llvm::raw_ostream &OS) const;
};
class PrettyStackTraceSILModuleTransform : public llvm::PrettyStackTraceEntry {
SILModuleTransform *SMT;
public:
PrettyStackTraceSILModuleTransform(SILModuleTransform *SMT) : SMT(SMT) {}
virtual void print(llvm::raw_ostream &OS) const;
};
} // end namespace swift
#endif