Files
swift-mirror/include/swift/Basic/PrettyStackTrace.h
Jordan Rose 6243096b0b Dump input filelists in the PrettyStackTrace
This may help us reproduce a failing build when all we have is a build
log, and will become much more important in batch mode when we
/really/ need to know what ended up in what batch.

For now, this doesn't include /output/ filelists, because David's
about to mess with that code anyway to make things better around
supplementary outputs in batch mode. There is one weirdness there,
though, which is that ArgsToFrontendInputsConverter peeks at the
outputs to see whether we're doing single-threaded or multi-threaded
WMO.
2018-03-09 18:32:02 -08:00

50 lines
1.5 KiB
C++

//===--- PrettyStackTrace.h - Generic stack-trace prettifiers ---*- C++ -*-===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
#ifndef SWIFT_BASIC_PRETTYSTACKTRACE_H
#define SWIFT_BASIC_PRETTYSTACKTRACE_H
#include "llvm/Support/PrettyStackTrace.h"
#include "llvm/ADT/StringRef.h"
namespace llvm {
class MemoryBuffer;
}
namespace swift {
/// A PrettyStackTraceEntry for performing an action involving a StringRef.
///
/// The message is:
/// While <action> "<string>"\n
class PrettyStackTraceStringAction : public llvm::PrettyStackTraceEntry {
const char *Action;
llvm::StringRef TheString;
public:
PrettyStackTraceStringAction(const char *action, llvm::StringRef string)
: Action(action), TheString(string) {}
void print(llvm::raw_ostream &OS) const override;
};
/// A PrettyStackTraceEntry to dump the contents of a file.
class PrettyStackTraceFileContents : public llvm::PrettyStackTraceEntry {
const llvm::MemoryBuffer &Buffer;
public:
explicit PrettyStackTraceFileContents(const llvm::MemoryBuffer &buffer)
: Buffer(buffer) {}
void print(llvm::raw_ostream &OS) const override;
};
} // end namespace swift
#endif // SWIFT_BASIC_PRETTYSTACKTRACE_H