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/COFF
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2015-06-30 03:47:52 +0300
committerPeter Collingbourne <peter@pcc.me.uk>2015-06-30 03:47:52 +0300
commitf7b27d15f286b7da220395e8dc407934e00f5d25 (patch)
treebca0fb443329fba1683555746b6b382a59e076e7 /lld/COFF
parent71784d611d211c07efc5686ee795dfd7907ff7b5 (diff)
COFF: Implement SymbolBody::getDebugName() for DefinedBitcode symbols.
Differential Revision: http://reviews.llvm.org/D10827 llvm-svn: 241029
Diffstat (limited to 'lld/COFF')
-rw-r--r--lld/COFF/InputFiles.cpp3
-rw-r--r--lld/COFF/Symbols.cpp3
-rw-r--r--lld/COFF/Symbols.h9
3 files changed, 12 insertions, 3 deletions
diff --git a/lld/COFF/InputFiles.cpp b/lld/COFF/InputFiles.cpp
index 2819d393e650..47a6d0a98198 100644
--- a/lld/COFF/InputFiles.cpp
+++ b/lld/COFF/InputFiles.cpp
@@ -291,7 +291,8 @@ std::error_code BitcodeFile::parse() {
} else {
bool Replaceable = (SymbolDef == LTO_SYMBOL_DEFINITION_TENTATIVE ||
(Attrs & LTO_SYMBOL_COMDAT));
- SymbolBodies.push_back(new (Alloc) DefinedBitcode(SymName, Replaceable));
+ SymbolBodies.push_back(new (Alloc) DefinedBitcode(this, SymName,
+ Replaceable));
}
}
diff --git a/lld/COFF/Symbols.cpp b/lld/COFF/Symbols.cpp
index 4f7d9191c13b..883666e5780b 100644
--- a/lld/COFF/Symbols.cpp
+++ b/lld/COFF/Symbols.cpp
@@ -138,6 +138,9 @@ std::string SymbolBody::getDebugName() {
if (auto *D = dyn_cast<DefinedCOFF>(this)) {
N += " ";
N += D->File->getShortName();
+ } else if (auto *D = dyn_cast<DefinedBitcode>(this)) {
+ N += " ";
+ N += D->File->getShortName();
}
return N;
}
diff --git a/lld/COFF/Symbols.h b/lld/COFF/Symbols.h
index 58e025689fef..6710698d6661 100644
--- a/lld/COFF/Symbols.h
+++ b/lld/COFF/Symbols.h
@@ -28,6 +28,7 @@ using llvm::object::coff_import_header;
using llvm::object::coff_symbol_generic;
class ArchiveFile;
+class BitcodeFile;
class InputFile;
class ObjectFile;
class SymbolBody;
@@ -334,15 +335,19 @@ private:
};
class DefinedBitcode : public Defined {
+ friend SymbolBody;
public:
- DefinedBitcode(StringRef N, bool IsReplaceable)
- : Defined(DefinedBitcodeKind, N) {
+ DefinedBitcode(BitcodeFile *F, StringRef N, bool IsReplaceable)
+ : Defined(DefinedBitcodeKind, N), File(F) {
this->IsReplaceable = IsReplaceable;
}
static bool classof(const SymbolBody *S) {
return S->kind() == DefinedBitcodeKind;
}
+
+private:
+ BitcodeFile *File;
};
} // namespace coff