diff options
author | Derek Schuff <dschuff@chromium.org> | 2013-01-11 15:29:34 -0800 |
---|---|---|
committer | Derek Schuff <dschuff@chromium.org> | 2013-01-11 15:29:34 -0800 |
commit | 0590f4264010a852dc22c9afa16a7df4d004c19a (patch) | |
tree | 018cedac9a062788c2fdc337165bbabc946b8d29 /lib/AsmParser | |
parent | b770d0e0636a4b5ad61b1ca661caee67576c05fc (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/AsmParser')
-rw-r--r-- | lib/AsmParser/Parser.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/AsmParser/Parser.cpp b/lib/AsmParser/Parser.cpp index a473e6b713..57b4b64895 100644 --- a/lib/AsmParser/Parser.cpp +++ b/lib/AsmParser/Parser.cpp @@ -31,12 +31,21 @@ Module *llvm::ParseAssembly(MemoryBuffer *F, // If we are parsing into an existing module, do it. if (M) - return LLParser(F, SM, Err, M).Run() ? 0 : M; + // @LOCALMOD-BEGIN + if (LLParser(F, SM, Err, M).Run()) { + return 0; + } + else { + M->convertMetadataToLibraryList(); + return M; + } + // @LOCALMOD-END // Otherwise create a new module. OwningPtr<Module> M2(new Module(F->getBufferIdentifier(), Context)); if (LLParser(F, SM, Err, M2.get()).Run()) return 0; + M2->convertMetadataToLibraryList(); // @LOCALMOD return M2.take(); } |