summaryrefslogtreecommitdiff
path: root/lib/ExecutionEngine/ExecutionEngineBindings.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-01-09 22:27:07 +0000
committerChris Lattner <sabre@nondot.org>2010-01-09 22:27:07 +0000
commitd686c8e73f74e37ab5f647b65a12051ee6cbad16 (patch)
tree06a78b36c6cc4de9d05158641373fb4e1bde72a0 /lib/ExecutionEngine/ExecutionEngineBindings.cpp
parent95fa80af6f0451bb52cd2d86dea1b165c5e2675a (diff)
downloadllvm-d686c8e73f74e37ab5f647b65a12051ee6cbad16.tar.gz
llvm-d686c8e73f74e37ab5f647b65a12051ee6cbad16.tar.bz2
llvm-d686c8e73f74e37ab5f647b65a12051ee6cbad16.tar.xz
"In order to ease automatic bindings generation, it would be helpful if boolean values were distinguishable from integers. The attached patch introduces "typedef int LLVMBool;", and uses LLVMBool instead of int throughout the C API, wherever a boolean value is called for."
Patch by James Y Knight! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93079 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/ExecutionEngineBindings.cpp')
-rw-r--r--lib/ExecutionEngine/ExecutionEngineBindings.cpp34
1 files changed, 17 insertions, 17 deletions
diff --git a/lib/ExecutionEngine/ExecutionEngineBindings.cpp b/lib/ExecutionEngine/ExecutionEngineBindings.cpp
index 5901cd757d..412b49320d 100644
--- a/lib/ExecutionEngine/ExecutionEngineBindings.cpp
+++ b/lib/ExecutionEngine/ExecutionEngineBindings.cpp
@@ -24,7 +24,7 @@ using namespace llvm;
LLVMGenericValueRef LLVMCreateGenericValueOfInt(LLVMTypeRef Ty,
unsigned long long N,
- int IsSigned) {
+ LLVMBool IsSigned) {
GenericValue *GenVal = new GenericValue();
GenVal->IntVal = APInt(unwrap<IntegerType>(Ty)->getBitWidth(), N, IsSigned);
return wrap(GenVal);
@@ -56,7 +56,7 @@ unsigned LLVMGenericValueIntWidth(LLVMGenericValueRef GenValRef) {
}
unsigned long long LLVMGenericValueToInt(LLVMGenericValueRef GenValRef,
- int IsSigned) {
+ LLVMBool IsSigned) {
GenericValue *GenVal = unwrap(GenValRef);
if (IsSigned)
return GenVal->IntVal.getSExtValue();
@@ -87,9 +87,9 @@ void LLVMDisposeGenericValue(LLVMGenericValueRef GenVal) {
/*===-- Operations on execution engines -----------------------------------===*/
-int LLVMCreateExecutionEngine(LLVMExecutionEngineRef *OutEE,
- LLVMModuleProviderRef MP,
- char **OutError) {
+LLVMBool LLVMCreateExecutionEngine(LLVMExecutionEngineRef *OutEE,
+ LLVMModuleProviderRef MP,
+ char **OutError) {
std::string Error;
EngineBuilder builder(unwrap(MP));
builder.setEngineKind(EngineKind::Either)
@@ -102,9 +102,9 @@ int LLVMCreateExecutionEngine(LLVMExecutionEngineRef *OutEE,
return 1;
}
-int LLVMCreateInterpreter(LLVMExecutionEngineRef *OutInterp,
- LLVMModuleProviderRef MP,
- char **OutError) {
+LLVMBool LLVMCreateInterpreter(LLVMExecutionEngineRef *OutInterp,
+ LLVMModuleProviderRef MP,
+ char **OutError) {
std::string Error;
EngineBuilder builder(unwrap(MP));
builder.setEngineKind(EngineKind::Interpreter)
@@ -117,10 +117,10 @@ int LLVMCreateInterpreter(LLVMExecutionEngineRef *OutInterp,
return 1;
}
-int LLVMCreateJITCompiler(LLVMExecutionEngineRef *OutJIT,
- LLVMModuleProviderRef MP,
- unsigned OptLevel,
- char **OutError) {
+LLVMBool LLVMCreateJITCompiler(LLVMExecutionEngineRef *OutJIT,
+ LLVMModuleProviderRef MP,
+ unsigned OptLevel,
+ char **OutError) {
std::string Error;
EngineBuilder builder(unwrap(MP));
builder.setEngineKind(EngineKind::JIT)
@@ -177,9 +177,9 @@ void LLVMAddModuleProvider(LLVMExecutionEngineRef EE, LLVMModuleProviderRef MP){
unwrap(EE)->addModuleProvider(unwrap(MP));
}
-int LLVMRemoveModuleProvider(LLVMExecutionEngineRef EE,
- LLVMModuleProviderRef MP,
- LLVMModuleRef *OutMod, char **OutError) {
+LLVMBool LLVMRemoveModuleProvider(LLVMExecutionEngineRef EE,
+ LLVMModuleProviderRef MP,
+ LLVMModuleRef *OutMod, char **OutError) {
std::string Error;
if (Module *Gone = unwrap(EE)->removeModuleProvider(unwrap(MP), &Error)) {
*OutMod = wrap(Gone);
@@ -190,8 +190,8 @@ int LLVMRemoveModuleProvider(LLVMExecutionEngineRef EE,
return 1;
}
-int LLVMFindFunction(LLVMExecutionEngineRef EE, const char *Name,
- LLVMValueRef *OutFn) {
+LLVMBool LLVMFindFunction(LLVMExecutionEngineRef EE, const char *Name,
+ LLVMValueRef *OutFn) {
if (Function *F = unwrap(EE)->FindFunctionNamed(Name)) {
*OutFn = wrap(F);
return 0;