]> granicus.if.org Git - clang/commitdiff
don't set the name of a call instruction to "call" in release-asserts
authorChris Lattner <sabre@nondot.org>
Sun, 22 Mar 2009 00:32:22 +0000 (00:32 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 22 Mar 2009 00:32:22 +0000 (00:32 +0000)
build.  This shaves another 3% off.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67460 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGCall.cpp
lib/CodeGen/CGDecl.cpp

index fd33b50e79e6f561e1066e2a9a2cc04e2af49366..d7f52c6295e02729923603218a05741a52acf874 100644 (file)
@@ -1815,29 +1815,29 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo,
   }    
 
   llvm::Instruction *CI = CS.getInstruction();
-  if (CI->getType() != llvm::Type::VoidTy)
+  if (Builder.isNamePreserving() && CI->getType() != llvm::Type::VoidTy)
     CI->setName("call");
 
   switch (RetAI.getKind()) {
   case ABIArgInfo::Indirect:
     if (RetTy->isAnyComplexType())
       return RValue::getComplex(LoadComplexFromAddr(Args[0], false));
-    else if (CodeGenFunction::hasAggregateLLVMType(RetTy))
+    if (CodeGenFunction::hasAggregateLLVMType(RetTy))
       return RValue::getAggregate(Args[0]);
-    else 
-      return RValue::get(EmitLoadOfScalar(Args[0], false, RetTy));
+    return RValue::get(EmitLoadOfScalar(Args[0], false, RetTy));
 
   case ABIArgInfo::Direct:
     if (RetTy->isAnyComplexType()) {
       llvm::Value *Real = Builder.CreateExtractValue(CI, 0);
       llvm::Value *Imag = Builder.CreateExtractValue(CI, 1);
       return RValue::getComplex(std::make_pair(Real, Imag));
-    } else if (CodeGenFunction::hasAggregateLLVMType(RetTy)) {
+    }
+    if (CodeGenFunction::hasAggregateLLVMType(RetTy)) {
       llvm::Value *V = CreateTempAlloca(ConvertTypeForMem(RetTy), "agg.tmp");
       Builder.CreateStore(CI, V);
       return RValue::getAggregate(V);
-    } else
-      return RValue::get(CI);
+    }
+    return RValue::get(CI);
 
   case ABIArgInfo::Ignore:
     // If we are ignoring an argument that had a result, make sure to
@@ -1850,10 +1850,9 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo,
     CreateCoercedStore(CI, V, *this);
     if (RetTy->isAnyComplexType())
       return RValue::getComplex(LoadComplexFromAddr(V, false));
-    else if (CodeGenFunction::hasAggregateLLVMType(RetTy))
+    if (CodeGenFunction::hasAggregateLLVMType(RetTy))
       return RValue::getAggregate(V);
-    else
-      return RValue::get(EmitLoadOfScalar(V, false, RetTy));
+    return RValue::get(EmitLoadOfScalar(V, false, RetTy));
   }
 
   case ABIArgInfo::Expand:
index 49ac20a9bcde9c46a85b97e40d6640e299724cbb..acf16561ccfc5ecc425e09a9b21f8f07449330a0 100644 (file)
@@ -237,7 +237,7 @@ void CodeGenFunction::EmitLocalBlockVarDecl(const VarDecl &D) {
       
       if (isByRef)
         Alloc->setAlignment(std::max(getContext().getDeclAlignInBytes(&D),
-                                     getContext().getTypeAlign(getContext().VoidPtrTy) / 8));
+                                     unsigned(Target.getPointerAlign(0) / 8)));
       else
         Alloc->setAlignment(getContext().getDeclAlignInBytes(&D));
       DeclPtr = Alloc;