]> granicus.if.org Git - clang/commitdiff
attempt to fix a buildbot failure, apparently apache fails to build.
authorChris Lattner <sabre@nondot.org>
Thu, 2 Dec 2010 04:27:29 +0000 (04:27 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 2 Dec 2010 04:27:29 +0000 (04:27 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120688 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Basic/FileManager.cpp
lib/Basic/FileSystemStatCache.cpp
lib/CodeGen/CGDecl.cpp

index f126760a14792edc11fdbfb743b440fe7b3e48fa..0e47e5e3a61cb16ac8cd8d923e842912eb4abb97 100644 (file)
@@ -434,7 +434,7 @@ getBufferForFile(llvm::StringRef Filename, std::string *ErrorStr) {
 }
 
 /// getStatValue - Get the 'stat' information for the specified path, using the
-/// cache to accellerate it if possible.  This returns true if the path does not
+/// cache to accelerate it if possible.  This returns true if the path does not
 /// exist or false if it exists.
 ///
 /// The isForDir member indicates whether this is a directory lookup or not.
index 8a590507c7828dc4b89d27916775b9e2addc1dc5..d9e89cd8dfd9a7fcd702bd790c1f5738ecad35ed 100644 (file)
@@ -29,7 +29,7 @@ using namespace clang;
 #endif
 
 /// FileSystemStatCache::get - Get the 'stat' information for the specified
-/// path, using the cache to accellerate it if possible.  This returns true if
+/// path, using the cache to accelerate it if possible.  This returns true if
 /// the path does not exist or false if it exists.
 ///
 /// If FileDescriptor is non-null, then this lookup should only return success
index a11861c3e7ffe72e8815595e90b952cec7e800ab..3f87f9fbdc7f2fca15a825761ca887ed225ffa59 100644 (file)
@@ -291,8 +291,7 @@ void CodeGenFunction::EmitStaticVarDecl(const VarDecl &D,
   // FIXME: It is really dangerous to store this in the map; if anyone
   // RAUW's the GV uses of this constant will be invalid.
   const llvm::Type *LTy = CGM.getTypes().ConvertTypeForMem(D.getType());
-  const llvm::Type *LPtrTy =
-    llvm::PointerType::get(LTy, D.getType().getAddressSpace());
+  const llvm::Type *LPtrTy = LTy->getPointerTo(D.getType().getAddressSpace());
   DMEntry = llvm::ConstantExpr::getBitCast(GV, LPtrTy);
 
   // Emit global variable debug descriptor for static vars.
@@ -815,6 +814,8 @@ void CodeGenFunction::EmitAutoVarDecl(const VarDecl &D,
                              getContext().getTypeSizeInChars(Ty).getQuantity());
       
       const llvm::Type *BP = llvm::Type::getInt8PtrTy(VMContext);
+      if (Loc->getType() != BP)
+        Loc = Builder.CreateBitCast(Loc, BP, "tmp");
       
       llvm::Value *NotVolatile = Builder.getFalse();
 
@@ -823,14 +824,14 @@ void CodeGenFunction::EmitAutoVarDecl(const VarDecl &D,
       if (shouldUseMemSetPlusStoresToInitialize(Init, 
                       CGM.getTargetData().getTypeAllocSize(Init->getType()))) {
         const llvm::Type *BP = llvm::Type::getInt8PtrTy(VMContext);
-        llvm::Value *MemSetDest = Loc;
-        if (MemSetDest->getType() != BP)
-          MemSetDest = Builder.CreateBitCast(MemSetDest, BP, "tmp");
         
         Builder.CreateCall5(CGM.getMemSetFn(BP, SizeVal->getType()),
-                            MemSetDest, Builder.getInt8(0), SizeVal, AlignVal,
+                            Loc, Builder.getInt8(0), SizeVal, AlignVal,
                             NotVolatile);
-        emitStoresForInitAfterMemset(Init, Loc, Builder);
+        if (!Init->isNullValue()) {
+          Loc = Builder.CreateBitCast(Loc, Init->getType()->getPointerTo());
+          emitStoresForInitAfterMemset(Init, Loc, Builder);
+        }
         
       } else {
         // Otherwise, create a temporary global with the initializer then 
@@ -846,10 +847,6 @@ void CodeGenFunction::EmitAutoVarDecl(const VarDecl &D,
         if (SrcPtr->getType() != BP)
           SrcPtr = Builder.CreateBitCast(SrcPtr, BP, "tmp");
 
-        const llvm::Type *BP = llvm::Type::getInt8PtrTy(VMContext);
-        if (Loc->getType() != BP)
-          Loc = Builder.CreateBitCast(Loc, BP, "tmp");
-        
         Builder.CreateCall5(CGM.getMemCpyFn(Loc->getType(), SrcPtr->getType(),
                                             SizeVal->getType()),
                             Loc, SrcPtr, SizeVal, AlignVal, NotVolatile);