[cfe-commits] r90098 - in /cfe/trunk/lib/CodeGen: CGBlocks.cpp CGDecl.cpp CGExpr.cpp CGExprScalar.cpp CGObjCMac.cpp

Daniel Dunbar daniel at zuster.org
Sun Nov 29 13:23:37 PST 2009


Author: ddunbar
Date: Sun Nov 29 15:23:36 2009
New Revision: 90098

URL: http://llvm.org/viewvc/llvm-project?rev=90098&view=rev
Log:
Don't pass false (default) for isVolatile parameter to CreateLoad.

Modified:
    cfe/trunk/lib/CodeGen/CGBlocks.cpp
    cfe/trunk/lib/CodeGen/CGDecl.cpp
    cfe/trunk/lib/CodeGen/CGExpr.cpp
    cfe/trunk/lib/CodeGen/CGExprScalar.cpp
    cfe/trunk/lib/CodeGen/CGObjCMac.cpp

Modified: cfe/trunk/lib/CodeGen/CGBlocks.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGBlocks.cpp?rev=90098&r1=90097&r2=90098&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGBlocks.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGBlocks.cpp Sun Nov 29 15:23:36 2009
@@ -291,7 +291,7 @@
               (VD->getType().isObjCGCWeak() ? BLOCK_FIELD_IS_WEAK : 0);
             llvm::Value *Loc = LocalDeclMap[VD];
             Loc = Builder.CreateStructGEP(Loc, 1, "forwarding");
-            Loc = Builder.CreateLoad(Loc, false);
+            Loc = Builder.CreateLoad(Loc);
             Builder.CreateStore(Loc, Addr);
             ++helpersize;
             continue;
@@ -331,7 +331,7 @@
                                     "block.literal");
             Ty = llvm::PointerType::get(Ty, 0);
             Loc = Builder.CreateBitCast(Loc, Ty);
-            Loc = Builder.CreateLoad(Loc, false);
+            Loc = Builder.CreateLoad(Loc);
             // Loc = Builder.CreateBitCast(Loc, Ty);
           }
           Builder.CreateStore(Loc, Addr);
@@ -494,7 +494,7 @@
                E->arg_begin(), E->arg_end());
 
   // Load the function.
-  llvm::Value *Func = Builder.CreateLoad(FuncPtr, false, "tmp");
+  llvm::Value *Func = Builder.CreateLoad(FuncPtr, "tmp");
 
   QualType ResultType = FnType->getAs<FunctionType>()->getResultType();
 
@@ -551,9 +551,9 @@
     const llvm::Type *Ty = PtrStructTy;
     Ty = llvm::PointerType::get(Ty, 0);
     V = Builder.CreateBitCast(V, Ty);
-    V = Builder.CreateLoad(V, false);
+    V = Builder.CreateLoad(V);
     V = Builder.CreateStructGEP(V, 1, "forwarding");
-    V = Builder.CreateLoad(V, false);
+    V = Builder.CreateLoad(V);
     V = Builder.CreateBitCast(V, PtrStructTy);
     V = Builder.CreateStructGEP(V, getByRefValueLLVMField(VD), 
                                 VD->getNameAsString());

Modified: cfe/trunk/lib/CodeGen/CGDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDecl.cpp?rev=90098&r1=90097&r2=90098&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGDecl.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDecl.cpp Sun Nov 29 15:23:36 2009
@@ -568,7 +568,7 @@
   if (needsDispose && CGM.getLangOptions().getGCMode() != LangOptions::GCOnly) {
     DelayedCleanupBlock scope(*this);
     llvm::Value *V = Builder.CreateStructGEP(DeclPtr, 1, "forwarding");
-    V = Builder.CreateLoad(V, false);
+    V = Builder.CreateLoad(V);
     BuildBlockRelease(V);
   }
 }

Modified: cfe/trunk/lib/CodeGen/CGExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExpr.cpp?rev=90098&r1=90097&r2=90098&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGExpr.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExpr.cpp Sun Nov 29 15:23:36 2009
@@ -312,9 +312,12 @@
 
 llvm::Value *CodeGenFunction::EmitLoadOfScalar(llvm::Value *Addr, bool Volatile,
                                                QualType Ty) {
-  llvm::Value *V = Builder.CreateLoad(Addr, Volatile, "tmp");
+  llvm::LoadInst *Load = Builder.CreateLoad(Addr, "tmp");
+  if (Volatile)
+    Load->setVolatile(true);
 
   // Bool can have different representation in memory than in registers.
+  llvm::Value *V = Load;
   if (Ty->isBooleanType())
     if (V->getType() != llvm::Type::getInt1Ty(VMContext))
       V = Builder.CreateTrunc(V, llvm::Type::getInt1Ty(VMContext), "tobool");
@@ -867,7 +870,7 @@
 
     if (VD->hasAttr<BlocksAttr>()) {
       V = Builder.CreateStructGEP(V, 1, "forwarding");
-      V = Builder.CreateLoad(V, false);
+      V = Builder.CreateLoad(V);
       V = Builder.CreateStructGEP(V, getByRefValueLLVMField(VD),
                                   VD->getNameAsString());
     }

Modified: cfe/trunk/lib/CodeGen/CGExprScalar.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprScalar.cpp?rev=90098&r1=90097&r2=90098&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGExprScalar.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExprScalar.cpp Sun Nov 29 15:23:36 2009
@@ -1015,7 +1015,7 @@
   llvm::Value *V = CGF.GetAddrOfBlockDecl(E);
   if (E->getType().isObjCGCWeak())
     return CGF.CGM.getObjCRuntime().EmitObjCWeakRead(CGF, V);
-  return Builder.CreateLoad(V, false, "tmp");
+  return Builder.CreateLoad(V, "tmp");
 }
 
 //===----------------------------------------------------------------------===//

