forked from OSchip/llvm-project
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:
parent
7fc64a69b6
commit
4e6afcfc11
|
@ -785,7 +785,26 @@ protected:
|
||||||
void printCast(const Cast *E, StreamType &SS) {
|
void printCast(const Cast *E, StreamType &SS) {
|
||||||
if (!CStyle) {
|
if (!CStyle) {
|
||||||
SS << "cast[";
|
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 << "](";
|
SS << "](";
|
||||||
self()->printSExpr(E->expr(), SS, Prec_Unary);
|
self()->printSExpr(E->expr(), SS, Prec_Unary);
|
||||||
SS << ")";
|
SS << ")";
|
||||||
|
|
|
@ -64,13 +64,6 @@ using namespace threadSafety;
|
||||||
// Key method definition
|
// Key method definition
|
||||||
ThreadSafetyHandler::~ThreadSafetyHandler() = default;
|
ThreadSafetyHandler::~ThreadSafetyHandler() = default;
|
||||||
|
|
||||||
namespace {
|
|
||||||
|
|
||||||
class TILPrinter :
|
|
||||||
public til::PrettyPrinter<TILPrinter, llvm::raw_ostream> {};
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
/// Issue a warning about an invalid lock expression
|
/// Issue a warning about an invalid lock expression
|
||||||
static void warnInvalidLock(ThreadSafetyHandler &Handler,
|
static void warnInvalidLock(ThreadSafetyHandler &Handler,
|
||||||
const Expr *MutexExp, const NamedDecl *D,
|
const Expr *MutexExp, const NamedDecl *D,
|
||||||
|
|
|
@ -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) {
|
void printSCFG(CFGWalker &Walker) {
|
||||||
llvm::BumpPtrAllocator Bpa;
|
llvm::BumpPtrAllocator Bpa;
|
||||||
til::MemRegionRef Arena(&Bpa);
|
til::MemRegionRef Arena(&Bpa);
|
||||||
|
@ -951,4 +961,7 @@ void printSCFG(CFGWalker &Walker) {
|
||||||
til::SCFG *Scfg = SxBuilder.buildCFG(Walker);
|
til::SCFG *Scfg = SxBuilder.buildCFG(Walker);
|
||||||
TILPrinter::print(Scfg, llvm::errs());
|
TILPrinter::print(Scfg, llvm::errs());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace threadSafety
|
||||||
|
} // namespace clang
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue