[llvm-commits] [hlvm] r38416 - in /hlvm/trunk: build/codegen.py hlvm/CodeGen/LLVMEmitter.cpp hlvm/CodeGen/LLVMEmitter.h

Reid Spencer reid at x10sys.com
Sat Jul 7 17:03:11 PDT 2007


Author: reid
Date: Sat Jul  7 19:03:11 2007
New Revision: 38416

URL: http://llvm.org/viewvc/llvm-project?rev=38416&view=rev
Log:
More updates to support additional IR API changes in LLVM.

Modified:
    hlvm/trunk/build/codegen.py
    hlvm/trunk/hlvm/CodeGen/LLVMEmitter.cpp
    hlvm/trunk/hlvm/CodeGen/LLVMEmitter.h

Modified: hlvm/trunk/build/codegen.py
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/build/codegen.py?rev=38416&r1=38415&r2=38416&view=diff

==============================================================================
--- hlvm/trunk/build/codegen.py (original)
+++ hlvm/trunk/build/codegen.py Sat Jul  7 19:03:11 2007
@@ -10,7 +10,6 @@
   theAction = env.Action(
     "PATH='" + env['LLVM_bin'] + "' " + env['with_llvmgxx'] + env['CXXFLAGS'] +
       " -c -emit-llvm -x c++ " + src + " -o - | " + 
-    env['with_llvmdis'] + " -o - | " + 
     env['with_llvm2cpp'] + " " + env['LLVM2CPPFLAGS'] + " -o " + tgt
   )
   env.Depends(tgt,env['with_llvm2cpp'])

Modified: hlvm/trunk/hlvm/CodeGen/LLVMEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/hlvm/CodeGen/LLVMEmitter.cpp?rev=38416&r1=38415&r2=38416&view=diff

==============================================================================
--- hlvm/trunk/hlvm/CodeGen/LLVMEmitter.cpp (original)
+++ hlvm/trunk/hlvm/CodeGen/LLVMEmitter.cpp Sat Jul  7 19:03:11 2007
@@ -164,7 +164,8 @@
     CallInst* call_hlvm_text_create(const hlvm::ArgList& args, const char* nm)
     {
       Function* F = get_hlvm_text_create();
-      return new CallInst(F, args, (nm ? nm : "buffer"), TheBlock);
+      return new CallInst(F, &args[0], args.size(), (nm ? nm : "buffer"), 
+                          TheBlock);
     }
 
     Function* get_hlvm_text_delete()
@@ -186,7 +187,8 @@
     CallInst* call_hlvm_text_delete(const hlvm::ArgList& args)
     {
       Function* F = get_hlvm_text_delete();
-      return new CallInst(F, args, "hlvm_text_delete", TheBlock);
+      return new CallInst(F, &args[0], args.size(), "hlvm_text_delete", 
+                          TheBlock);
     }
 
     Function* get_hlvm_text_to_buffer()
@@ -207,7 +209,8 @@
     CallInst* call_hlvm_text_to_buffer(const hlvm::ArgList& args, const char* nm)
     {
       Function* F = get_hlvm_text_to_buffer();
-      return new CallInst(F, args, (nm ? nm : "buffer"), TheBlock);
+      return new CallInst(F, &args[0], args.size(), (nm ? nm : "buffer"), 
+                          TheBlock);
     }
 
     PointerType* get_hlvm_buffer()
@@ -239,7 +242,8 @@
     CallInst* call_hlvm_buffer_create(const hlvm::ArgList& args, const char* nm)
     {
       Function* F = get_hlvm_buffer_create();
-      return new CallInst(F, args, (nm ? nm : "buffer"), TheBlock);
+      return new CallInst(F, &args[0], args.size(), (nm ? nm : "buffer"), 
+                          TheBlock);
     }
 
     Function* get_hlvm_buffer_delete()
@@ -260,7 +264,7 @@
     CallInst* call_hlvm_buffer_delete(const hlvm::ArgList& args)
     {
       Function* F = get_hlvm_buffer_delete();
-      return new CallInst(F, args, "", TheBlock);
+      return new CallInst(F, &args[0], args.size(), "", TheBlock);
     }
 
     PointerType* get_hlvm_stream()
@@ -292,7 +296,7 @@
     CallInst* call_hlvm_stream_open(const hlvm::ArgList& args, const char* nm)
     {
       Function* F = get_hlvm_stream_open();
-      return new CallInst(F, args, (nm ? nm : "stream"), TheBlock);
+      return new CallInst(F, &args[0], args.size(), (nm ? nm : "stream"), TheBlock);
     }
 
     Function* get_hlvm_stream_read()