Modified: cfe/trunk/lib/CodeGen/CGObjCMac.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjCMac.cpp?rev=90098&r1=90097&r2=90098&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjCMac.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjCMac.cpp Sun Nov 29 15:23:36 2009
@@ -2993,7 +2993,7 @@
                         4, true);
   }
 
-  return Builder.CreateLoad(Entry, false, "tmp");
+  return Builder.CreateLoad(Entry, "tmp");
 }
 
 llvm::Value *CGObjCMac::EmitSelector(CGBuilderTy &Builder, Selector Sel) {
@@ -3009,7 +3009,7 @@
                         4, true);
   }
 
-  return Builder.CreateLoad(Entry, false, "tmp");
+  return Builder.CreateLoad(Entry, "tmp");
 }
 
 llvm::Constant *CGObjCCommonMac::GetClassName(IdentifierInfo *Ident) {
@@ -4516,7 +4516,7 @@
 
   llvm::GlobalVariable *PTGV = CGM.getModule().getGlobalVariable(ProtocolName);
   if (PTGV)
-    return Builder.CreateLoad(PTGV, false, "tmp");
+    return Builder.CreateLoad(PTGV, "tmp");
   PTGV = new llvm::GlobalVariable(
     CGM.getModule(),
     Init->getType(), false,
@@ -4526,7 +4526,7 @@
   PTGV->setSection("__DATA, __objc_protorefs, coalesced, no_dead_strip");
   PTGV->setVisibility(llvm::GlobalValue::HiddenVisibility);
   CGM.AddUsedGlobal(PTGV);
-  return Builder.CreateLoad(PTGV, false, "tmp");
+  return Builder.CreateLoad(PTGV, "tmp");
 }
 
 /// GenerateCategory - Build metadata for a category implementation.
@@ -5031,8 +5031,7 @@
   CodeGen::CodeGenFunction &CGF,
   const ObjCInterfaceDecl *Interface,
   const ObjCIvarDecl *Ivar) {
-  return CGF.Builder.CreateLoad(ObjCIvarOffsetVariable(Interface, Ivar),
-                                false, "ivar");
+  return CGF.Builder.CreateLoad(ObjCIvarOffsetVariable(Interface, Ivar),"ivar");
 }
 
 CodeGen::RValue CGObjCNonFragileABIMac::EmitMessageSend(
@@ -5187,7 +5186,7 @@
     CGM.AddUsedGlobal(Entry);
   }
 
-  return Builder.CreateLoad(Entry, false, "tmp");
+  return Builder.CreateLoad(Entry, "tmp");
 }
 
 llvm::Value *
@@ -5210,7 +5209,7 @@
     CGM.AddUsedGlobal(Entry);
   }
 
-  return Builder.CreateLoad(Entry, false, "tmp");
+  return Builder.CreateLoad(Entry, "tmp");
 }
 
 /// EmitMetaClassRef - Return a Value * of the address of _class_t
@@ -5220,7 +5219,7 @@
                                                       const ObjCInterfaceDecl *ID) {
   llvm::GlobalVariable * &Entry = MetaClassReferences[ID->getIdentifier()];
   if (Entry)
-    return Builder.CreateLoad(Entry, false, "tmp");
+    return Builder.CreateLoad(Entry, "tmp");
 
   std::string MetaClassName(getMetaclassSymbolPrefix() + ID->getNameAsString());
   llvm::GlobalVariable *MetaClassGV = GetClassGlobal(MetaClassName);
@@ -5236,7 +5235,7 @@
   Entry->setSection("__DATA, __objc_superrefs, regular, no_dead_strip");
   CGM.AddUsedGlobal(Entry);
 
-  return Builder.CreateLoad(Entry, false, "tmp");
+  return Builder.CreateLoad(Entry, "tmp");
 }
 
 /// GetClass - Return a reference to the class for the given interface
@@ -5323,7 +5322,7 @@
     CGM.AddUsedGlobal(Entry);
   }
 
-  return Builder.CreateLoad(Entry, false, "tmp");
+  return Builder.CreateLoad(Entry, "tmp");
 }
 /// EmitObjCIvarAssign - Code gen for assigning to a __strong object.
 /// objc_assign_ivar (id src, id *dst, ptrdiff_t)





More information about the cfe-commits mailing list