SmallVector<std::string, 3> MCDwarfDirs;
SmallVector<MCDwarfFile, 3> MCDwarfFiles;
StringMap<unsigned> SourceIdMap;
- StringRef CompilationDir;
+ std::string CompilationDir;
MCDwarfFile RootFile;
bool HasSource = false;
private:
: dwarf::DW_FORM_string);
MCOS->EmitULEB128IntValue(MCDwarfDirs.size() + 1);
// Try not to emit an empty compilation directory.
- const StringRef &CompDir =
- CompilationDir.empty() ? CtxCompilationDir : CompilationDir;
+ const StringRef CompDir =
+ CompilationDir.empty() ? CtxCompilationDir : StringRef(CompilationDir);
if (LineStr) {
// Record path strings, emit references here.
LineStr->emitRef(MCOS, CompDir);
# REQUIRES: default_triple
# Darwin is stuck on DWARF v2.
# XFAIL: darwin
- .file 0 "root.cpp"
- .file 1 "header.h"
- .file 2 "root.cpp"
-# CHECK-5: include_directories[ 0] = "{{.+}}"
-# CHECK-4-NOT: include_directories
+ .file 0 "/test" "root.cpp"
+ .file 1 "/include" "header.h"
+ .file 2 "/test" "root.cpp"
+# CHECK-5: include_directories[ 0] = "/test"
+# CHECK-4-NOT: include_directories[ 0]
+# CHECK: include_directories[ 1] = "/include"
+# CHECK-NOT: include_directories
# CHECK-4-NOT: file_names[ 0]
# CHECK-5: file_names[ 0]:
# CHECK-5-NEXT: name: "root.cpp"
# CHECK-5-NEXT: dir_index: 0
# CHECK: file_names[ 1]:
# CHECK-NEXT: name: "header.h"
-# CHECK-NEXT: dir_index: 0
+# CHECK-NEXT: dir_index: 1
# CHECK: file_names[ 2]:
# CHECK-NEXT: name: "root.cpp"
# CHECK-NEXT: dir_index: 0