summaryrefslogtreecommitdiffstats
path: root/lld/COFF/InputFiles.cpp
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2015-06-25 22:00:42 +0000
committerRui Ueyama <ruiu@google.com>2015-06-25 22:00:42 +0000
commit9b921e5dc962f5e12c7bb557492d663821615167 (patch)
tree19710c0ca81b39d3716e29128ff44abfcf7d6bb0 /lld/COFF/InputFiles.cpp
parent16238d90b2755009fa6cfc752863ef80a5adefe4 (diff)
downloadbcm5719-llvm-9b921e5dc962f5e12c7bb557492d663821615167.tar.gz
bcm5719-llvm-9b921e5dc962f5e12c7bb557492d663821615167.zip
COFF: Merge DefinedRegular and DefinedCOMDAT.
I split them in r240319 because I thought they are different enough that we should treat them as different types. It turned out that that was not a good idea. They are so similar that we ended up having many duplicate code. llvm-svn: 240706
Diffstat (limited to 'lld/COFF/InputFiles.cpp')
-rw-r--r--lld/COFF/InputFiles.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/lld/COFF/InputFiles.cpp b/lld/COFF/InputFiles.cpp
index 9a15827eaf7..d11c265104a 100644
--- a/lld/COFF/InputFiles.cpp
+++ b/lld/COFF/InputFiles.cpp
@@ -215,10 +215,8 @@ SymbolBody *ObjectFile::createSymbolBody(COFFSymbolRef Sym, const void *AuxP,
}
Chunk *C = SparseChunks[Sym.getSectionNumber()];
if (auto *SC = cast_or_null<SectionChunk>(C)) {
- if (!SC->isCOMDAT())
- return new (Alloc) DefinedRegular(COFFObj.get(), Sym, SC);
- auto *B = new (Alloc) DefinedCOMDAT(COFFObj.get(), Sym, SC);
- if (Sym.getValue() == 0 && !AuxP)
+ auto *B = new (Alloc) DefinedRegular(COFFObj.get(), Sym, SC);
+ if (SC->isCOMDAT() && Sym.getValue() == 0 && !AuxP)
SC->setSymbol(B);
return B;
}
OpenPOWER on IntegriCloud