bindings: tab and indentation fixes of my previous commits
authorTorok Edwin <edwintorok@gmail.com>
Fri, 14 Oct 2011 20:37:42 +0000 (20:37 +0000)
committerTorok Edwin <edwintorok@gmail.com>
Fri, 14 Oct 2011 20:37:42 +0000 (20:37 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141989 91177308-0d34-0410-b5e6-96231b3b80d8

bindings/ocaml/llvm/llvm_ocaml.c
lib/VMCore/Core.cpp

index dd8cb16544ca01c1ec2d4126d9649f670977af72..21519d474dfccfd682311b25fca01701e34efaa7 100644 (file)
@@ -295,15 +295,15 @@ CAMLprim LLVMTypeRef llvm_packed_struct_type(LLVMContextRef C,
 /* lltype -> string option */
 CAMLprim value llvm_struct_name(LLVMTypeRef Ty)
 {
 /* 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 */
 }
 
 /* lltype -> lltype array */
@@ -475,20 +475,20 @@ CAMLprim LLVMValueRef llvm_mdnode(LLVMContextRef C, value ElementVals) {
 
 /* llvalue -> string option */
 CAMLprim value llvm_get_mdstring(LLVMValueRef V) {
 
 /* 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)
 }
 
 CAMLprim value llvm_get_namedmd(LLVMModuleRef M, value name)
@@ -1016,14 +1016,14 @@ DEFINE_ITERATORS(instr, Instruction, LLVMBasicBlockRef, LLVMValueRef,
 
 /* llvalue -> ICmp.t */
 CAMLprim value llvm_instr_icmp_predicate(LLVMValueRef Val) {
 
 /* 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));
 }
 
 
 }
 
 
index 3c780794528045f05041cc8a59eeaba108f2a0f2..77d2e74cd223428d8305a948393bda9e2609141b 100644 (file)
@@ -309,10 +309,10 @@ LLVMTypeRef LLVMStructCreateNamed(LLVMContextRef C, const char *Name)
 
 const char *LLVMGetStructName(LLVMTypeRef Ty)
 {
 
 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,
 }
 
 void LLVMStructSetBody(LLVMTypeRef StructTy, LLVMTypeRef *ElementTypes,
@@ -533,29 +533,29 @@ LLVMValueRef LLVMMDNode(LLVMValueRef *Vals, unsigned Count) {
 }
 
 const char *LLVMGetMDString(LLVMValueRef V, unsigned* Len) {
 }
 
 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)
 {
 }
 
 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)
 {
 }
 
 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 ......................................--*/
 }
 
 /*--.. Operations on scalar constants ......................................--*/
@@ -1583,12 +1583,12 @@ void LLVMInstructionEraseFromParent(LLVMValueRef Inst) {
 }
 
 LLVMIntPredicate LLVMGetICmpPredicate(LLVMValueRef Inst) {
 }
 
 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 ........................................--*/
 }
 
 /*--.. Call and invoke instructions ........................................--*/