Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/llvm/llvm-project.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lld
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2015-06-30 02:26:28 +0300
committerPeter Collingbourne <peter@pcc.me.uk>2015-06-30 02:26:28 +0300
commit79cfd437b5fcb71d4b748831db888c700231c0c4 (patch)
tree930514660e85baa708368a63a5d509742ed3d226 /lld
parent40cdd7a8ea482149d493eacb2f2dc2c43ad06798 (diff)
COFF: Use LTOModule::getLinkerOpts() instead of reading the linker directives ourselves.
llvm-svn: 241020
Diffstat (limited to 'lld')
-rw-r--r--lld/COFF/InputFiles.cpp25
1 files changed, 1 insertions, 24 deletions
diff --git a/lld/COFF/InputFiles.cpp b/lld/COFF/InputFiles.cpp
index 2022554e26e3..2819d393e650 100644
--- a/lld/COFF/InputFiles.cpp
+++ b/lld/COFF/InputFiles.cpp
@@ -292,33 +292,10 @@ std::error_code BitcodeFile::parse() {
bool Replaceable = (SymbolDef == LTO_SYMBOL_DEFINITION_TENTATIVE ||
(Attrs & LTO_SYMBOL_COMDAT));
SymbolBodies.push_back(new (Alloc) DefinedBitcode(SymName, Replaceable));
-
- const llvm::GlobalValue *GV = M->getSymbolGV(I);
- if (GV && GV->hasDLLExportStorageClass()) {
- Directives += " /export:";
- Directives += SymName;
- if (!GV->getValueType()->isFunctionTy())
- Directives += ",data";
- }
- }
- }
-
- // Extract any linker directives from the bitcode file, which are represented
- // as module flags with the key "Linker Options".
- llvm::SmallVector<llvm::Module::ModuleFlagEntry, 8> Flags;
- M->getModule().getModuleFlagsMetadata(Flags);
- for (auto &&Flag : Flags) {
- if (Flag.Key->getString() != "Linker Options")
- continue;
-
- for (llvm::Metadata *Op : cast<llvm::MDNode>(Flag.Val)->operands()) {
- for (llvm::Metadata *InnerOp : cast<llvm::MDNode>(Op)->operands()) {
- Directives += " ";
- Directives += cast<llvm::MDString>(InnerOp)->getString();
- }
}
}
+ Directives = M->getLinkerOpts();
return std::error_code();
}