forked from OSchip/llvm-project
Fix a bug in CGDebugInfo::EmitInlineFunctionStart causing DILocations to be
parented in function declarations. Fixes PR33997. https://bugs.llvm.org/show_bug.cgi?id=33997 llvm-svn: 311601
This commit is contained in:
parent
90bef32219
commit
8040a215c9
|
@ -3287,7 +3287,7 @@ void CGDebugInfo::EmitInlineFunctionStart(CGBuilderTy &Builder, GlobalDecl GD) {
|
||||||
llvm::DISubprogram *SP = nullptr;
|
llvm::DISubprogram *SP = nullptr;
|
||||||
if (FI != SPCache.end())
|
if (FI != SPCache.end())
|
||||||
SP = dyn_cast_or_null<llvm::DISubprogram>(FI->second);
|
SP = dyn_cast_or_null<llvm::DISubprogram>(FI->second);
|
||||||
if (!SP)
|
if (!SP || !SP->isDefinition())
|
||||||
SP = getFunctionStub(GD);
|
SP = getFunctionStub(GD);
|
||||||
FnBeginRegionCount.push_back(LexicalBlockStack.size());
|
FnBeginRegionCount.push_back(LexicalBlockStack.size());
|
||||||
LexicalBlockStack.emplace_back(SP);
|
LexicalBlockStack.emplace_back(SP);
|
||||||
|
|
|
@ -0,0 +1,45 @@
|
||||||
|
// RUN: %clang_cc1 -emit-llvm -triple i686-pc-windows-msvc19.0.24213 -gcodeview -debug-info-kind=limited -std=c++14 %s -o - | FileCheck %s
|
||||||
|
// PR33997.
|
||||||
|
struct already_AddRefed {
|
||||||
|
~already_AddRefed();
|
||||||
|
};
|
||||||
|
struct RefPtr {
|
||||||
|
operator int *();
|
||||||
|
};
|
||||||
|
struct ServoCssRulesStrong {
|
||||||
|
already_AddRefed Consume();
|
||||||
|
};
|
||||||
|
struct GroupRule {
|
||||||
|
GroupRule(already_AddRefed);
|
||||||
|
};
|
||||||
|
class ConditionRule : GroupRule {
|
||||||
|
using GroupRule::GroupRule;
|
||||||
|
};
|
||||||
|
class CSSMediaRule : ConditionRule {
|
||||||
|
using ConditionRule::ConditionRule;
|
||||||
|
};
|
||||||
|
class CSSMozDocumentRule : ConditionRule {
|
||||||
|
using ConditionRule::ConditionRule;
|
||||||
|
};
|
||||||
|
class ServoDocumentRule : CSSMozDocumentRule {
|
||||||
|
ServoDocumentRule(RefPtr);
|
||||||
|
};
|
||||||
|
class ServoMediaRule : CSSMediaRule {
|
||||||
|
ServoMediaRule(RefPtr);
|
||||||
|
};
|
||||||
|
ServoCssRulesStrong Servo_MediaRule_GetRules(int *);
|
||||||
|
ServoCssRulesStrong Servo_DocumentRule_GetRules(int *);
|
||||||
|
ServoDocumentRule::ServoDocumentRule(RefPtr aRawRule)
|
||||||
|
: CSSMozDocumentRule(Servo_DocumentRule_GetRules(aRawRule).Consume()) {}
|
||||||
|
|
||||||
|
ServoMediaRule::ServoMediaRule(RefPtr aRawRule)
|
||||||
|
: CSSMediaRule(Servo_MediaRule_GetRules(aRawRule).Consume()) {}
|
||||||
|
|
||||||
|
// CHECK: define{{.*}}ServoMediaRule
|
||||||
|
// CHECK-NOT: {{ ret }}
|
||||||
|
// CHECK: store %class.ConditionRule* %
|
||||||
|
// CHECK-SAME: %class.ConditionRule** %
|
||||||
|
// CHECK-SAME: !dbg ![[INL:[0-9]+]]
|
||||||
|
|
||||||
|
// CHECK: ![[INL]] = !DILocation(line: 16, scope: ![[SP:[0-9]+]], inlinedAt:
|
||||||
|
// CHECK: ![[SP]] = distinct !DISubprogram(name: "GroupRule", {{.*}}isDefinition: true
|
Loading…
Reference in New Issue