From: Aaron Ballman Date: Fri, 9 May 2014 18:44:48 +0000 (+0000) Subject: Amending r208439 to remove buildLExpr; this code isn't strictly required yet, and... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=43f465ff946c8398761761ea85f9764646ca5857;p=clang Amending r208439 to remove buildLExpr; this code isn't strictly required yet, and fixes a dead code warning. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208440 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Analysis/ThreadSafety.cpp b/lib/Analysis/ThreadSafety.cpp index d19e04d630..078d3ff13f 100644 --- a/lib/Analysis/ThreadSafety.cpp +++ b/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: