mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-22 05:21:13 +00:00
Simplify.
llvm-svn: 96269
This commit is contained in:
parent
bbf95aae9f
commit
d01423cec1
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user