@@ -315,7 +319,7 @@
     CallInst* call_hlvm_stream_read(const hlvm::ArgList& args, const char* nm)
     {
       Function* F = get_hlvm_stream_read();
-      return new CallInst(F, args, (nm ? nm : "readlen"), TheBlock);
+      return new CallInst(F, &args[0], args.size(), (nm ? nm : "readlen"), TheBlock);
     }
 
     Function* get_hlvm_stream_write_buffer()
@@ -337,7 +341,7 @@
     CallInst* call_hlvm_stream_write_buffer(const hlvm::ArgList& args, const char* nm)
     {
       Function* F = get_hlvm_stream_write_buffer();
-      return new CallInst(F, args, (nm ? nm : "writelen"), TheBlock);
+      return new CallInst(F, &args[0], args.size(), (nm ? nm : "writelen"), TheBlock);
     }
 
     Function* get_hlvm_stream_write_string()
@@ -359,7 +363,7 @@
     CallInst* call_hlvm_stream_write_string(const hlvm::ArgList& args, const char* nm)
     {
       Function* F = get_hlvm_stream_write_string();
-      return new CallInst(F, args, (nm ? nm : "writelen"), TheBlock);
+      return new CallInst(F, &args[0], args.size(), (nm ? nm : "writelen"), TheBlock);
     }
 
     Function* get_hlvm_stream_write_text()
@@ -381,7 +385,7 @@
     CallInst* call_hlvm_stream_write_text(const hlvm::ArgList& args, const char* nm)
     {
       Function* F = get_hlvm_stream_write_text();
-      return new CallInst(F, args, (nm ? nm : "writelen"), TheBlock);
+      return new CallInst(F, &args[0], args.size(), (nm ? nm : "writelen"), TheBlock);
     }
 
     Function* get_hlvm_stream_close()
@@ -402,7 +406,7 @@
     CallInst* call_hlvm_stream_close(const hlvm::ArgList& args)
     {
       Function* F = get_hlvm_stream_close();
-      return new CallInst(F, args, "", TheBlock);
+      return new CallInst(F, &args[0], args.size(), "", TheBlock);
     }
 
     FunctionType* get_hlvm_program_signature()
