summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/CodeGen/CGCall.cpp19
-rw-r--r--clang/lib/CodeGen/CGDecl.cpp2
2 files changed, 10 insertions, 11 deletions
diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp
index fd33b50e79e..d7f52c6295e 100644
--- a/clang/lib/CodeGen/CGCall.cpp
+++ b/clang/lib/CodeGen/CGCall.cpp
@@ -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:
diff --git a/clang/lib/CodeGen/CGDecl.cpp b/clang/lib/CodeGen/CGDecl.cpp
index 49ac20a9bcd..acf16561ccf 100644
--- a/clang/lib/CodeGen/CGDecl.cpp
+++ b/clang/lib/CodeGen/CGDecl.cpp
@@ -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;
OpenPOWER on IntegriCloud