Skip to content
This repository has been archived by the owner on Apr 23, 2020. It is now read-only.

Commit

Permalink
Remove line and file from DINamespace.
Browse files Browse the repository at this point in the history
Fixes the issue highlighted in
http://lists.llvm.org/pipermail/cfe-dev/2014-June/037500.html.

The DW_AT_decl_file and DW_AT_decl_line attributes on namespaces can
prevent LLVM from uniquing types that are in the same namespace. They
also don't carry any meaningful information.

rdar://problem/17484998
Differential Revision: https://reviews.llvm.org/D32648

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301706 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
adrian-prantl committed Apr 28, 2017
1 parent e91b6db commit 841400b
Show file tree
Hide file tree
Showing 36 changed files with 102 additions and 130 deletions.
6 changes: 2 additions & 4 deletions include/llvm/IR/DIBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -632,11 +632,9 @@ namespace llvm {
/// parent scope.
/// \param Scope Namespace scope
/// \param Name Name of this namespace
/// \param File Source file
/// \param LineNo Line number
/// \param ExportSymbols True for C++ inline namespaces.
DINamespace *createNameSpace(DIScope *Scope, StringRef Name, DIFile *File,
unsigned LineNo, bool ExportSymbols);
DINamespace *createNameSpace(DIScope *Scope, StringRef Name,
bool ExportSymbols);

/// This creates new descriptor for a module with the specified
/// parent scope.
Expand Down
37 changes: 16 additions & 21 deletions include/llvm/IR/DebugInfoMetadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -1853,45 +1853,40 @@ class DINamespace : public DIScope {
friend class LLVMContextImpl;
friend class MDNode;

unsigned Line;
unsigned ExportSymbols : 1;

DINamespace(LLVMContext &Context, StorageType Storage, unsigned Line,
bool ExportSymbols, ArrayRef<Metadata *> Ops)
DINamespace(LLVMContext &Context, StorageType Storage, bool ExportSymbols,
ArrayRef<Metadata *> Ops)
: DIScope(Context, DINamespaceKind, Storage, dwarf::DW_TAG_namespace,
Ops),
Line(Line), ExportSymbols(ExportSymbols) {}
ExportSymbols(ExportSymbols) {}
~DINamespace() = default;

static DINamespace *getImpl(LLVMContext &Context, DIScope *Scope,
DIFile *File, StringRef Name, unsigned Line,
bool ExportSymbols, StorageType Storage,
bool ShouldCreate = true) {
return getImpl(Context, Scope, File, getCanonicalMDString(Context, Name),
Line, ExportSymbols, Storage, ShouldCreate);
StringRef Name, bool ExportSymbols,
StorageType Storage, bool ShouldCreate = true) {
return getImpl(Context, Scope, getCanonicalMDString(Context, Name),
ExportSymbols, Storage, ShouldCreate);
}
static DINamespace *getImpl(LLVMContext &Context, Metadata *Scope,
Metadata *File, MDString *Name, unsigned Line,
bool ExportSymbols, StorageType Storage,
bool ShouldCreate = true);
MDString *Name, bool ExportSymbols,
StorageType Storage, bool ShouldCreate = true);

TempDINamespace cloneImpl() const {
return getTemporary(getContext(), getScope(), getFile(), getName(),
getLine(), getExportSymbols());
return getTemporary(getContext(), getScope(), getName(),
getExportSymbols());
}

public:
DEFINE_MDNODE_GET(DINamespace, (DIScope * Scope, DIFile *File, StringRef Name,
unsigned Line, bool ExportSymbols),
(Scope, File, Name, Line, ExportSymbols))
DEFINE_MDNODE_GET(DINamespace,
(Metadata * Scope, Metadata *File, MDString *Name,
unsigned Line, bool ExportSymbols),
(Scope, File, Name, Line, ExportSymbols))
(DIScope *Scope, StringRef Name, bool ExportSymbols),
(Scope, Name, ExportSymbols))
DEFINE_MDNODE_GET(DINamespace,
(Metadata *Scope, MDString *Name, bool ExportSymbols),
(Scope, Name, ExportSymbols))

TempDINamespace clone() const { return cloneImpl(); }

unsigned getLine() const { return Line; }
bool getExportSymbols() const { return ExportSymbols; }
DIScope *getScope() const { return cast_or_null<DIScope>(getRawScope()); }
StringRef getName() const { return getStringOperand(2); }
Expand Down
4 changes: 1 addition & 3 deletions lib/AsmParser/LLParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4150,15 +4150,13 @@ bool LLParser::ParseDILexicalBlockFile(MDNode *&Result, bool IsDistinct) {
bool LLParser::ParseDINamespace(MDNode *&Result, bool IsDistinct) {
#define VISIT_MD_FIELDS(OPTIONAL, REQUIRED) \
REQUIRED(scope, MDField, ); \
OPTIONAL(file, MDField, ); \
OPTIONAL(name, MDStringField, ); \
OPTIONAL(line, LineField, ); \
OPTIONAL(exportSymbols, MDBoolField, );
PARSE_MD_FIELDS();
#undef VISIT_MD_FIELDS

Result = GET_OR_DISTINCT(DINamespace,
(Context, scope.Val, file.Val, name.Val, line.Val, exportSymbols.Val));
(Context, scope.Val, name.Val, exportSymbols.Val));
return false;
}

Expand Down
12 changes: 8 additions & 4 deletions lib/Bitcode/Reader/MetadataLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1383,16 +1383,20 @@ Error MetadataLoader::MetadataLoaderImpl::parseOneMetadata(
break;
}
case bitc::METADATA_NAMESPACE: {
if (Record.size() != 5)
// Newer versions of DINamespace dropped file and line.
MDString *Name;
if (Record.size() == 3)
Name = getMDString(Record[2]);
else if (Record.size() == 5)
Name = getMDString(Record[3]);
else
return error("Invalid record");

IsDistinct = Record[0] & 1;
bool ExportSymbols = Record[0] & 2;
MetadataList.assignValue(
GET_OR_DISTINCT(DINamespace,
(Context, getMDOrNull(Record[1]),
getMDOrNull(Record[2]), getMDString(Record[3]),
Record[4], ExportSymbols)),
(Context, getMDOrNull(Record[1]), Name, ExportSymbols)),
NextMetadataNo);
NextMetadataNo++;
break;
Expand Down
2 changes: 0 additions & 2 deletions lib/Bitcode/Writer/BitcodeWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1646,9 +1646,7 @@ void ModuleBitcodeWriter::writeDINamespace(const DINamespace *N,
unsigned Abbrev) {
Record.push_back(N->isDistinct() | N->getExportSymbols() << 1);
Record.push_back(VE.getMetadataOrNullID(N->getScope()));
Record.push_back(VE.getMetadataOrNullID(N->getFile()));
Record.push_back(VE.getMetadataOrNullID(N->getRawName()));
Record.push_back(N->getLine());

Stream.EmitRecord(bitc::METADATA_NAMESPACE, Record, Abbrev);
Record.clear();
Expand Down
5 changes: 0 additions & 5 deletions lib/CodeGen/AsmPrinter/DwarfUnit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -375,10 +375,6 @@ void DwarfUnit::addSourceLine(DIE &Die, const DIObjCProperty *Ty) {
addSourceLine(Die, Ty->getLine(), Ty->getFilename(), Ty->getDirectory());
}

void DwarfUnit::addSourceLine(DIE &Die, const DINamespace *NS) {
addSourceLine(Die, NS->getLine(), NS->getFilename(), NS->getDirectory());
}

/* Byref variables, in Blocks, are declared by the programmer as "SomeType
VarName;", but the compiler creates a __Block_byref_x_VarName struct, and
gives the variable VarName either the struct, or a pointer to the struct, as
Expand Down Expand Up @@ -1085,7 +1081,6 @@ DIE *DwarfUnit::getOrCreateNameSpace(const DINamespace *NS) {
Name = "(anonymous namespace)";
DD->addAccelNamespace(Name, NDie);
addGlobalName(Name, NDie, NS->getScope());
addSourceLine(NDie, NS);
if (NS->getExportSymbols())
addFlag(NDie, dwarf::DW_AT_export_symbols);
return &NDie;
Expand Down
1 change: 0 additions & 1 deletion lib/CodeGen/AsmPrinter/DwarfUnit.h
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,6 @@ class RangeSpanList {
void addSourceLine(DIE &Die, const DIGlobalVariable *G);
void addSourceLine(DIE &Die, const DISubprogram *SP);
void addSourceLine(DIE &Die, const DIType *Ty);
void addSourceLine(DIE &Die, const DINamespace *NS);
void addSourceLine(DIE &Die, const DIObjCProperty *Ty);

/// Add constant value entry in variable DIE.
Expand Down
2 changes: 0 additions & 2 deletions lib/IR/AsmWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1756,8 +1756,6 @@ static void writeDINamespace(raw_ostream &Out, const DINamespace *N,
MDFieldPrinter Printer(Out, TypePrinter, Machine, Context);
Printer.printString("name", N->getName());
Printer.printMetadata("scope", N->getRawScope(), /* ShouldSkipNull */ false);
Printer.printMetadata("file", N->getRawFile());
Printer.printInt("line", N->getLine());
Printer.printBool("exportSymbols", N->getExportSymbols(), false);
Out << ")";
}
Expand Down
11 changes: 8 additions & 3 deletions lib/IR/DIBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -728,10 +728,15 @@ DISubprogram *DIBuilder::createMethod(
}

DINamespace *DIBuilder::createNameSpace(DIScope *Scope, StringRef Name,
DIFile *File, unsigned LineNo,
bool ExportSymbols) {
return DINamespace::get(VMContext, getNonCompileUnitScope(Scope), File, Name,
LineNo, ExportSymbols);

// It is okay to *not* make anonymous top-level namespaces distinct, because
// all nodes that have an anonymous namespace as their parent scope are
// guaranteed to be unique and/or are linked to their containing
// DICompileUnit. This decision is an explicit tradeoff of link time versus
// memory usage versus code simplicity and may get revisited in the future.
return DINamespace::get(VMContext, getNonCompileUnitScope(Scope), Name,
ExportSymbols);
}

DIModule *DIBuilder::createModule(DIScope *Scope, StringRef Name,
Expand Down
12 changes: 6 additions & 6 deletions lib/IR/DebugInfoMetadata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -507,13 +507,13 @@ DILexicalBlockFile *DILexicalBlockFile::getImpl(LLVMContext &Context,
}

DINamespace *DINamespace::getImpl(LLVMContext &Context, Metadata *Scope,
Metadata *File, MDString *Name, unsigned Line,
bool ExportSymbols, StorageType Storage,
bool ShouldCreate) {
MDString *Name, bool ExportSymbols,
StorageType Storage, bool ShouldCreate) {
assert(isCanonical(Name) && "Expected canonical MDString");
DEFINE_GETIMPL_LOOKUP(DINamespace, (Scope, File, Name, Line, ExportSymbols));
Metadata *Ops[] = {File, Scope, Name};
DEFINE_GETIMPL_STORE(DINamespace, (Line, ExportSymbols), Ops);
DEFINE_GETIMPL_LOOKUP(DINamespace, (Scope, Name, ExportSymbols));
// The nullptr is for DIScope's File operand. This should be refactored.
Metadata *Ops[] = {nullptr, Scope, Name};
DEFINE_GETIMPL_STORE(DINamespace, (ExportSymbols), Ops);
}

DIModule *DIModule::getImpl(LLVMContext &Context, Metadata *Scope,
Expand Down
17 changes: 6 additions & 11 deletions lib/IR/LLVMContextImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -699,26 +699,21 @@ template <> struct MDNodeKeyImpl<DILexicalBlockFile> {

template <> struct MDNodeKeyImpl<DINamespace> {
Metadata *Scope;
Metadata *File;
MDString *Name;
unsigned Line;
bool ExportSymbols;

MDNodeKeyImpl(Metadata *Scope, Metadata *File, MDString *Name, unsigned Line,
bool ExportSymbols)
: Scope(Scope), File(File), Name(Name), Line(Line),
ExportSymbols(ExportSymbols) {}
MDNodeKeyImpl(Metadata *Scope, MDString *Name, bool ExportSymbols)
: Scope(Scope), Name(Name), ExportSymbols(ExportSymbols) {}
MDNodeKeyImpl(const DINamespace *N)
: Scope(N->getRawScope()), File(N->getRawFile()), Name(N->getRawName()),
Line(N->getLine()), ExportSymbols(N->getExportSymbols()) {}
: Scope(N->getRawScope()), Name(N->getRawName()),
ExportSymbols(N->getExportSymbols()) {}

bool isKeyOf(const DINamespace *RHS) const {
return Scope == RHS->getRawScope() && File == RHS->getRawFile() &&
Name == RHS->getRawName() && Line == RHS->getLine() &&
return Scope == RHS->getRawScope() && Name == RHS->getRawName() &&
ExportSymbols == RHS->getExportSymbols();
}
unsigned getHashValue() const {
return hash_combine(Scope, File, Name, Line);
return hash_combine(Scope, Name);
}
};

Expand Down
6 changes: 3 additions & 3 deletions test/Assembler/dinamespace.ll
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
!1 = distinct !{}
!2 = !DIFile(filename: "path/to/file", directory: "/path/to/dir")

; CHECK: !3 = !DINamespace(name: "Namespace", scope: !0, file: !2, line: 7)
!3 = !DINamespace(name: "Namespace", scope: !0, file: !2, line: 7)
; CHECK: !3 = !DINamespace(name: "Namespace", scope: !0)
!3 = !DINamespace(name: "Namespace", scope: !0)

; CHECK: !4 = !DINamespace(scope: !0)
!4 = !DINamespace(name: "", scope: !0, file: null, line: 0)
!4 = !DINamespace(name: "", scope: !0)
!5 = !DINamespace(scope: !0)
!6 = !DINamespace(scope: !0, exportSymbols: false)
; CHECK: !5 = !DINamespace(scope: !0, exportSymbols: true)
Expand Down
4 changes: 2 additions & 2 deletions test/Bitcode/DINamespace.ll
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ target triple = "x86_64-apple-macosx10.12.0"

!0 = distinct !DIGlobalVariable(name: "i", linkageName: "_ZN1N1iE", scope: !1, file: !2, line: 2, type: !3, isLocal: false, isDefinition: true)
; Test bitcode upgrade for DINamespace without an exportSymbols field.
; CHECK: !DINamespace(name: "N", scope: null, file: !{{[0-9]+}}, line: 1)
!1 = !DINamespace(name: "N", scope: null, file: !2, line: 1)
; CHECK: !DINamespace(name: "N", scope: null)
!1 = !DINamespace(name: "N", scope: null)
!2 = !DIFile(filename: "dinamespace.cpp", directory: "/")
!3 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
!4 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !2, producer: "clang version 4.0.0 (trunk 283228) (llvm/trunk 283225)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !5, globals: !6)
Expand Down
2 changes: 1 addition & 1 deletion test/CodeGen/X86/stack-protector-dbginfo.ll
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ attributes #0 = { sspreq }
!22 = !{i64* getelementptr inbounds ({ i64, [56 x i8] }, { i64, [56 x i8] }* @a, i32 0, i32 0)}
!23 = !DILocalVariable(name: "p2", line: 12, arg: 2, scope: !24, file: !10, type: !32)
!24 = distinct !DISubprogram(name: "min<unsigned long long>", linkageName: "_ZN3__13minIyEERKT_S3_RS1_", line: 12, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 12, file: !1, scope: !25, type: !27, templateParams: !33, variables: !35)
!25 = !DINamespace(name: "__1", line: 1, file: !26, scope: null)
!25 = !DINamespace(name: "__1", scope: null)
!26 = !DIFile(filename: "main.cpp", directory: "/Users/matt/ryan_bug")
!27 = !DISubroutineType(types: !28)
!28 = !{!29, !29, !32}
Expand Down
2 changes: 1 addition & 1 deletion test/DebugInfo/COFF/cpp-mangling.ll
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ attributes #1 = { nounwind readnone }
!4 = !{i32 2, !"Debug Info Version", i32 3}
!5 = !{!"clang version 3.9.0 "}
!6 = distinct !DISubprogram(name: "bar", linkageName: "\01?bar@foo@@YAHH@Z", scope: !7, file: !1, line: 2, type: !8, isLocal: false, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !2)
!7 = !DINamespace(name: "foo", scope: null, file: !1, line: 1)
!7 = !DINamespace(name: "foo", scope: null)
!8 = !DISubroutineType(types: !9)
!9 = !{!10, !10}
!10 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
Expand Down
4 changes: 2 additions & 2 deletions test/DebugInfo/COFF/scopes.ll
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ attributes #1 = { nounwind readnone }

!0 = distinct !DIGlobalVariableExpression(var: !1)
!1 = !DIGlobalVariable(name: "g", linkageName: "\01?g@bar@foo@@3UGlobalRecord@12@A", scope: !2, file: !3, line: 12, type: !5, isLocal: false, isDefinition: true)
!2 = !DINamespace(name: "bar", scope: !4, file: !3, line: 2)
!2 = !DINamespace(name: "bar", scope: !4)
!3 = !DIFile(filename: "t.cpp", directory: "D:\5Csrc\5Cllvm\5Cbuild")
!4 = !DINamespace(name: "foo", scope: null, file: !3, line: 1)
!4 = !DINamespace(name: "foo", scope: null)
!5 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "GlobalRecord", scope: !2, file: !3, line: 9, size: 32, align: 32, elements: !6, identifier: ".?AUGlobalRecord@bar@foo@@")
!6 = !{!7, !9}
!7 = !DIDerivedType(tag: DW_TAG_member, name: "x", scope: !5, file: !3, line: 10, baseType: !8, size: 32, align: 32)
Expand Down
2 changes: 1 addition & 1 deletion test/DebugInfo/Generic/dwarf-public-names.ll
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ attributes #1 = { nounwind readnone }
!16 = !DIGlobalVariable(name: "global_variable", scope: null, file: !3, line: 17, type: !2, isLocal: false, isDefinition: true) ; previously: invalid DW_TAG_base_type
!17 = !DIGlobalVariableExpression(var: !18)
!18 = !DIGlobalVariable(name: "global_namespace_variable", linkageName: "_ZN2ns25global_namespace_variableE", scope: !19, file: !3, line: 27, type: !6, isLocal: false, isDefinition: true)
!19 = !DINamespace(name: "ns", scope: null, file: !3, line: 23)
!19 = !DINamespace(name: "ns", scope: null)
!20 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "clang version 3.3 (http://llvm.org/git/clang.git a09cd8103a6a719cb2628cdf0c91682250a17bd2) (http://llvm.org/git/llvm.git 47d03cec0afca0c01ae42b82916d1d731716cd20)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !11, retainedTypes: !11, globals: !21, imports: !11) ; previously: invalid DW_TAG_base_type
!21 = !{!0, !15, !17}
!22 = !{i32 1, !"Debug Info Version", i32 3}
Expand Down
22 changes: 11 additions & 11 deletions test/DebugInfo/Generic/namespace.ll
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

; RUN: %llc_dwarf -O0 -filetype=obj -dwarf-linkage-names=All < %s | llvm-dwarfdump - | FileCheck %s
; CHECK: debug_info contents
; CHECK: DW_AT_name{{.*}}= [[F1:.*]])
; CHECK: [[NS1:0x[0-9a-f]*]]:{{ *}}DW_TAG_namespace
; CHECK-NEXT: DW_AT_name{{.*}} = "A"
; CHECK-NEXT: DW_AT_decl_file{{.*}}([[F1:".*debug-info-namespace.cpp"]])
; CHECK-NEXT: DW_AT_decl_line{{.*}}(5)
; CHECK-NOT: DW_AT_decl_file
; CHECK-NOT: DW_AT_decl_line
; CHECK-NOT: NULL
; CHECK: [[NS2:0x[0-9a-f]*]]:{{ *}}DW_TAG_namespace
; CHECK-NEXT: DW_AT_name{{.*}} = "B"
; CHECK-NEXT: DW_AT_decl_file{{.*}}([[F2:".*foo.cpp"]])
; CHECK-NEXT: DW_AT_decl_line{{.*}}(1)
; CHECK-NOT: DW_AT_decl_file
; CHECK-NOT: DW_AT_decl_line
; CHECK-NOT: NULL
; CHECK: [[I:0x[0-9a-f]*]]:{{ *}}DW_TAG_variable
; CHECK-NEXT: DW_AT_name{{.*}}= "i"
Expand Down Expand Up @@ -56,15 +56,15 @@
; CHECK: DW_TAG_imported_module
; This is a bug, it should be in F2 but it inherits the file from its
; enclosing scope
; CHECK-NEXT: DW_AT_decl_file{{.*}}([[F1]])
; CHECK-NEXT: DW_AT_decl_file{{.*}}stdin
; CHECK-NEXT: DW_AT_decl_line{{.*}}(15)
; CHECK-NEXT: DW_AT_import{{.*}}=> {[[NS2]]})
; CHECK: NULL
; CHECK-NOT: NULL

