r180990 - Revert "Attempt to un-break the gdb buildbot."

Adrian Prantl aprantl at apple.com
Thu May 2 18:42:35 PDT 2013


Author: adrian
Date: Thu May  2 20:42:35 2013
New Revision: 180990

URL: http://llvm.org/viewvc/llvm-project?rev=180990&view=rev
Log:
Revert "Attempt to un-break the gdb buildbot."

This reverts commit 180982.

Removed:
    cfe/trunk/test/CodeGenCXX/linetable-cleanup.cpp
Modified:
    cfe/trunk/lib/CodeGen/CGCleanup.cpp
    cfe/trunk/lib/CodeGen/CGStmt.cpp
    cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
    cfe/trunk/lib/CodeGen/CodeGenFunction.h

Modified: cfe/trunk/lib/CodeGen/CGCleanup.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCleanup.cpp?rev=180990&r1=180989&r2=180990&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGCleanup.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGCleanup.cpp Thu May  2 20:42:35 2013
@@ -371,8 +371,7 @@ void CodeGenFunction::ResolveBranchFixup
 }
 
 /// Pops cleanup blocks until the given savepoint is reached.
-void CodeGenFunction::PopCleanupBlocks(EHScopeStack::stable_iterator Old,
-                                       SourceLocation EHLoc) {
+void CodeGenFunction::PopCleanupBlocks(EHScopeStack::stable_iterator Old) {
   assert(Old.isValid());
 
   while (EHStack.stable_begin() != Old) {
@@ -384,7 +383,7 @@ void CodeGenFunction::PopCleanupBlocks(E
     bool FallThroughIsBranchThrough =
       Old.strictlyEncloses(Scope.getEnclosingNormalCleanup());
 
-    PopCleanupBlock(FallThroughIsBranchThrough, EHLoc);
+    PopCleanupBlock(FallThroughIsBranchThrough);
   }
 }
 
@@ -533,8 +532,7 @@ static void destroyOptimisticNormalEntry
 /// Pops a cleanup block.  If the block includes a normal cleanup, the
 /// current insertion point is threaded through the cleanup, as are
 /// any branch fixups on the cleanup.
-void CodeGenFunction::PopCleanupBlock(bool FallthroughIsBranchThrough,
-                                      SourceLocation EHLoc) {
+void CodeGenFunction::PopCleanupBlock(bool FallthroughIsBranchThrough) {
   assert(!EHStack.empty() && "cleanup stack is empty!");
   assert(isa<EHCleanupScope>(*EHStack.begin()) && "top not a cleanup!");
   EHCleanupScope &Scope = cast<EHCleanupScope>(*EHStack.begin());
@@ -835,9 +833,6 @@ void CodeGenFunction::PopCleanupBlock(bo
 
   // Emit the EH cleanup if required.
   if (RequiresEHCleanup) {
-    if (CGDebugInfo *DI = getDebugInfo())
-      DI->EmitLocation(Builder, EHLoc);
-
     CGBuilderTy::InsertPoint SavedIP = Builder.saveAndClearIP();
 
     EmitBlock(EHEntry);
@@ -845,7 +840,6 @@ void CodeGenFunction::PopCleanupBlock(bo
     // We only actually emit the cleanup code if the cleanup is either
     // active or was used before it was deactivated.
     if (EHActiveFlag || IsActive) {
-
       cleanupFlags.setIsForEHCleanup();
       EmitCleanup(*this, Fn, cleanupFlags, EHActiveFlag);
     }

Modified: cfe/trunk/lib/CodeGen/CGStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGStmt.cpp?rev=180990&r1=180989&r2=180990&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGStmt.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGStmt.cpp Thu May  2 20:42:35 2013
@@ -38,8 +38,8 @@ void CodeGenFunction::EmitStopPoint(cons
       Loc = S->getLocStart();
     DI->EmitLocation(Builder, Loc);
 
-    //if (++NumStopPoints == 1)
-      LastStopPoint = Loc;
+    if (++NumStopPoints == 1)
+      FirstStopPoint = Loc;
   }
 }
 
@@ -842,9 +842,8 @@ void CodeGenFunction::EmitReturnStmt(con
     }
   }
 
-  NumReturnExprs += 1;
   if (RV == 0 || RV->isEvaluatable(getContext()))
-    NumSimpleReturnExprs += 1;
+    ++NumSimpleReturnExprs;
 
   cleanupScope.ForceCleanup();
   EmitBranchThroughCleanup(ReturnBlock);

Modified: cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenFunction.cpp?rev=180990&r1=180989&r2=180990&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenFunction.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenFunction.cpp Thu May  2 20:42:35 2013
@@ -44,7 +44,7 @@ CodeGenFunction::CodeGenFunction(CodeGen
     DebugInfo(0), DisableDebugInfo(false), CalleeWithThisReturn(0),
     DidCallStackSave(false),
     IndirectBranch(0), SwitchInsn(0), CaseRangeBlock(0), UnreachableBlock(0),
-    NumReturnExprs(0), NumSimpleReturnExprs(0),
+    NumStopPoints(0), NumSimpleReturnExprs(0),
     CXXABIThisDecl(0), CXXABIThisValue(0), CXXThisValue(0),
     CXXDefaultInitExprThis(0),
     CXXStructorImplicitParamDecl(0), CXXStructorImplicitParamValue(0),
@@ -188,14 +188,14 @@ void CodeGenFunction::FinishFunction(Sou
   assert(BreakContinueStack.empty() &&
          "mismatched push/pop in break/continue stack!");
 
-  // If the function contains only a simple return statement, the
-  // cleanup code may become the first breakpoint in the function. To
-  // be safe, set the debug location for it to the location of the
-  // return statement.  Otherwise point it to end of the function's
-  // lexical scope.
+  // If the function contains only a single, simple return statement,
+  // the cleanup code may become the first breakpoint in the
+  // function. To be safe set the debug location for it to the
+  // location of the return statement.  Otherwise point it to end of
+  // the function's lexical scope.
   if (CGDebugInfo *DI = getDebugInfo()) {
-    if (NumSimpleReturnExprs == NumReturnExprs)
-       DI->EmitLocation(Builder, LastStopPoint);
+    if (NumSimpleReturnExprs == 1 && NumStopPoints == 1)
+      DI->EmitLocation(Builder, FirstStopPoint);
     else
       DI->EmitLocation(Builder, EndLoc);
   }
@@ -206,14 +206,14 @@ void CodeGenFunction::FinishFunction(Sou
   // edges will be *really* confused.
   bool EmitRetDbgLoc = true;
   if (EHStack.stable_begin() != PrologueCleanupDepth) {
-    PopCleanupBlocks(PrologueCleanupDepth, EndLoc);
+    PopCleanupBlocks(PrologueCleanupDepth);
 
     // Make sure the line table doesn't jump back into the body for
     // the ret after it's been at EndLoc.
     EmitRetDbgLoc = false;
 
     if (CGDebugInfo *DI = getDebugInfo())
-      if (NumSimpleReturnExprs == NumReturnExprs)
+      if (NumSimpleReturnExprs == 1 && NumStopPoints == 1)
         DI->EmitLocation(Builder, EndLoc);
   }
 

Modified: cfe/trunk/lib/CodeGen/CodeGenFunction.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenFunction.h?rev=180990&r1=180989&r2=180990&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenFunction.h (original)
+++ cfe/trunk/lib/CodeGen/CodeGenFunction.h Thu May  2 20:42:35 2013
@@ -784,9 +784,7 @@ public:
 
   /// PopCleanupBlock - Will pop the cleanup entry on the stack and
   /// process all branch fixups.
-  /// \param EHLoc - Optional debug location for EH code.
-  void PopCleanupBlock(bool FallThroughIsBranchThrough = false,
-                       SourceLocation EHLoc=SourceLocation());
+  void PopCleanupBlock(bool FallThroughIsBranchThrough = false);
 
   /// DeactivateCleanupBlock - Deactivates the given cleanup block.
   /// The block cannot be reactivated.  Pops it if it's the top of the
@@ -907,9 +905,7 @@ public:
 
   /// PopCleanupBlocks - Takes the old cleanup stack size and emits
   /// the cleanup blocks that have been added.
-  /// \param EHLoc - Optional debug location for EH code.
-  void PopCleanupBlocks(EHScopeStack::stable_iterator OldCleanupStackSize,
-                        SourceLocation EHLoc=SourceLocation());
+  void PopCleanupBlocks(EHScopeStack::stable_iterator OldCleanupStackSize);
 
   void ResolveBranchFixups(llvm::BasicBlock *Target);
 
@@ -1210,14 +1206,14 @@ private:
   /// lazily by getUnreachableBlock().
   llvm::BasicBlock *UnreachableBlock;
 
-  /// Counts of the number return expressions in the function.
-  unsigned NumReturnExprs;
+  /// Counts of the number of distinct breakpoint locations in this function.
+  unsigned NumStopPoints;
 
   /// Count the number of simple (constant) return expressions in the function.
   unsigned NumSimpleReturnExprs;
 
-  /// The last regular (non-return) debug location (breakpoint) in the function.
-  SourceLocation LastStopPoint;
+  /// The first debug location (breakpoint) in the function.
+  SourceLocation FirstStopPoint;
 
 public:
   /// A scope within which we are constructing the fields of an object which

Removed: cfe/trunk/test/CodeGenCXX/linetable-cleanup.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/linetable-cleanup.cpp?rev=180989&view=auto
==============================================================================
--- cfe/trunk/test/CodeGenCXX/linetable-cleanup.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/linetable-cleanup.cpp (removed)
@@ -1,24 +0,0 @@
-// RUN: %clang_cc1 -emit-llvm -g -triple x86_64-apple-darwin10 %s -o - | FileCheck %s
-
-// Check the line numbers for cleanup code with EH in combinatin with
-// simple return expressions.
-
-// CHECK: define {{.*}}foo
-// CHECK: call void @_ZN1CD1Ev(%class.C* {{.*}}), !dbg ![[CLEANUP:[0-9]+]]
-// CHECK: ret i32 0, !dbg ![[RET:[0-9]+]]
-
-class C {
-public:
-  ~C() {}
-  int i;
-};
-
-int foo()
-{
-  C c;
-  c.i = 42;
-  // This breakpoint should be at/before the cleanup code.
-  // CHECK: ![[CLEANUP]] = metadata !{i32 [[@LINE+1]], i32 0, metadata !{{.*}}, null}
-  return 0;
-  // CHECK: ![[RET]] = metadata !{i32 [[@LINE+1]], i32 0, metadata !{{.*}}, null}
-}





More information about the cfe-commits mailing list