[PATCH] D11074: LLD: COFF: Infer machine type earlier than before.
Peter Collingbourne
peter at pcc.me.uk
Thu Jul 9 11:53:05 PDT 2015
pcc added inline comments.
================
Comment at: COFF/Driver.cpp:211
@@ -210,3 +210,3 @@
// Symbol names are mangled by appending "_" prefix on x86.
StringRef LinkerDriver::mangle(StringRef Sym) {
if (Config->MachineType == IMAGE_FILE_MACHINE_I386)
----------------
You could add an assertion here that the machine type is known.
================
Comment at: COFF/InputFiles.cpp:334-337
@@ +333,6 @@
+ return IMAGE_FILE_MACHINE_AMD64;
+ if (Triple.startswith("x86-"))
+ return IMAGE_FILE_MACHINE_I386;
+ if (Triple.startswith("arm-"))
+ return IMAGE_FILE_MACHINE_ARMNT;
+ return IMAGE_FILE_MACHINE_UNKNOWN;
----------------
These don't look right. x86-32 and ARM both have a number of variants for the first part of the target triple. The `llvm::Triple` class can parse the triple for you.
http://reviews.llvm.org/D11074
More information about the llvm-commits
mailing list