[PATCH] D21779: [LTO] Infer EKind/EMachine from Bitcode files
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 28 21:57:44 PDT 2016
ruiu added inline comments.
================
Comment at: ELF/InputFiles.cpp:556
@@ -554,2 +555,3 @@
-BitcodeFile::BitcodeFile(MemoryBufferRef M) : InputFile(BitcodeKind, M) {}
+ELFKind BitcodeFile::getELFKind(MemoryBufferRef M) {
+ std::string TripleStr = getBitcodeTargetTriple(M, Driver->Context);
----------------
M -> MB by convention.
================
Comment at: ELF/InputFiles.cpp:556
@@ -554,2 +555,3 @@
-BitcodeFile::BitcodeFile(MemoryBufferRef M) : InputFile(BitcodeKind, M) {}
+ELFKind BitcodeFile::getELFKind(MemoryBufferRef M) {
+ std::string TripleStr = getBitcodeTargetTriple(M, Driver->Context);
----------------
ruiu wrote:
> M -> MB by convention.
Can this be a non-member static function?
================
Comment at: ELF/InputFiles.cpp:561-562
@@ +560,4 @@
+ if (TheTriple.isLittleEndian())
+ return (Is64Bits) ? ELF64LEKind : ELF32LEKind;
+ return (Is64Bits) ? ELF64BEKind : ELF32BEKind;
+}
----------------
Remove () surrounding Is64Bits.
================
Comment at: ELF/InputFiles.cpp:565
@@ +564,3 @@
+
+uint8_t BitcodeFile::getMachineKind(MemoryBufferRef M) {
+ std::string TripleStr = getBitcodeTargetTriple(M, Driver->Context);
----------------
Ditto (M -> MB and non-member static function.)
================
Comment at: ELF/InputFiles.cpp:568
@@ +567,3 @@
+ Triple TheTriple(TripleStr);
+ switch (TheTriple.getArch()) {
+ default:
----------------
Can this be `Triple(TripleStr).getArch())`?
================
Comment at: ELF/InputFiles.cpp:569-570
@@ +568,4 @@
+ switch (TheTriple.getArch()) {
+ default:
+ break;
+ case llvm::Triple::aarch64:
----------------
Move this at end of this switch and inline fatal()
default:
fatal("...");
================
Comment at: ELF/InputFiles.cpp:592
@@ +591,3 @@
+
+BitcodeFile::BitcodeFile(MemoryBufferRef M) :
+ InputFile(BitcodeKind, M) {
----------------
M -> MB
http://reviews.llvm.org/D21779
More information about the llvm-commits
mailing list