From 0c6a14ca82ce3f646b7128c68242acbdc0e2784d Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Fri, 9 May 2014 18:44:48 +0000 Subject: [PATCH] Amending r208439 to remove buildLExpr; this code isn't strictly required yet, and fixes a dead code warning. llvm-svn: 208440 --- clang/lib/Analysis/ThreadSafety.cpp | 46 ----------------------------- 1 file changed, 46 deletions(-) diff --git a/clang/lib/Analysis/ThreadSafety.cpp b/clang/lib/Analysis/ThreadSafety.cpp index d19e04d630d8..078d3ff13f6e 100644 --- a/clang/lib/Analysis/ThreadSafety.cpp +++ b/clang/lib/Analysis/ThreadSafety.cpp @@ -709,52 +709,6 @@ public: } }; -/// \brief Attempts to create an LExpr from a Clang Expr. If an LExpr cannot be -/// constructed, returns a null pointer. Recursive function that terminates when -/// the complete expression is handled, or when a failure to create an LExpr -/// occurs. -static clang::threadSafety::lexpr::LExpr * -buildLExpr(threadSafety::til::MemRegionRef &Arena, const Expr *CurExpr) { - using namespace clang::threadSafety::lexpr; - using namespace clang::threadSafety::til; - - if (const auto *DRE = dyn_cast(CurExpr)) { - // TODO: Construct the til::SExpr leaf properly. - return new Terminal(new (Arena) Variable()); - } else if (const auto *ME = dyn_cast(CurExpr)) { - // TODO: Construct the til::SExpr leaf properly. - return new Terminal(new (Arena) Variable()); - } else if (const auto *BOE = dyn_cast(CurExpr)) { - switch (BOE->getOpcode()) { - case BO_LOr: - case BO_LAnd: { - auto *LHS = buildLExpr(Arena, BOE->getLHS()); - auto *RHS = buildLExpr(Arena, BOE->getRHS()); - if (!LHS || !RHS) - return nullptr; - - if (BOE->getOpcode() == BO_LOr) - return new Or(LHS, RHS); - else - return new And(LHS, RHS); - } - default: - break; - } - } else if (const auto *UOE = dyn_cast(CurExpr)) { - if (UOE->getOpcode() == UO_LNot) { - auto *E = buildLExpr(Arena, UOE->getSubExpr()); - return new Not(E); - } - } else if (const auto *CE = dyn_cast(CurExpr)) { - return buildLExpr(Arena, CE->getSubExpr()); - } else if (const auto *PE = dyn_cast(CurExpr)) { - return buildLExpr(Arena, PE->getSubExpr()); - } - - return nullptr; -} - /// \brief A short list of SExprs class MutexIDList : public SmallVector { public: