Skip to content

Commit 44b4b83

Browse files
committed
Rename DW_AT_LLVM_isysroot to DW_AT_LLVM_sysroot
This is a purely cosmetic change that is NFC in terms of the binary output. I bugs me that I called the attribute DW_AT_LLVM_isysroot since the "i" is an artifact of GCC command line option syntax (-isysroot is in the category of -i options) and doesn't carry any useful information otherwise. This attribute only appears in Clang module debug info. Differential Revision: https://reviews.llvm.org/D71722
1 parent e73c662 commit 44b4b83

File tree

19 files changed

+45
-45
lines changed

19 files changed

+45
-45
lines changed

clang/test/Modules/debug-info-moduleimport.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
// CHECK: ![[MODULE]] = !DIModule(scope: null, name: "DebugObjC",
1616
// CHECK-SAME: configMacros: "\22-DGREETING=Hello World\22 \22-UNDEBUG\22",
1717
// CHECK-SAME: includePath: "{{.*}}test{{.*}}Modules{{.*}}Inputs",
18-
// CHECK-SAME: isysroot: "/tmp/..")
18+
// CHECK-SAME: sysroot: "/tmp/..")
1919
// CHECK: ![[F]] = !DIFile(filename: {{.*}}debug-info-moduleimport.m
2020

2121
// RUN: %clang_cc1 -debug-info-kind=limited -fmodules -fimplicit-module-maps -fmodules-cache-path=%t \

lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -977,7 +977,7 @@ bool SymbolFileDWARF::ParseImportedModules(
977977
DW_AT_LLVM_include_path, nullptr))
978978
module.search_path = ConstString(include_path);
979979
if (const char *sysroot = module_die.GetAttributeValueAsString(
980-
DW_AT_LLVM_isysroot, nullptr))
980+
DW_AT_LLVM_sysroot, nullptr))
981981
module.sysroot = ConstString(sysroot);
982982
imported_modules.push_back(module);
983983
}

llvm/include/llvm-c/DebugInfo.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -283,15 +283,15 @@ LLVMDIBuilderCreateFile(LLVMDIBuilderRef Builder, const char *Filename,
283283
* \param ConfigMacrosLen The length of the C string passed to \c ConfigMacros.
284284
* \param IncludePath The path to the module map file.
285285
* \param IncludePathLen The length of the C string passed to \c IncludePath.
286-
* \param ISysRoot The Clang system root (value of -isysroot).
287-
* \param ISysRootLen The length of the C string passed to \c ISysRoot.
286+
* \param SysRoot The Clang system root (value of -isysroot).
287+
* \param SysRootLen The length of the C string passed to \c SysRoot.
288288
*/
289289
LLVMMetadataRef
290290
LLVMDIBuilderCreateModule(LLVMDIBuilderRef Builder, LLVMMetadataRef ParentScope,
291291
const char *Name, size_t NameLen,
292292
const char *ConfigMacros, size_t ConfigMacrosLen,
293293
const char *IncludePath, size_t IncludePathLen,
294-
const char *ISysRoot, size_t ISysRootLen);
294+
const char *SysRoot, size_t SysRootLen);
295295

296296
/**
297297
* Creates a new descriptor for a namespace with the specified parent scope.

llvm/include/llvm/BinaryFormat/Dwarf.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ HANDLE_DW_AT(0x3b31, BORLAND_closure, 0, BORLAND)
405405
// LLVM project extensions.
406406
HANDLE_DW_AT(0x3e00, LLVM_include_path, 0, LLVM)
407407
HANDLE_DW_AT(0x3e01, LLVM_config_macros, 0, LLVM)
408-
HANDLE_DW_AT(0x3e02, LLVM_isysroot, 0, LLVM)
408+
HANDLE_DW_AT(0x3e02, LLVM_sysroot, 0, LLVM)
409409
HANDLE_DW_AT(0x3e03, LLVM_tag_offset, 0, LLVM)
410410
// Apple extensions.
411411
HANDLE_DW_AT(0x3fe1, APPLE_optimized, 0, APPLE)

llvm/include/llvm/IR/DIBuilder.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -734,11 +734,11 @@ namespace llvm {
734734
/// A space-separated shell-quoted list of -D macro
735735
/// definitions as they would appear on a command line.
736736
/// \param IncludePath The path to the module map file.
737-
/// \param ISysRoot The clang system root (value of -isysroot).
737+
/// \param SysRoot The clang system root (value of -isysroot).
738738
DIModule *createModule(DIScope *Scope, StringRef Name,
739739
StringRef ConfigurationMacros,
740740
StringRef IncludePath,
741-
StringRef ISysRoot);
741+
StringRef SysRoot);
742742

743743
/// This creates a descriptor for a lexical block with a new file
744744
/// attached. This merely extends the existing

llvm/include/llvm/IR/DebugInfoMetadata.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2084,48 +2084,48 @@ class DIModule : public DIScope {
20842084

20852085
static DIModule *getImpl(LLVMContext &Context, DIScope *Scope,
20862086
StringRef Name, StringRef ConfigurationMacros,
2087-
StringRef IncludePath, StringRef ISysRoot,
2087+
StringRef IncludePath, StringRef SysRoot,
20882088
StorageType Storage, bool ShouldCreate = true) {
20892089
return getImpl(Context, Scope, getCanonicalMDString(Context, Name),
20902090
getCanonicalMDString(Context, ConfigurationMacros),
20912091
getCanonicalMDString(Context, IncludePath),
2092-
getCanonicalMDString(Context, ISysRoot),
2092+
getCanonicalMDString(Context, SysRoot),
20932093
Storage, ShouldCreate);
20942094
}
20952095
static DIModule *getImpl(LLVMContext &Context, Metadata *Scope,
20962096
MDString *Name, MDString *ConfigurationMacros,
2097-
MDString *IncludePath, MDString *ISysRoot,
2097+
MDString *IncludePath, MDString *SysRoot,
20982098
StorageType Storage, bool ShouldCreate = true);
20992099

21002100
TempDIModule cloneImpl() const {
21012101
return getTemporary(getContext(), getScope(), getName(),
21022102
getConfigurationMacros(), getIncludePath(),
2103-
getISysRoot());
2103+
getSysRoot());
21042104
}
21052105

21062106
public:
21072107
DEFINE_MDNODE_GET(DIModule, (DIScope *Scope, StringRef Name,
21082108
StringRef ConfigurationMacros, StringRef IncludePath,
2109-
StringRef ISysRoot),
2110-
(Scope, Name, ConfigurationMacros, IncludePath, ISysRoot))
2109+
StringRef SysRoot),
2110+
(Scope, Name, ConfigurationMacros, IncludePath, SysRoot))
21112111
DEFINE_MDNODE_GET(DIModule,
21122112
(Metadata *Scope, MDString *Name, MDString *ConfigurationMacros,
2113-
MDString *IncludePath, MDString *ISysRoot),
2114-
(Scope, Name, ConfigurationMacros, IncludePath, ISysRoot))
2113+
MDString *IncludePath, MDString *SysRoot),
2114+
(Scope, Name, ConfigurationMacros, IncludePath, SysRoot))
21152115

21162116
TempDIModule clone() const { return cloneImpl(); }
21172117

21182118
DIScope *getScope() const { return cast_or_null<DIScope>(getRawScope()); }
21192119
StringRef getName() const { return getStringOperand(1); }
21202120
StringRef getConfigurationMacros() const { return getStringOperand(2); }
21212121
StringRef getIncludePath() const { return getStringOperand(3); }
2122-
StringRef getISysRoot() const { return getStringOperand(4); }
2122+
StringRef getSysRoot() const { return getStringOperand(4); }
21232123

21242124
Metadata *getRawScope() const { return getOperand(0); }
21252125
MDString *getRawName() const { return getOperandAs<MDString>(1); }
21262126
MDString *getRawConfigurationMacros() const { return getOperandAs<MDString>(2); }
21272127
MDString *getRawIncludePath() const { return getOperandAs<MDString>(3); }
2128-
MDString *getRawISysRoot() const { return getOperandAs<MDString>(4); }
2128+
MDString *getRawSysRoot() const { return getOperandAs<MDString>(4); }
21292129

21302130
static bool classof(const Metadata *MD) {
21312131
return MD->getMetadataID() == DIModuleKind;

llvm/lib/AsmParser/LLParser.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4821,19 +4821,19 @@ bool LLParser::ParseDIMacroFile(MDNode *&Result, bool IsDistinct) {
48214821

48224822
/// ParseDIModule:
48234823
/// ::= !DIModule(scope: !0, name: "SomeModule", configMacros: "-DNDEBUG",
4824-
/// includePath: "/usr/include", isysroot: "/")
4824+
/// includePath: "/usr/include", sysroot: "/")
48254825
bool LLParser::ParseDIModule(MDNode *&Result, bool IsDistinct) {
48264826
#define VISIT_MD_FIELDS(OPTIONAL, REQUIRED) \
48274827
REQUIRED(scope, MDField, ); \
48284828
REQUIRED(name, MDStringField, ); \
48294829
OPTIONAL(configMacros, MDStringField, ); \
48304830
OPTIONAL(includePath, MDStringField, ); \
4831-
OPTIONAL(isysroot, MDStringField, );
4831+
OPTIONAL(sysroot, MDStringField, );
48324832
PARSE_MD_FIELDS();
48334833
#undef VISIT_MD_FIELDS
48344834

48354835
Result = GET_OR_DISTINCT(DIModule, (Context, scope.Val, name.Val,
4836-
configMacros.Val, includePath.Val, isysroot.Val));
4836+
configMacros.Val, includePath.Val, sysroot.Val));
48374837
return false;
48384838
}
48394839

llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1123,8 +1123,8 @@ DIE *DwarfUnit::getOrCreateModule(const DIModule *M) {
11231123
M->getConfigurationMacros());
11241124
if (!M->getIncludePath().empty())
11251125
addString(MDie, dwarf::DW_AT_LLVM_include_path, M->getIncludePath());
1126-
if (!M->getISysRoot().empty())
1127-
addString(MDie, dwarf::DW_AT_LLVM_isysroot, M->getISysRoot());
1126+
if (!M->getSysRoot().empty())
1127+
addString(MDie, dwarf::DW_AT_LLVM_sysroot, M->getSysRoot());
11281128

11291129
return &MDie;
11301130
}

llvm/lib/IR/AsmWriter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2057,7 +2057,7 @@ static void writeDIModule(raw_ostream &Out, const DIModule *N,
20572057
Printer.printString("name", N->getName());
20582058
Printer.printString("configMacros", N->getConfigurationMacros());
20592059
Printer.printString("includePath", N->getIncludePath());
2060-
Printer.printString("isysroot", N->getISysRoot());
2060+
Printer.printString("sysroot", N->getSysRoot());
20612061
Out << ")";
20622062
}
20632063

llvm/lib/IR/DIBuilder.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -830,9 +830,9 @@ DINamespace *DIBuilder::createNameSpace(DIScope *Scope, StringRef Name,
830830
DIModule *DIBuilder::createModule(DIScope *Scope, StringRef Name,
831831
StringRef ConfigurationMacros,
832832
StringRef IncludePath,
833-
StringRef ISysRoot) {
833+
StringRef SysRoot) {
834834
return DIModule::get(VMContext, getNonCompileUnitScope(Scope), Name,
835-
ConfigurationMacros, IncludePath, ISysRoot);
835+
ConfigurationMacros, IncludePath, SysRoot);
836836
}
837837

838838
DILexicalBlockFile *DIBuilder::createLexicalBlockFile(DIScope *Scope,

llvm/lib/IR/DebugInfo.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -782,12 +782,12 @@ LLVMDIBuilderCreateModule(LLVMDIBuilderRef Builder, LLVMMetadataRef ParentScope,
782782
const char *Name, size_t NameLen,
783783
const char *ConfigMacros, size_t ConfigMacrosLen,
784784
const char *IncludePath, size_t IncludePathLen,
785-
const char *ISysRoot, size_t ISysRootLen) {
785+
const char *SysRoot, size_t SysRootLen) {
786786
return wrap(unwrap(Builder)->createModule(
787787
unwrapDI<DIScope>(ParentScope), StringRef(Name, NameLen),
788788
StringRef(ConfigMacros, ConfigMacrosLen),
789789
StringRef(IncludePath, IncludePathLen),
790-
StringRef(ISysRoot, ISysRootLen)));
790+
StringRef(SysRoot, SysRootLen)));
791791
}
792792

793793
LLVMMetadataRef LLVMDIBuilderCreateNameSpace(LLVMDIBuilderRef Builder,

llvm/lib/IR/DebugInfoMetadata.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -715,12 +715,12 @@ DICommonBlock *DICommonBlock::getImpl(LLVMContext &Context, Metadata *Scope,
715715

716716
DIModule *DIModule::getImpl(LLVMContext &Context, Metadata *Scope,
717717
MDString *Name, MDString *ConfigurationMacros,
718-
MDString *IncludePath, MDString *ISysRoot,
718+
MDString *IncludePath, MDString *SysRoot,
719719
StorageType Storage, bool ShouldCreate) {
720720
assert(isCanonical(Name) && "Expected canonical MDString");
721721
DEFINE_GETIMPL_LOOKUP(
722-
DIModule, (Scope, Name, ConfigurationMacros, IncludePath, ISysRoot));
723-
Metadata *Ops[] = {Scope, Name, ConfigurationMacros, IncludePath, ISysRoot};
722+
DIModule, (Scope, Name, ConfigurationMacros, IncludePath, SysRoot));
723+
Metadata *Ops[] = {Scope, Name, ConfigurationMacros, IncludePath, SysRoot};
724724
DEFINE_GETIMPL_STORE_NO_CONSTRUCTOR_ARGS(DIModule, Ops);
725725
}
726726

llvm/lib/IR/LLVMContextImpl.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -819,27 +819,27 @@ template <> struct MDNodeKeyImpl<DIModule> {
819819
MDString *Name;
820820
MDString *ConfigurationMacros;
821821
MDString *IncludePath;
822-
MDString *ISysRoot;
822+
MDString *SysRoot;
823823

824824
MDNodeKeyImpl(Metadata *Scope, MDString *Name, MDString *ConfigurationMacros,
825-
MDString *IncludePath, MDString *ISysRoot)
825+
MDString *IncludePath, MDString *SysRoot)
826826
: Scope(Scope), Name(Name), ConfigurationMacros(ConfigurationMacros),
827-
IncludePath(IncludePath), ISysRoot(ISysRoot) {}
827+
IncludePath(IncludePath), SysRoot(SysRoot) {}
828828
MDNodeKeyImpl(const DIModule *N)
829829
: Scope(N->getRawScope()), Name(N->getRawName()),
830830
ConfigurationMacros(N->getRawConfigurationMacros()),
831-
IncludePath(N->getRawIncludePath()), ISysRoot(N->getRawISysRoot()) {}
831+
IncludePath(N->getRawIncludePath()), SysRoot(N->getRawSysRoot()) {}
832832

833833
bool isKeyOf(const DIModule *RHS) const {
834834
return Scope == RHS->getRawScope() && Name == RHS->getRawName() &&
835835
ConfigurationMacros == RHS->getRawConfigurationMacros() &&
836836
IncludePath == RHS->getRawIncludePath() &&
837-
ISysRoot == RHS->getRawISysRoot();
837+
SysRoot == RHS->getRawSysRoot();
838838
}
839839

840840
unsigned getHashValue() const {
841841
return hash_combine(Scope, Name,
842-
ConfigurationMacros, IncludePath, ISysRoot);
842+
ConfigurationMacros, IncludePath, SysRoot);
843843
}
844844
};
845845

llvm/test/Assembler/dimodule.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
; CHECK: !1 = !DIModule(scope: !0, name: "Module")
1010
!1 = !DIModule(scope: !0, name: "Module")
1111

12-
; CHECK: !2 = !DIModule(scope: !0, name: "Module", configMacros: "-DNDEBUG", includePath: "/usr/include", isysroot: "/")
13-
!2 = !DIModule(scope: !0, name: "Module", configMacros: "-DNDEBUG", includePath: "/usr/include", isysroot: "/")
12+
; CHECK: !2 = !DIModule(scope: !0, name: "Module", configMacros: "-DNDEBUG", includePath: "/usr/include", sysroot: "/")
13+
!2 = !DIModule(scope: !0, name: "Module", configMacros: "-DNDEBUG", includePath: "/usr/include", sysroot: "/")
1414

1515
!3 = !DIModule(scope: !0, name: "Module", configMacros: "")

llvm/test/CodeGen/X86/load-combine-dbg.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ define i32 @zext_load(i32* %arg) !dbg !30 {
2525

2626
!0 = !{i32 2, !"Debug Info Version", i32 3}
2727
!1 = distinct !DICompileUnit(language: DW_LANG_Swift, file: !3, isOptimized: false, emissionKind: FullDebug)
28-
!2 = !DIModule(scope: null, name: "test", includePath: "", isysroot: "/")
28+
!2 = !DIModule(scope: null, name: "test", includePath: "", sysroot: "/")
2929
!3 = !DIFile(filename: "main.swift", directory: "/")
3030

3131
!30 = distinct !DISubprogram(name: "main", scope: !2, file: !3, line: 1, type: !31, isLocal: false, isDefinition: true, isOptimized: false, unit: !1)

llvm/test/DebugInfo/X86/DIModule.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
; CHECK-NEXT: DW_AT_name {{.*}}"DebugModule"
77
; CHECK-NEXT: DW_AT_LLVM_config_macros {{.*}}"-DMODULES=0"
88
; CHECK-NEXT: DW_AT_LLVM_include_path {{.*}}"/llvm/tools/clang/test/Modules/Inputs"
9-
; CHECK-NEXT: DW_AT_LLVM_isysroot {{.*}}"/"
9+
; CHECK-NEXT: DW_AT_LLVM_sysroot {{.*}}"/"
1010

1111
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
1212
target triple = "x86_64-apple-macosx"
@@ -20,7 +20,7 @@ target triple = "x86_64-apple-macosx"
2020
!2 = !{}
2121
!3 = !{!4}
2222
!4 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !0, entity: !5, file: !1, line: 5)
23-
!5 = !DIModule(scope: null, name: "DebugModule", configMacros: "-DMODULES=0", includePath: "/llvm/tools/clang/test/Modules/Inputs", isysroot: "/")
23+
!5 = !DIModule(scope: null, name: "DebugModule", configMacros: "-DMODULES=0", includePath: "/llvm/tools/clang/test/Modules/Inputs", sysroot: "/")
2424
!6 = !{i32 2, !"Dwarf Version", i32 4}
2525
!7 = !{i32 2, !"Debug Info Version", i32 3}
2626
!8 = !{!"LLVM version 3.7.0"}

llvm/test/DebugInfo/X86/DIModuleContext.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ target triple = "x86_64-apple-macosx"
2525
!5 = !{!0}
2626
!6 = !{!7}
2727
!7 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !2, entity: !8, file: !3, line: 11)
28-
!8 = !DIModule(scope: null, name: "Module", includePath: ".", isysroot: "/")
28+
!8 = !DIModule(scope: null, name: "Module", includePath: ".", sysroot: "/")
2929
!9 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !10, size: 64, align: 64)
3030
!10 = !DICompositeType(tag: DW_TAG_structure_type, name: "s", scope: !8, file: !3, line: 1, flags: DIFlagFwdDecl)
3131
!11 = !{i32 2, !"Dwarf Version", i32 2}

llvm/test/DebugInfo/X86/clang-module.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ target triple = "x86_64-apple-macosx10.12.0"
2424
!1 = !DIFile(filename: "modules.m", directory: "/")
2525
!3 = !{!4}
2626
!4 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !0, entity: !5, line: 122)
27-
!5 = !DIModule(scope: null, name: "Foo", includePath: ".", isysroot: "/")
27+
!5 = !DIModule(scope: null, name: "Foo", includePath: ".", sysroot: "/")
2828
!6 = distinct !DICompileUnit(language: DW_LANG_ObjC, file: !7, producer: "clang version 5.0.0 (trunk 308357) (llvm/trunk 308379)", isOptimized: true, runtimeVersion: 0, splitDebugFilename: "/Foo.pcm", emissionKind: FullDebug, dwoId: 1234)
2929
!7 = !DIFile(filename: "Foo", directory: ".")
3030
!15 = !{i32 2, !"Dwarf Version", i32 4}

llvm/unittests/IR/MetadataTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2059,7 +2059,7 @@ TEST_F(DIModuleTest, get) {
20592059
EXPECT_EQ(Name, N->getName());
20602060
EXPECT_EQ(ConfigMacro, N->getConfigurationMacros());
20612061
EXPECT_EQ(Includes, N->getIncludePath());
2062-
EXPECT_EQ(Sysroot, N->getISysRoot());
2062+
EXPECT_EQ(Sysroot, N->getSysRoot());
20632063
EXPECT_EQ(N, DIModule::get(Context, Scope, Name,
20642064
ConfigMacro, Includes, Sysroot));
20652065
EXPECT_NE(N, DIModule::get(Context, getFile(), Name,

0 commit comments

Comments
 (0)