forked from OSchip/llvm-project
parent
9d94f04f27
commit
74c10507a6
|
@ -160,7 +160,7 @@ RValue CodeGenFunction::EmitCompoundStmt(const CompoundStmt &S, bool GetLast,
|
|||
EmitStmt(*I);
|
||||
|
||||
if (DI) {
|
||||
DI->setLocation(S.getLBracLoc());
|
||||
DI->setLocation(S.getRBracLoc());
|
||||
DI->EmitRegionEnd(CurFn, Builder);
|
||||
}
|
||||
|
||||
|
|
|
@ -749,6 +749,11 @@ void CodeGenFunction::EmitCleanupBlock() {
|
|||
return;
|
||||
}
|
||||
|
||||
// Scrub debug location info.
|
||||
for (llvm::BasicBlock::iterator LBI = Info.CleanupBlock->begin(),
|
||||
LBE = Info.CleanupBlock->end(); LBI != LBE; ++LBI)
|
||||
Builder.SetInstDebugLocation(LBI);
|
||||
|
||||
llvm::BasicBlock *CurBB = Builder.GetInsertBlock();
|
||||
if (CurBB && !CurBB->getTerminator() &&
|
||||
Info.CleanupBlock->getNumUses() == 0) {
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
// RUN: %clang_cc1 -g -S -emit-llvm -o %t %s
|
||||
// RUN: grep "i32 20, i32 3, metadata" %t | count 1
|
||||
// Check there is a line number entry for line 20 where b1 is destructed.
|
||||
class A { int a; };
|
||||
class B {
|
||||
public:
|
||||
B() { a = new A; }
|
||||
~B() { delete a; }
|
||||
private:
|
||||
A *a;
|
||||
};
|
||||
|
||||
void fn(B b);
|
||||
|
||||
int i;
|
||||
void foo() {
|
||||
if (i) {
|
||||
B b1;
|
||||
fn (b1);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue