[PATCH] COFF: Symbol resolution for common and comdat symbols defined in bitcode.
Rui Ueyama
ruiu at google.com
Mon Jun 8 20:44:09 PDT 2015
LGTM
================
Comment at: COFF/InputFiles.cpp:269
@@ -268,2 +268,3 @@
} else {
- SymbolBodies.push_back(new (Alloc) DefinedBitcode(SymName));
+ bool Replaceable = SymbolDef == LTO_SYMBOL_DEFINITION_TENTATIVE ||
+ SymbolDef == LTO_SYMBOL_DEFINITION_COMDAT;
----------------
Add parentheses after =
================
Comment at: COFF/SymbolTable.cpp:251
@@ +250,3 @@
+ !isa<DefinedBitcode>(Body->getReplacement()))
+ CG.addMustPreserveSymbol(Body->getName());
+
----------------
Nice. Looks like the separation of Symbol and SymbolBody works well here.
================
Comment at: COFF/Symbols.cpp:72
@@ +71,3 @@
+ auto *R = dyn_cast<DefinedRegular>(Other);
+ if (R)
+ return -compareRegularBitcode(R, this);
----------------
if (auto *R = ...
================
Comment at: COFF/Symbols.cpp:76
@@ +75,3 @@
+ auto *B = dyn_cast<DefinedBitcode>(Other);
+ if (B) {
+ if (!isReplaceable() && !B->isReplaceable())
----------------
if (auto *B = ...
================
Comment at: COFF/Symbols.cpp:82
@@ +81,3 @@
+ }
+
+ return 0;
----------------
Remove this blank line.
http://reviews.llvm.org/D10329
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
More information about the llvm-commits
mailing list