@@ -697,87 +701,88 @@
 
     CallInst* call_hlvm_f32_ispinf(const hlvm::ArgList& args)
     {
-      return new CallInst(get_hlvm_f32_ispinf(), args, "", TheBlock);
+      return new CallInst(get_hlvm_f32_ispinf(), &args[0], args.size(), "", TheBlock);
     }
 
     CallInst* call_hlvm_f32_isninf(const hlvm::ArgList& args)
     {
-      return new CallInst(get_hlvm_f32_isninf(), args, "", TheBlock);
+      return new CallInst(get_hlvm_f32_isninf(), &args[0], args.size(), "", TheBlock);
     }
 
     CallInst* call_hlvm_f32_isnan(const hlvm::ArgList& args)
     {
-      return new CallInst(get_hlvm_f32_isnan(), args, "", TheBlock);
+      return new CallInst(get_hlvm_f32_isnan(), &args[0], args.size(), "", TheBlock);
     }
 
     CallInst* call_hlvm_f32_trunc(const hlvm::ArgList& args)
     {
-      return new CallInst(get_hlvm_f32_trunc(), args, "", TheBlock);
+      return new CallInst(get_hlvm_f32_trunc(), &args[0], args.size(), "", TheBlock);
     }
 
     CallInst* call_hlvm_f32_round(const hlvm::ArgList& args)
     {
-      return new CallInst(get_hlvm_f32_round(), args, "", TheBlock);
+      return new CallInst(get_hlvm_f32_round(), &args[0], args.size(), "", TheBlock);
     }
 
     CallInst* call_hlvm_f32_floor(const hlvm::ArgList& args)
     {
-      return new CallInst(get_hlvm_f32_floor(), args, "", TheBlock);
+      return new CallInst(get_hlvm_f32_floor(), &args[0], args.size(), "", TheBlock);
     }
 
     CallInst* call_hlvm_f32_ceiling(const hlvm::ArgList& args)
     {
-      return new CallInst(get_hlvm_f32_ceiling(), args, "", TheBlock);
+      return new CallInst(get_hlvm_f32_ceiling(), &args[0], args.size(), "", TheBlock);
     }
 
     CallInst* call_hlvm_f32_loge(const hlvm::ArgList& args)
     {
-      return new CallInst(get_hlvm_f32_loge(), args, "", TheBlock);
+      return new CallInst(get_hlvm_f32_loge(), &args[0], args.size(), "", TheBlock);
     }
 
     CallInst* call_hlvm_f32_log2(const hlvm::ArgList& args)
     {
-      return new CallInst(get_hlvm_f32_log2(), args, "", TheBlock);
+      return new CallInst(get_hlvm_f32_log2(), &args[0], args.size(), "", TheBlock);
     }
 
     CallInst* call_hlvm_f32_log10(const hlvm::ArgList& args)
     {
-      return new CallInst(get_hlvm_f32_log10(), args, "", TheBlock);
+      return new CallInst(get_hlvm_f32_log10(), &args[0], args.size(), "", TheBlock);
     }
 
     CallInst* call_hlvm_f32_squareroot(const hlvm::ArgList& args)
     {
-      return new CallInst(get_hlvm_f32_squareroot(), args, "", TheBlock);
+      return new CallInst(get_hlvm_f32_squareroot(), &args[0], args.size(), "", TheBlock);
     }
 
     CallInst* call_hlvm_f32_cuberoot(const hlvm::ArgList& args)
     {
-      return new CallInst(get_hlvm_f32_cuberoot(), args, "", TheBlock);
+      return new CallInst(get_hlvm_f32_cuberoot(), &args[0], args.size(), "", TheBlock);
     }
 
     CallInst* call_hlvm_f32_factorial(const hlvm::ArgList& args)
     {
-      return new CallInst(get_hlvm_f32_factorial(), args, "", TheBlock);
+      return new CallInst(get_hlvm_f32_factorial(), &args[0], args.size(), "", TheBlock);
     }
 
     CallInst* call_hlvm_f32_power(const hlvm::ArgList& args)
     {
-      return new CallInst(get_hlvm_f32_power(), args, "", TheBlock);
+      return new CallInst(get_hlvm_f32_power(), &args[0], args.size(), "", TheBlock);
     }
 
     CallInst* call_hlvm_f32_root(const hlvm::ArgList& args)
     {
-      return new CallInst(get_hlvm_f32_root(), args, "", TheBlock);
+      return new CallInst(get_hlvm_f32_root(), &args[0], args.size(), "", TheBlock);
     }
 
     CallInst* call_hlvm_f32_gcd(const hlvm::ArgList& args)
     {
-      return new CallInst(get_hlvm_f32_gcd(), args, "", TheBlock);
+      return new CallInst(get_hlvm_f32_gcd(), &args[0], args.size(), "", TheBlock);
     }
 
     CallInst* call_hlvm_f32_lcm(const hlvm::ArgList& args)
     {
-      return new CallInst(get_hlvm_f32_lcm(), args, "", TheBlock);
+      return new CallInst(get_hlvm_f32_lcm(), &args[0], args.size(), "", 
+                          TheBlock);
     }
 
     Function* get_hlvm_f64_ispinf()
