Thread safety analysis: Make printSCFG compile again [NFC]

Not used productively, so no observable functional change.

Note that printSCFG doesn't yet work reliably, it seems to crash
sometimes.

llvm-svn: 342790
This commit is contained in:
Aaron Puchert 2018-09-21 23:46:35 +00:00
parent 7fc64a69b6
commit 4e6afcfc11
3 changed files with 33 additions and 8 deletions

View File

@ -785,7 +785,26 @@ protected:
void printCast(const Cast *E, StreamType &SS) {
if (!CStyle) {
SS << "cast[";
SS << E->castOpcode();
switch (E->castOpcode()) {
case CAST_none:
SS << "none";
break;
case CAST_extendNum:
SS << "extendNum";
break;
case CAST_truncNum:
SS << "truncNum";
break;
case CAST_toFloat:
SS << "toFloat";
break;
case CAST_toInt:
SS << "toInt";
break;
case CAST_objToPtr:
SS << "objToPtr";
break;
}
SS << "](";
self()->printSExpr(E->expr(), SS, Prec_Unary);
SS << ")";

View File

@ -64,13 +64,6 @@ using namespace threadSafety;
// Key method definition
ThreadSafetyHandler::~ThreadSafetyHandler() = default;
namespace {
class TILPrinter :
public til::PrettyPrinter<TILPrinter, llvm::raw_ostream> {};
} // namespace
/// Issue a warning about an invalid lock expression
static void warnInvalidLock(ThreadSafetyHandler &Handler,
const Expr *MutexExp, const NamedDecl *D,

View File

@ -944,6 +944,16 @@ void SExprBuilder::exitCFG(const CFGBlock *Last) {
}
/*
namespace {
class TILPrinter :
public til::PrettyPrinter<TILPrinter, llvm::raw_ostream> {};
} // namespace
namespace clang {
namespace threadSafety {
void printSCFG(CFGWalker &Walker) {
llvm::BumpPtrAllocator Bpa;
til::MemRegionRef Arena(&Bpa);
@ -951,4 +961,7 @@ void printSCFG(CFGWalker &Walker) {
til::SCFG *Scfg = SxBuilder.buildCFG(Walker);
TILPrinter::print(Scfg, llvm::errs());
}
} // namespace threadSafety
} // namespace clang
*/