[llvm-commits] [llvm] r141989 - in /llvm/trunk: bindings/ocaml/llvm/llvm_ocaml.c lib/VMCore/Core.cpp
Torok Edwin
edwintorok at gmail.com
Fri Oct 14 13:37:42 PDT 2011
Author: edwin
Date: Fri Oct 14 15:37:42 2011
New Revision: 141989
URL: http://llvm.org/viewvc/llvm-project?rev=141989&view=rev
Log:
bindings: tab and indentation fixes of my previous commits
Modified:
llvm/trunk/bindings/ocaml/llvm/llvm_ocaml.c
llvm/trunk/lib/VMCore/Core.cpp
Modified: llvm/trunk/bindings/ocaml/llvm/llvm_ocaml.c
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/ocaml/llvm/llvm_ocaml.c?rev=141989&r1=141988&r2=141989&view=diff
==============================================================================
--- llvm/trunk/bindings/ocaml/llvm/llvm_ocaml.c (original)
+++ llvm/trunk/bindings/ocaml/llvm/llvm_ocaml.c Fri Oct 14 15:37:42 2011
@@ -295,15 +295,15 @@
/* lltype -> string option */
CAMLprim value llvm_struct_name(LLVMTypeRef Ty)
{
- CAMLparam0();
- const char *C = LLVMGetStructName(Ty);
- if (C) {
- CAMLlocal1(result);
- result = caml_alloc_small(1, 0);
- Store_field(result, 0, caml_copy_string(C));
- CAMLreturn(result);
- }
- CAMLreturn(Val_int(0));
+ CAMLparam0();
+ const char *C = LLVMGetStructName(Ty);
+ if (C) {
+ CAMLlocal1(result);
+ result = caml_alloc_small(1, 0);
+ Store_field(result, 0, caml_copy_string(C));
+ CAMLreturn(result);
+ }
+ CAMLreturn(Val_int(0));
}
/* lltype -> lltype array */
@@ -475,20 +475,20 @@
/* llvalue -> string option */
CAMLprim value llvm_get_mdstring(LLVMValueRef V) {
- CAMLparam0();
- const char *S;
- unsigned Len;
-
- if ((S = LLVMGetMDString(V, &Len))) {
- CAMLlocal2(Option, Str);
-
- Str = caml_alloc_string(Len);
- memcpy(String_val(Str), S, Len);
- Option = alloc(1,0);
- Store_field(Option, 0, Str);
- CAMLreturn(Option);
- }
- CAMLreturn(Val_int(0));
+ CAMLparam0();
+ const char *S;
+ unsigned Len;
+
+ if ((S = LLVMGetMDString(V, &Len))) {
+ CAMLlocal2(Option, Str);
+
+ Str = caml_alloc_string(Len);
+ memcpy(String_val(Str), S, Len);
+ Option = alloc(1,0);
+ Store_field(Option, 0, Str);
+ CAMLreturn(Option);
+ }
+ CAMLreturn(Val_int(0));
}
CAMLprim value llvm_get_namedmd(LLVMModuleRef M, value name)
@@ -1016,14 +1016,14 @@
/* llvalue -> ICmp.t */
CAMLprim value llvm_instr_icmp_predicate(LLVMValueRef Val) {
- CAMLparam0();
- int x = LLVMGetICmpPredicate(Val);
- if (x) {
- value Option = alloc(1, 0);
- Field(Option, 0) = Val_int(x - LLVMIntEQ);
- CAMLreturn(Option);
- }
- CAMLreturn(Val_int(0));
+ CAMLparam0();
+ int x = LLVMGetICmpPredicate(Val);
+ if (x) {
+ value Option = alloc(1, 0);
+ Field(Option, 0) = Val_int(x - LLVMIntEQ);
+ CAMLreturn(Option);
+ }
+ CAMLreturn(Val_int(0));
}
Modified: llvm/trunk/lib/VMCore/Core.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Core.cpp?rev=141989&r1=141988&r2=141989&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Core.cpp (original)
+++ llvm/trunk/lib/VMCore/Core.cpp Fri Oct 14 15:37:42 2011
@@ -309,10 +309,10 @@
const char *LLVMGetStructName(LLVMTypeRef Ty)
{
- StructType *Type = unwrap<StructType>(Ty);
- if (!Type->hasName())
- return 0;
- return Type->getName().data();
+ StructType *Type = unwrap<StructType>(Ty);
+ if (!Type->hasName())
+ return 0;
+ return Type->getName().data();
}
void LLVMStructSetBody(LLVMTypeRef StructTy, LLVMTypeRef *ElementTypes,
@@ -533,29 +533,29 @@
}
const char *LLVMGetMDString(LLVMValueRef V, unsigned* Len) {
- if (const MDString *S = dyn_cast<MDString>(unwrap(V))) {
- *Len = S->getString().size();
- return S->getString().data();
- }
- *Len = 0;
- return 0;
+ if (const MDString *S = dyn_cast<MDString>(unwrap(V))) {
+ *Len = S->getString().size();
+ return S->getString().data();
+ }
+ *Len = 0;
+ return 0;
}
unsigned LLVMGetNamedMetadataNumOperands(LLVMModuleRef M, const char* name)
{
- if (NamedMDNode *N = unwrap(M)->getNamedMetadata(name)) {
- return N->getNumOperands();
- }
- return 0;
+ if (NamedMDNode *N = unwrap(M)->getNamedMetadata(name)) {
+ return N->getNumOperands();
+ }
+ return 0;
}
void LLVMGetNamedMetadataOperands(LLVMModuleRef M, const char* name, LLVMValueRef *Dest)
{
- NamedMDNode *N = unwrap(M)->getNamedMetadata(name);
- if (!N)
- return;
- for (unsigned i=0;i<N->getNumOperands();i++)
- Dest[i] = wrap(N->getOperand(i));
+ NamedMDNode *N = unwrap(M)->getNamedMetadata(name);
+ if (!N)
+ return;
+ for (unsigned i=0;i<N->getNumOperands();i++)
+ Dest[i] = wrap(N->getOperand(i));
}
/*--.. Operations on scalar constants ......................................--*/
@@ -1583,12 +1583,12 @@
}
LLVMIntPredicate LLVMGetICmpPredicate(LLVMValueRef Inst) {
- if (ICmpInst *I = dyn_cast<ICmpInst>(unwrap(Inst)))
- return (LLVMIntPredicate)I->getPredicate();
- if (ConstantExpr *CE = dyn_cast<ConstantExpr>(unwrap(Inst)))
- if (CE->getOpcode() == Instruction::ICmp)
- return (LLVMIntPredicate)CE->getPredicate();
- return (LLVMIntPredicate)0;
+ if (ICmpInst *I = dyn_cast<ICmpInst>(unwrap(Inst)))
+ return (LLVMIntPredicate)I->getPredicate();
+ if (ConstantExpr *CE = dyn_cast<ConstantExpr>(unwrap(Inst)))
+ if (CE->getOpcode() == Instruction::ICmp)
+ return (LLVMIntPredicate)CE->getPredicate();
+ return (LLVMIntPredicate)0;
}
/*--.. Call and invoke instructions ........................................--*/
More information about the llvm-commits
mailing list