diff options
author | NAKAMURA Takumi <geek4civic@gmail.com> | 2012-03-25 06:30:37 +0000 |
---|---|---|
committer | NAKAMURA Takumi <geek4civic@gmail.com> | 2012-03-25 06:30:37 +0000 |
commit | 6955da2cad4bce19c541ddb85a6d965d77a1a4ab (patch) | |
tree | a9e0870c3f2f1ae6f5992253b6684ee45f31128a /lib/Analysis/CFG.cpp | |
parent | 9260f618e72f7c70dc76312f95d679f0ed03858c (diff) |
clang/lib/Analysis/CFG.cpp: Get rid of early insertion of placeholder to the map.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153407 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/CFG.cpp')
-rw-r--r-- | lib/Analysis/CFG.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/lib/Analysis/CFG.cpp b/lib/Analysis/CFG.cpp index e54fae33fe..0129cfa5e1 100644 --- a/lib/Analysis/CFG.cpp +++ b/lib/Analysis/CFG.cpp @@ -288,7 +288,8 @@ class CFGBuilder { // Caches boolean evaluations of expressions to avoid multiple re-evaluations // during construction of branches for chained logical operators. - llvm::DenseMap<Expr *, TryResult> CachedBoolEvals; + typedef llvm::DenseMap<Expr *, TryResult> CachedBoolEvalsTy; + CachedBoolEvalsTy CachedBoolEvals; public: explicit CFGBuilder(ASTContext *astContext, @@ -450,12 +451,8 @@ private: if (BinaryOperator *Bop = dyn_cast<BinaryOperator>(S)) { if (Bop->isLogicalOp()) { // Check the cache first. - typedef llvm::DenseMap<Expr *, TryResult>::iterator eval_iterator; - eval_iterator I; - bool Inserted; - llvm::tie(I, Inserted) = - CachedBoolEvals.insert(std::make_pair(S, TryResult())); - if (!Inserted) + CachedBoolEvalsTy::iterator I = CachedBoolEvals.find(S); + if (I != CachedBoolEvals.end()) return I->second; // already in map; // Retrieve result at first, or the map might be updated. |