[PATCH] D28095: [ELF] - Use information available from DW_AT_comp_dir attribute when doing error reporting.

Davide Italiano via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 25 09:29:55 PST 2016


davide added inline comments.


================
Comment at: ELF/InputFiles.cpp:48-50
+    if (static_cast<const ELFSectionRef &>(Sec).getFlags() & ELF::SHF_ALLOC)
+      return static_cast<const ELFSectionRef &>(Sec).getOffset();
+    return 0;
----------------
you can probably simplify a bit using the ternary operator here, i.e.
```
auto &patatino = static_cast<...>(Sec);
return (patatino.getFlags() & SHF_ALLOC) ? patatino.getOffset(); 0;
```


================
Comment at: ELF/InputFiles.h:204-206
+
+  // Containing the working directory of the compilation command.
+  llvm::Optional<std::string> CompilationDir;
----------------
what do you mean with "compilation command" ?


================
Comment at: test/ELF/conflict2.s:9
+
+# Assembler file below was generated with following command line:
+# /home/bar/some_path clang foo/1.cpp -g -S -o asm.s, and then reduced manually.
----------------
s/Assembler file/The file/
s/following/the following/


================
Comment at: test/ELF/conflict2.s:10
+# Assembler file below was generated with following command line:
+# /home/bar/some_path clang foo/1.cpp -g -S -o asm.s, and then reduced manually.
+# 1.cpp is a one line file: "int main() { return 0; }"
----------------
`/home/bar/some_path clang` ?


================
Comment at: test/ELF/conflict2.s:12
+# 1.cpp is a one line file: "int main() { return 0; }"
+# That way linker can extract current working directory of a compilation command from
+# DW_AT_comp_dir attribute for providing full patch when reporting errors.
----------------
s/linker/the linker/


================
Comment at: test/ELF/conflict2.s:13
+# That way linker can extract current working directory of a compilation command from
+# DW_AT_comp_dir attribute for providing full patch when reporting errors.
+
----------------
full patch or full path?


https://reviews.llvm.org/D28095





More information about the llvm-commits mailing list