summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/CFG.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2011-04-18 15:49:25 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2011-04-18 15:49:25 +0000
commit0c502d2a6264fec85b06689b3a96bc797f05650c (patch)
treeaffb71eaa54a346bc94cc7835794516d15917fff /clang/lib/Analysis/CFG.cpp
parent6c7a9eec42033931a9ed09b92561c39c0abbd59e (diff)
downloadbcm5719-llvm-0c502d2a6264fec85b06689b3a96bc797f05650c.tar.gz
bcm5719-llvm-0c502d2a6264fec85b06689b3a96bc797f05650c.zip
Fix PR9741. The implicit declarations created for range-based for loops weren't being added to the DeclContext (nor were they being marked as implicit). Also, the declarations were being emitted in the wrong order when building the CFG.
llvm-svn: 129700
Diffstat (limited to 'clang/lib/Analysis/CFG.cpp')
-rw-r--r--clang/lib/Analysis/CFG.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Analysis/CFG.cpp b/clang/lib/Analysis/CFG.cpp
index bfe2247fba1..eaab487d959 100644
--- a/clang/lib/Analysis/CFG.cpp
+++ b/clang/lib/Analysis/CFG.cpp
@@ -2629,8 +2629,8 @@ CFGBlock* CFGBuilder::VisitCXXForRangeStmt(CXXForRangeStmt* S) {
// Add the initialization statements.
Block = createBlock();
- addStmt(S->getRangeStmt());
- return addStmt(S->getBeginEndStmt());
+ addStmt(S->getBeginEndStmt());
+ return addStmt(S->getRangeStmt());
}
CFGBlock *CFGBuilder::VisitExprWithCleanups(ExprWithCleanups *E,
OpenPOWER on IntegriCloud