mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-21 18:24:23 +00:00
Simplify.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96269 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -21,17 +21,8 @@ using namespace llvm;
|
|||||||
Optionally returns a human-readable error message via OutMessage. */
|
Optionally returns a human-readable error message via OutMessage. */
|
||||||
LLVMBool LLVMParseBitcode(LLVMMemoryBufferRef MemBuf,
|
LLVMBool LLVMParseBitcode(LLVMMemoryBufferRef MemBuf,
|
||||||
LLVMModuleRef *OutModule, char **OutMessage) {
|
LLVMModuleRef *OutModule, char **OutMessage) {
|
||||||
std::string Message;
|
return LLVMParseBitcodeInContext(wrap(&getGlobalContext()), MemBuf, OutModule,
|
||||||
|
OutMessage);
|
||||||
*OutModule = wrap(ParseBitcodeFile(unwrap(MemBuf), getGlobalContext(),
|
|
||||||
&Message));
|
|
||||||
if (!*OutModule) {
|
|
||||||
if (OutMessage)
|
|
||||||
*OutMessage = strdup(Message.c_str());
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
LLVMBool LLVMParseBitcodeInContext(LLVMContextRef ContextRef,
|
LLVMBool LLVMParseBitcodeInContext(LLVMContextRef ContextRef,
|
||||||
@ -57,18 +48,8 @@ LLVMBool LLVMParseBitcodeInContext(LLVMContextRef ContextRef,
|
|||||||
LLVMBool LLVMGetBitcodeModuleProvider(LLVMMemoryBufferRef MemBuf,
|
LLVMBool LLVMGetBitcodeModuleProvider(LLVMMemoryBufferRef MemBuf,
|
||||||
LLVMModuleProviderRef *OutMP,
|
LLVMModuleProviderRef *OutMP,
|
||||||
char **OutMessage) {
|
char **OutMessage) {
|
||||||
std::string Message;
|
return LLVMGetBitcodeModuleProviderInContext(wrap(&getGlobalContext()),
|
||||||
|
MemBuf, OutMP, OutMessage);
|
||||||
*OutMP = reinterpret_cast<LLVMModuleProviderRef>(
|
|
||||||
getLazyBitcodeModule(unwrap(MemBuf), getGlobalContext(), &Message));
|
|
||||||
|
|
||||||
if (!*OutMP) {
|
|
||||||
if (OutMessage)
|
|
||||||
*OutMessage = strdup(Message.c_str());
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
LLVMBool LLVMGetBitcodeModuleProviderInContext(LLVMContextRef ContextRef,
|
LLVMBool LLVMGetBitcodeModuleProviderInContext(LLVMContextRef ContextRef,
|
||||||
|
Reference in New Issue
Block a user