aboutsummaryrefslogtreecommitdiff
path: root/lib/Bitcode
diff options
context:
space:
mode:
authorDerek Schuff <dschuff@chromium.org>2013-01-11 15:29:34 -0800
committerDerek Schuff <dschuff@chromium.org>2013-01-11 15:29:34 -0800
commit0590f4264010a852dc22c9afa16a7df4d004c19a (patch)
tree018cedac9a062788c2fdc337165bbabc946b8d29 /lib/Bitcode
parentb770d0e0636a4b5ad61b1ca661caee67576c05fc (diff)
Replace DepLibs bitcode record with metadata
It keeps the same Module interface as the existing/old deplibs feature, but populates the library list from the metadata after reading the bitcode/LL into the Module. Keeping the same module interface will allow us to keep the existing uses (e.g. in the gold plugin) as they are. Internally it still uses the LibraryList variable, but uses it basically as a cache backed by the metadata. BUG= Review URL: https://codereview.chromium.org/11615013
Diffstat (limited to 'lib/Bitcode')
-rw-r--r--lib/Bitcode/Reader/BitcodeReader.cpp4
-rw-r--r--lib/Bitcode/Writer/BitcodeWriter.cpp3
2 files changed, 7 insertions, 0 deletions
diff --git a/lib/Bitcode/Reader/BitcodeReader.cpp b/lib/Bitcode/Reader/BitcodeReader.cpp
index 6098c1d61c..95650c5260 100644
--- a/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -2999,6 +2999,8 @@ Module *llvm::getLazyBitcodeModule(MemoryBuffer *Buffer,
R->materializeForwardReferencedFunctions();
+ M->convertMetadataToLibraryList(); // @LOCALMOD
+
return M;
}
@@ -3020,6 +3022,8 @@ Module *llvm::getStreamedBitcodeModule(const std::string &name,
R->materializeForwardReferencedFunctions();
+ M->convertMetadataToLibraryList(); // @LOCALMOD
+
return M;
}
diff --git a/lib/Bitcode/Writer/BitcodeWriter.cpp b/lib/Bitcode/Writer/BitcodeWriter.cpp
index ffe95d8f27..4ee63c486e 100644
--- a/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -1942,6 +1942,9 @@ void llvm::WriteBitcodeToFile(const Module *M, raw_ostream &Out) {
SmallVector<char, 0> Buffer;
Buffer.reserve(256*1024);
+ // Convert Deplib info to metadata
+ M->convertLibraryListToMetadata(); // @LOCALMOD
+
// If this is darwin or another generic macho target, reserve space for the
// header.
Triple TT(M->getTargetTriple());