@@ -1024,87 +1029,104 @@
 
     CallInst* call_hlvm_f64_ispinf(const hlvm::ArgList& args)
     {
-      return new CallInst(get_hlvm_f64_ispinf(), args, "", TheBlock);
+      return new CallInst(get_hlvm_f64_ispinf(), &args[0], args.size(), "", 
+                          TheBlock);
     }
 
     CallInst* call_hlvm_f64_isninf(const hlvm::ArgList& args)
     {
-      return new CallInst(get_hlvm_f64_isninf(), args, "", TheBlock);
+      return new CallInst(get_hlvm_f64_isninf(), &args[0], args.size(), "", 
+                          TheBlock);
     }
 
     CallInst* call_hlvm_f64_isnan(const hlvm::ArgList& args)
     {
-      return new CallInst(get_hlvm_f64_isnan(), args, "", TheBlock);
+      return new CallInst(get_hlvm_f64_isnan(), &args[0], args.size(), "", 
+                          TheBlock);
     }
 
     CallInst* call_hlvm_f64_trunc(const hlvm::ArgList& args)
     {
-      return new CallInst(get_hlvm_f64_trunc(), args, "", TheBlock);
+      return new CallInst(get_hlvm_f64_trunc(), &args[0], args.size(), "", 
+                          TheBlock);
     }
 
     CallInst* call_hlvm_f64_round(const hlvm::ArgList& args)
     {
-      return new CallInst(get_hlvm_f64_round(), args, "", TheBlock);
+      return new CallInst(get_hlvm_f64_round(), &args[0], args.size(), "", 
+                          TheBlock);
     }
 
     CallInst* call_hlvm_f64_floor(const hlvm::ArgList& args)
     {
-      return new CallInst(get_hlvm_f64_floor(), args, "", TheBlock);
+      return new CallInst(get_hlvm_f64_floor(), &args[0], args.size(), "", 
+                          TheBlock);
     }
 
     CallInst* call_hlvm_f64_ceiling(const hlvm::ArgList& args)
     {
-      return new CallInst(get_hlvm_f64_ceiling(), args, "", TheBlock);
+      return new CallInst(get_hlvm_f64_ceiling(), &args[0], args.size(), "", 
+                          TheBlock);
     }
 
     CallInst* call_hlvm_f64_loge(const hlvm::ArgList& args)
     {
-      return new CallInst(get_hlvm_f64_loge(), args, "", TheBlock);
+      return new CallInst(get_hlvm_f64_loge(), &args[0], args.size(), "", 
+                          TheBlock);
     }
 
     CallInst* call_hlvm_f64_log2(const hlvm::ArgList& args)
     {
-      return new CallInst(get_hlvm_f64_log2(), args, "", TheBlock);
+      return new CallInst(get_hlvm_f64_log2(), &args[0], args.size(), "", 
+                          TheBlock);
     }
 
     CallInst* call_hlvm_f64_log10(const hlvm::ArgList& args)
     {
-      return new CallInst(get_hlvm_f64_log10(), args, "", TheBlock);
+      return new CallInst(get_hlvm_f64_log10(), &args[0], args.size(), "", 
+                          TheBlock);
     }
 
     CallInst* call_hlvm_f64_squareroot(const hlvm::ArgList& args)
     {
-      return new CallInst(get_hlvm_f64_squareroot(), args, "", TheBlock);
+      return new CallInst(get_hlvm_f64_squareroot(), &args[0], args.size(), "",
+                          TheBlock);
     }
 
     CallInst* call_hlvm_f64_cuberoot(const hlvm::ArgList& args)
     {
-      return new CallInst(get_hlvm_f64_cuberoot(), args, "", TheBlock);
+      return new CallInst(get_hlvm_f64_cuberoot(), &args[0], args.size(), "", 
+                          TheBlock);
     }
 
     CallInst* call_hlvm_f64_factorial(const hlvm::ArgList& args)
     {
-      return new CallInst(get_hlvm_f64_factorial(), args, "", TheBlock);
+      return new CallInst(get_hlvm_f64_factorial(), &args[0], args.size(), "", 
+                          TheBlock);
     }
 
     CallInst* call_hlvm_f64_power(const hlvm::ArgList& args)
     {
-      return new CallInst(get_hlvm_f64_power(), args, "", TheBlock);
+      return new CallInst(get_hlvm_f64_power(), &args[0], args.size(), "", 
+                          TheBlock);
     }
 
     CallInst* call_hlvm_f64_root(const hlvm::ArgList& args)
     {
-      return new CallInst(get_hlvm_f64_root(), args, "", TheBlock);
+      return new CallInst(get_hlvm_f64_root(), &args[0], args.size(), "", 
+                          TheBlock);
     }
 
     CallInst* call_hlvm_f64_gcd(const hlvm::ArgList& args)
     {
-      return new CallInst(get_hlvm_f64_gcd(), args, "", TheBlock);
+      return new CallInst(get_hlvm_f64_gcd(), &args[0], args.size(), "", 
+                          TheBlock);
     }
 
     CallInst* call_hlvm_f64_lcm(const hlvm::ArgList& args)
     {
-      return new CallInst(get_hlvm_f64_lcm(), args, "", TheBlock);
+      return new CallInst(get_hlvm_f64_lcm(), &args[0], args.size(), "", 
+                          TheBlock);
     }
 
   /// @}
@@ -1330,8 +1352,8 @@
     return NumElts;
   } else if (const ArrayType *ATy = dyn_cast<ArrayType>(Ty)) {
     return ATy->getNumElements() * getNumElements(ATy->getElementType());
-  } else if (const PackedType* PTy = dyn_cast<PackedType>(Ty)) {
-    return PTy->getNumElements() * getNumElements(PTy->getElementType());
+  } else if (const VectorType* VTy = dyn_cast<VectorType>(Ty)) {
+    return VTy->getNumElements() * getNumElements(VTy->getElementType());
   } else
     hlvmAssert(!"Don't know how to count elements of this type");
   return 0;
