[llvm-commits] [llvm] r54577 - /llvm/trunk/include/llvm/Support/IRBuilder.h

Chris Lattner sabre at nondot.org
Fri Aug 8 23:26:23 PDT 2008


Author: lattner
Date: Sat Aug  9 01:26:23 2008
New Revision: 54577

URL: http://llvm.org/viewvc/llvm-project?rev=54577&view=rev
Log:
Make 'Insert' set the name for Loads, instead of passing the name into the
LoadInst ctor, which causes std::string thrashing.

Modified:
    llvm/trunk/include/llvm/Support/IRBuilder.h

Modified: llvm/trunk/include/llvm/Support/IRBuilder.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/IRBuilder.h?rev=54577&r1=54576&r2=54577&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Support/IRBuilder.h (original)
+++ llvm/trunk/include/llvm/Support/IRBuilder.h Sat Aug  9 01:26:23 2008
@@ -283,10 +283,10 @@
     return Insert(new FreeInst(Ptr));
   }
   LoadInst *CreateLoad(Value *Ptr, const char *Name = 0) {
-    return Insert(new LoadInst(Ptr, Name));
+    return Insert(new LoadInst(Ptr), Name);
   }
   LoadInst *CreateLoad(Value *Ptr, bool isVolatile, const char *Name = 0) {
-    return Insert(new LoadInst(Ptr, Name, isVolatile));
+    return Insert(new LoadInst(Ptr, 0, isVolatile), Name);
   }
   StoreInst *CreateStore(Value *Val, Value *Ptr, bool isVolatile = false) {
     return Insert(new StoreInst(Val, Ptr, isVolatile));
@@ -306,7 +306,7 @@
         return ConstantExpr::getGetElementPtr(PC, &IdxBegin[0], 
                                               IdxEnd - IdxBegin);
     }      
-    return(Insert(GetElementPtrInst::Create(Ptr, IdxBegin, IdxEnd), Name));
+    return Insert(GetElementPtrInst::Create(Ptr, IdxBegin, IdxEnd), Name);
   }
   Value *CreateGEP(Value *Ptr, Value *Idx, const char *Name = "") {
     if (Constant *PC = dyn_cast<Constant>(Ptr))





More information about the llvm-commits mailing list