diff --git a/clang/include/clang/Analysis/Analyses/ThreadSafetyTraverse.h b/clang/include/clang/Analysis/Analyses/ThreadSafetyTraverse.h index 49031010a75b..32aadf526587 100644 --- a/clang/include/clang/Analysis/Analyses/ThreadSafetyTraverse.h +++ b/clang/include/clang/Analysis/Analyses/ThreadSafetyTraverse.h @@ -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 << ")"; diff --git a/clang/lib/Analysis/ThreadSafety.cpp b/clang/lib/Analysis/ThreadSafety.cpp index e11ba12501f0..80d16a659e88 100644 --- a/clang/lib/Analysis/ThreadSafety.cpp +++ b/clang/lib/Analysis/ThreadSafety.cpp @@ -64,13 +64,6 @@ using namespace threadSafety; // Key method definition ThreadSafetyHandler::~ThreadSafetyHandler() = default; -namespace { - -class TILPrinter : - public til::PrettyPrinter {}; - -} // namespace - /// Issue a warning about an invalid lock expression static void warnInvalidLock(ThreadSafetyHandler &Handler, const Expr *MutexExp, const NamedDecl *D, diff --git a/clang/lib/Analysis/ThreadSafetyCommon.cpp b/clang/lib/Analysis/ThreadSafetyCommon.cpp index 3b6a2641ad1d..115c012a055a 100644 --- a/clang/lib/Analysis/ThreadSafetyCommon.cpp +++ b/clang/lib/Analysis/ThreadSafetyCommon.cpp @@ -944,6 +944,16 @@ void SExprBuilder::exitCFG(const CFGBlock *Last) { } /* +namespace { + +class TILPrinter : + public til::PrettyPrinter {}; + +} // 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 */