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.

llvm-svn: 140737
This commit is contained in:
Eric Christopher 2011-09-29 00:00:35 +00:00
parent 250511bc75
commit e655657c94
4 changed files with 8 additions and 6 deletions

View File

@ -1763,6 +1763,10 @@ void CGDebugInfo::EmitStopPoint(CGBuilderTy &Builder) {
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;

View File

@ -149,6 +149,10 @@ class CGDebugInfo {
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 @@ public:
/// 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);

View File

@ -2170,7 +2170,6 @@ RValue CodeGenFunction::EmitCallExpr(const CallExpr *E,
ReturnValueSlot ReturnValue) {
if (CGDebugInfo *DI = getDebugInfo()) {
DI->setLocation(E->getLocStart());
DI->UpdateLineDirectiveRegion(Builder);
DI->EmitStopPoint(Builder);
}

View File

@ -35,7 +35,6 @@ void CodeGenFunction::EmitStopPoint(const Stmt *S) {
DI->setLocation(S->getLocEnd());
else
DI->setLocation(S->getLocStart());
DI->UpdateLineDirectiveRegion(Builder);
DI->EmitStopPoint(Builder);
}
}