; CHECK: DW_TAG_imported_module
; Same bug as above, this should be F2, not F1
; CHECK-NEXT: DW_AT_decl_file{{.*}}([[F1]])
; Same bug as above, this should be F2
; CHECK-NEXT: DW_AT_decl_file{{.*}}debug-info-namespace.cpp
; CHECK-NEXT: DW_AT_decl_line{{.*}}(18)
; CHECK-NEXT: DW_AT_import{{.*}}=> {[[NS1]]})
; CHECK-NOT: NULL
Expand All @@ -76,7 +76,7 @@
; CHECK: DW_AT_name{{.*}}= "func"
; CHECK-NOT: NULL
; CHECK: DW_TAG_imported_module
; CHECK-NEXT: DW_AT_decl_file{{.*}}([[F2]])
; CHECK-NEXT: DW_AT_decl_file{{.*}}([[F2:.*]])
; CHECK-NEXT: DW_AT_decl_line{{.*}}(26)
; CHECK-NEXT: DW_AT_import{{.*}}=> {[[NS1]]})
; CHECK-NOT: NULL
Expand Down Expand Up @@ -293,8 +293,8 @@ attributes #1 = { nounwind readnone }
!3 = !{!4, !8}
!4 = !DICompositeType(tag: DW_TAG_structure_type, name: "foo", line: 5, flags: DIFlagFwdDecl, file: !5, scope: !6, identifier: "_ZTSN1A1B3fooE")
!5 = !DIFile(filename: "foo.cpp", directory: "/tmp")
!6 = !DINamespace(name: "B", line: 1, file: !5, scope: !7)
!7 = !DINamespace(name: "A", line: 5, file: !1, scope: null)
!6 = !DINamespace(name: "B", scope: !7)
!7 = !DINamespace(name: "A", scope: null)
!8 = !DICompositeType(tag: DW_TAG_structure_type, name: "bar", line: 6, size: 8, align: 8, file: !5, scope: !6, elements: !2, identifier: "_ZTSN1A1B3barE")
!10 = distinct !DISubprogram(name: "f1", linkageName: "_ZN1A1B2f1Ev", line: 3, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 3, file: !5, scope: !6, type: !11, variables: !2)
!11 = !DISubroutineType(types: !12)
Expand Down
2 changes: 1 addition & 1 deletion test/DebugInfo/Generic/namespace_function_definition.ll
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ attributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointe
!1 = !DIFile(filename: "namespace_function_definition.cpp", directory: "/tmp/dbginfo")
!2 = !{}
!4 = distinct !DISubprogram(name: "func", linkageName: "_ZN2ns4funcEv", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 2, file: !1, scope: !5, type: !6, variables: !2)
!5 = !DINamespace(name: "ns", line: 1, file: !1, scope: null)
!5 = !DINamespace(name: "ns", scope: null)
!6 = !DISubroutineType(types: !7)
!7 = !{null}
!8 = !{i32 2, !"Dwarf Version", i32 4}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ attributes #2 = { nounwind readnone }
!7 = !{!8}
!8 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
!9 = distinct !DISubprogram(name: "func", linkageName: "_ZN2ns4funcEi", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 6, file: !1, scope: !10, type: !11, variables: !2)
!10 = !DINamespace(name: "ns", line: 1, file: !1, scope: null)
!10 = !DINamespace(name: "ns", scope: null)
!11 = !DISubroutineType(types: !12)
!12 = !{!8, !8}
!13 = !{i32 2, !"Dwarf Version", i32 4}
Expand Down
Loading

0 comments on commit 841400b

Please sign in to comment.