@@ -1479,7 +1501,8 @@
       hlvmAssert( srcPT->getElementType() == destTy );
       ArgList idx;
       TwoZeroIndices(idx);
-      GetElementPtrInst* GEP = new GetElementPtrInst(src, idx, "",TheBlock);
+      GetElementPtrInst* GEP = 
+        new GetElementPtrInst(src, &idx[0], 2, "", TheBlock);
       emitStore(GEP,dest);
     } else {
       // they are both first class types and the source is not a pointer, so 
@@ -1647,7 +1670,7 @@
           newArgs.push_back(*I);
 
       // Generate the call
-      return new CallInst(F, newArgs, "", TheBlock);
+      return new CallInst(F, &newArgs[0], args.size(), "", TheBlock);
     }
   }
 
@@ -1664,7 +1687,8 @@
         cast<Constant>(*I), (*I)->getName()));
     else
       newArgs.push_back(*I);
-  return new CallInst(F, newArgs, F->getName() + "_result", TheBlock);
+  return new CallInst(F, &newArgs[0], newArgs.size(),  F->getName() + "_result",
+                      TheBlock);
 }
 
 void 
@@ -1681,7 +1705,7 @@
   args.push_back(size);
   args.push_back(ConstantInt::get(Type::Int32Ty, 0u));
   LLVMEmitterImpl* emimp = static_cast<LLVMEmitterImpl*>(this);
-  new CallInst(emimp->get_llvm_memcpy(), args, "", TheBlock);
+  new CallInst(emimp->get_llvm_memcpy(), &args[0], args.size(), "", TheBlock);
 }
 
 /// Emit an llvm.memmove.i64 intrinsic
@@ -1699,7 +1723,7 @@
   args.push_back(size);
   args.push_back(ConstantInt::get(Type::Int32Ty, 0u));
   LLVMEmitterImpl* emimp = static_cast<LLVMEmitterImpl*>(this);
-  new CallInst(emimp->get_llvm_memmove(), args, "", TheBlock);
+  new CallInst(emimp->get_llvm_memmove(), &args[0], args.size(), "", TheBlock);
 }
 
 /// Emit an llvm.memset.i64 intrinsic
@@ -1717,7 +1741,8 @@
   args.push_back(size);
   args.push_back(ConstantInt::get(Type::Int32Ty, 0u));
   LLVMEmitterImpl* emimp = static_cast<LLVMEmitterImpl*>(this);
-  new CallInst(emimp->get_llvm_memset(), args, "", TheBlock);
+  new CallInst(emimp->get_llvm_memset(), &args[0], args.size(), "", 
+               TheBlock);
 }
 
 CallInst* 

Modified: hlvm/trunk/hlvm/CodeGen/LLVMEmitter.h
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/hlvm/CodeGen/LLVMEmitter.h?rev=38416&r1=38415&r2=38416&view=diff

==============================================================================
--- hlvm/trunk/hlvm/CodeGen/LLVMEmitter.h (original)
+++ hlvm/trunk/hlvm/CodeGen/LLVMEmitter.h Sat Jul  7 19:03:11 2007
@@ -165,7 +165,7 @@
     llvm::BasicBlock* getBlock() const { return TheBlock; }
 
     /// Get the name of the current block we're inserting into
-    const std::string& getBlockName() const { 
+    std::string getBlockName() const { 
       return TheBlock->getName(); 
     }
     // Get the terminating instruction of the current block
@@ -379,14 +379,15 @@
     llvm::CallInst* emitCall(llvm::Function* F, const ArgList& args); 
 
     llvm::GetElementPtrInst* emitGEP(llvm::Value* V, const ArgList& indices) {
-      return new llvm::GetElementPtrInst(V,indices,"",TheBlock);
+      return new llvm::GetElementPtrInst(V, &indices[0], indices.size(), "",
+                                         TheBlock);
     }
 
     llvm::GetElementPtrInst* emitGEP(llvm::Value* V, llvm::Value* index) {
-      ArgList indices;
-      indices.push_back(llvm::Constant::getNullValue(llvm::Type::Int32Ty));
-      indices.push_back(index);
-      return new llvm::GetElementPtrInst(V,indices,"",TheBlock);
+      llvm::Value* indices[2];
+      indices[0] = llvm::Constant::getNullValue(llvm::Type::Int32Ty);
+      indices[1] = index;
+      return new llvm::GetElementPtrInst(V, indices, 2, "",TheBlock);
     }
 
     /// This method implements an assignment of a src value to a pointer to a





More information about the llvm-commits mailing list