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 | e44fc85bba960ddffc1e8abaf9f919945ed218b9 (patch) | |
tree | fa9244951f4e94c8bb5bb570a3788e9a2de48267 /lib/Bitcode | |
parent | b218b278fe890162e7abb636a761dc90f95840cc (diff) | |
download | external_llvm-e44fc85bba960ddffc1e8abaf9f919945ed218b9.zip external_llvm-e44fc85bba960ddffc1e8abaf9f919945ed218b9.tar.gz external_llvm-e44fc85bba960ddffc1e8abaf9f919945ed218b9.tar.bz2 |
Simplify.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96269 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bitcode')
-rw-r--r-- | lib/Bitcode/Reader/BitReader.cpp | 27 |
1 files changed, 4 insertions, 23 deletions
diff --git a/lib/Bitcode/Reader/BitReader.cpp b/lib/Bitcode/Reader/BitReader.cpp index 1facbc3..7537435 100644 --- a/lib/Bitcode/Reader/BitReader.cpp +++ b/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, |