diff options
author | Daniel Dunbar <daniel@zuster.org> | 2010-02-15 21:08:22 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2010-02-15 21:08:22 +0000 |
commit | 754946c113eb292c1339148820eae5a3dc1c16f4 (patch) | |
tree | d0028d71d5416a8edd3bad9d2ca748d3db3d9905 /llvm/lib/Bitcode | |
parent | da52cec9e3c31f7703e9c23c8c4ba320f0163a8e (diff) | |
download | bcm5719-llvm-754946c113eb292c1339148820eae5a3dc1c16f4.tar.gz bcm5719-llvm-754946c113eb292c1339148820eae5a3dc1c16f4.zip |
Simplify.
llvm-svn: 96269
Diffstat (limited to 'llvm/lib/Bitcode')
-rw-r--r-- | llvm/lib/Bitcode/Reader/BitReader.cpp | 27 |
1 files changed, 4 insertions, 23 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitReader.cpp b/llvm/lib/Bitcode/Reader/BitReader.cpp index 1facbc37ff4..7537435a606 100644 --- a/llvm/lib/Bitcode/Reader/BitReader.cpp +++ b/llvm/lib/Bitcode/Reader/BitReader.cpp @@ -21,17 +21,8 @@ using namespace llvm; Optionally returns a human-readable error message via OutMessage. */ LLVMBool LLVMParseBitcode(LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutModule, char **OutMessage) { - std::string Message; - - *OutModule = wrap(ParseBitcodeFile(unwrap(MemBuf), getGlobalContext(), - &Message)); - if (!*OutModule) { - if (OutMessage) - *OutMessage = strdup(Message.c_str()); - return 1; - } - - return 0; + return LLVMParseBitcodeInContext(wrap(&getGlobalContext()), MemBuf, OutModule, + OutMessage); } LLVMBool LLVMParseBitcodeInContext(LLVMContextRef ContextRef, @@ -57,18 +48,8 @@ LLVMBool LLVMParseBitcodeInContext(LLVMContextRef ContextRef, LLVMBool LLVMGetBitcodeModuleProvider(LLVMMemoryBufferRef MemBuf, LLVMModuleProviderRef *OutMP, char **OutMessage) { - std::string Message; - - *OutMP = reinterpret_cast<LLVMModuleProviderRef>( - getLazyBitcodeModule(unwrap(MemBuf), getGlobalContext(), &Message)); - - if (!*OutMP) { - if (OutMessage) - *OutMessage = strdup(Message.c_str()); - return 1; - } - - return 0; + return LLVMGetBitcodeModuleProviderInContext(wrap(&getGlobalContext()), + MemBuf, OutMP, OutMessage); } LLVMBool LLVMGetBitcodeModuleProviderInContext(LLVMContextRef ContextRef, |