[cfe-commits] r140737 - in /cfe/trunk/lib/CodeGen: CGDebugInfo.cpp CGDebugInfo.h CGExpr.cpp CGStmt.cpp
Eric Christopher
echristo at apple.com
Wed Sep 28 17:00:35 PDT 2011
Author: echristo
Date: Wed Sep 28 19:00:35 2011
New Revision: 140737
URL: http://llvm.org/viewvc/llvm-project?rev=140737&view=rev
Log:
Call UpdateLineDirectiveRegion every time we want to emit a stop
point in the code. Ensures that we don't miss any places and the
check is reasonably cheap.
Modified:
cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
cfe/trunk/lib/CodeGen/CGDebugInfo.h
cfe/trunk/lib/CodeGen/CGExpr.cpp
cfe/trunk/lib/CodeGen/CGStmt.cpp
Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=140737&r1=140736&r2=140737&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Wed Sep 28 19:00:35 2011
@@ -1763,6 +1763,10 @@
if (!Builder.getCurrentDebugLocation().isUnknown())
return;
+ // The file may have had a line directive change. Process any of
+ // those before updating the state.
+ UpdateLineDirectiveRegion(Builder);
+
// Update last state.
PrevLoc = CurLoc;
Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.h?rev=140737&r1=140736&r2=140737&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.h (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.h Wed Sep 28 19:00:35 2011
@@ -149,6 +149,10 @@
llvm::DIFile F,
SmallVectorImpl<llvm::Value *> &EltTys);
+ // UpdateLineDirectiveRegion - Update region stack only if #line directive
+ // has introduced scope change.
+ void UpdateLineDirectiveRegion(CGBuilderTy &Builder);
+
public:
CGDebugInfo(CodeGenModule &CGM);
~CGDebugInfo();
@@ -170,10 +174,6 @@
/// EmitFunctionEnd - Constructs the debug code for exiting a function.
void EmitFunctionEnd(CGBuilderTy &Builder);
- /// UpdateLineDirectiveRegion - Update region stack only if #line directive
- /// has introduced scope change.
- void UpdateLineDirectiveRegion(CGBuilderTy &Builder);
-
/// UpdateCompletedType - Update type cache because the type is now
/// translated.
void UpdateCompletedType(const TagDecl *TD);
Modified: cfe/trunk/lib/CodeGen/CGExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExpr.cpp?rev=140737&r1=140736&r2=140737&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExpr.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExpr.cpp Wed Sep 28 19:00:35 2011
@@ -2170,7 +2170,6 @@
ReturnValueSlot ReturnValue) {
if (CGDebugInfo *DI = getDebugInfo()) {
DI->setLocation(E->getLocStart());
- DI->UpdateLineDirectiveRegion(Builder);
DI->EmitStopPoint(Builder);
}
Modified: cfe/trunk/lib/CodeGen/CGStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGStmt.cpp?rev=140737&r1=140736&r2=140737&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGStmt.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGStmt.cpp Wed Sep 28 19:00:35 2011
@@ -35,7 +35,6 @@
DI->setLocation(S->getLocEnd());
else
DI->setLocation(S->getLocStart());
- DI->UpdateLineDirectiveRegion(Builder);
DI->EmitStopPoint(Builder);
}
}
More information about the cfe-commits
mailing list