summaryrefslogtreecommitdiff
path: root/lib/Analysis
diff options
context:
space:
mode:
authorErich Keane <erich.keane@intel.com>2019-05-30 15:38:02 +0000
committerErich Keane <erich.keane@intel.com>2019-05-30 15:38:02 +0000
commita85622d923a899272c7acbd19210ba2f7bb88ab9 (patch)
treecc34c8f4a412b46b55a0c8cd922d0ff50f8f95ad /lib/Analysis
parent3fe47eab4520a5fdfe3b83aa88ef6a9f46bc5330 (diff)
downloadclang-a85622d923a899272c7acbd19210ba2f7bb88ab9.tar.gz
Revert "clang support gnu asm goto."
This reverts commit 954ec09aed4f2be04bb5f4e10dbb4ea8bd19ef9a. Reverting due to test failures as requested by Jennifer Yu. Conflicts: clang/test/CodeGen/asm-goto.c git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@362106 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis')
-rw-r--r--lib/Analysis/CFG.cpp74
1 files changed, 16 insertions, 58 deletions
diff --git a/lib/Analysis/CFG.cpp b/lib/Analysis/CFG.cpp
index b53bfcca37..1d83359341 100644
--- a/lib/Analysis/CFG.cpp
+++ b/lib/Analysis/CFG.cpp
@@ -549,7 +549,6 @@ private:
CFGBlock *VisitExprWithCleanups(ExprWithCleanups *E, AddStmtChoice asc);
CFGBlock *VisitForStmt(ForStmt *F);
CFGBlock *VisitGotoStmt(GotoStmt *G);
- CFGBlock *VisitGCCAsmStmt(GCCAsmStmt *G, AddStmtChoice asc);
CFGBlock *VisitIfStmt(IfStmt *I);
CFGBlock *VisitImplicitCastExpr(ImplicitCastExpr *E, AddStmtChoice asc);
CFGBlock *VisitConstantExpr(ConstantExpr *E, AddStmtChoice asc);
@@ -1479,38 +1478,22 @@ std::unique_ptr<CFG> CFGBuilder::buildCFG(const Decl *D, Stmt *Statement) {
E = BackpatchBlocks.end(); I != E; ++I ) {
CFGBlock *B = I->block;
- if (auto *G = dyn_cast<GotoStmt>(B->getTerminator())) {
- LabelMapTy::iterator LI = LabelMap.find(G->getLabel());
- // If there is no target for the goto, then we are looking at an
- // incomplete AST. Handle this by not registering a successor.
- if (LI == LabelMap.end())
- continue;
- JumpTarget JT = LI->second;
- prependAutomaticObjLifetimeWithTerminator(B, I->scopePosition,
- JT.scopePosition);
- prependAutomaticObjDtorsWithTerminator(B, I->scopePosition,
- JT.scopePosition);
- const VarDecl *VD = prependAutomaticObjScopeEndWithTerminator(
- B, I->scopePosition, JT.scopePosition);
- appendScopeBegin(JT.block, VD, G);
- addSuccessor(B, JT.block);
- };
- if (auto *G = dyn_cast<GCCAsmStmt>(B->getTerminator())) {
- CFGBlock *Successor = (I+1)->block;
- for (auto *L : G->labels()) {
- LabelMapTy::iterator LI = LabelMap.find(L->getLabel());
- // If there is no target for the goto, then we are looking at an
- // incomplete AST. Handle this by not registering a successor.
- if (LI == LabelMap.end())
- continue;
- JumpTarget JT = LI->second;
- // Successor has been added, so skip it.
- if (JT.block == Successor)
- continue;
- addSuccessor(B, JT.block);
- }
- I++;
- }
+ const GotoStmt *G = cast<GotoStmt>(B->getTerminator());
+ LabelMapTy::iterator LI = LabelMap.find(G->getLabel());
+
+ // If there is no target for the goto, then we are looking at an
+ // incomplete AST. Handle this by not registering a successor.
+ if (LI == LabelMap.end()) continue;
+
+ JumpTarget JT = LI->second;
+ prependAutomaticObjLifetimeWithTerminator(B, I->scopePosition,
+ JT.scopePosition);
+ prependAutomaticObjDtorsWithTerminator(B, I->scopePosition,
+ JT.scopePosition);
+ const VarDecl *VD = prependAutomaticObjScopeEndWithTerminator(
+ B, I->scopePosition, JT.scopePosition);
+ appendScopeBegin(JT.block, VD, G);
+ addSuccessor(B, JT.block);
}
// Add successors to the Indirect Goto Dispatch block (if we have one).
@@ -2159,9 +2142,6 @@ CFGBlock *CFGBuilder::Visit(Stmt * S, AddStmtChoice asc) {
case Stmt::GotoStmtClass:
return VisitGotoStmt(cast<GotoStmt>(S));
- case Stmt::GCCAsmStmtClass:
- return VisitGCCAsmStmt(cast<GCCAsmStmt>(S), asc);
-
case Stmt::IfStmtClass:
return VisitIfStmt(cast<IfStmt>(S));
@@ -3166,28 +3146,6 @@ CFGBlock *CFGBuilder::VisitGotoStmt(GotoStmt *G) {
return Block;
}
-CFGBlock *CFGBuilder::VisitGCCAsmStmt(GCCAsmStmt *G, AddStmtChoice asc) {
- // Goto is a control-flow statement. Thus we stop processing the current
- // block and create a new one.
-
- if (!G->isAsmGoto())
- return VisitStmt(G, asc);
-
- if (Block) {
- Succ = Block;
- if (badCFG)
- return nullptr;
- }
- Block = createBlock();
- Block->setTerminator(G);
- // We will backpatch this block later for all the labels.
- BackpatchBlocks.push_back(JumpSource(Block, ScopePos));
- // Save "Succ" in BackpatchBlocks. In the backpatch processing, "Succ" is
- // used to avoid adding "Succ" again.
- BackpatchBlocks.push_back(JumpSource(Succ, ScopePos));
- return Block;
-}
-
CFGBlock *CFGBuilder::VisitForStmt(ForStmt *F) {
CFGBlock *LoopSuccessor = nullptr;