forked from OSchip/llvm-project
Twinify CodeGenFunction::CreateTempAlloca
llvm-svn: 84456
This commit is contained in:
parent
fdcbc33192
commit
b5aacc282c
|
@ -639,9 +639,8 @@ void CodeGenFunction::EmitFunctionProlog(const CGFunctionInfo &FI,
|
||||||
// If this structure was expanded into multiple arguments then
|
// If this structure was expanded into multiple arguments then
|
||||||
// we need to create a temporary and reconstruct it from the
|
// we need to create a temporary and reconstruct it from the
|
||||||
// arguments.
|
// arguments.
|
||||||
std::string Name = Arg->getNameAsString();
|
|
||||||
llvm::Value *Temp = CreateTempAlloca(ConvertTypeForMem(Ty),
|
llvm::Value *Temp = CreateTempAlloca(ConvertTypeForMem(Ty),
|
||||||
(Name + ".addr").c_str());
|
Arg->getName() + ".addr");
|
||||||
// FIXME: What are the right qualifiers here?
|
// FIXME: What are the right qualifiers here?
|
||||||
llvm::Function::arg_iterator End =
|
llvm::Function::arg_iterator End =
|
||||||
ExpandTypeFromArgs(Ty, LValue::MakeAddr(Temp, Qualifiers()), AI);
|
ExpandTypeFromArgs(Ty, LValue::MakeAddr(Temp, Qualifiers()), AI);
|
||||||
|
@ -650,7 +649,7 @@ void CodeGenFunction::EmitFunctionProlog(const CGFunctionInfo &FI,
|
||||||
// Name the arguments used in expansion and increment AI.
|
// Name the arguments used in expansion and increment AI.
|
||||||
unsigned Index = 0;
|
unsigned Index = 0;
|
||||||
for (; AI != End; ++AI, ++Index)
|
for (; AI != End; ++AI, ++Index)
|
||||||
AI->setName(Name + "." + llvm::Twine(Index));
|
AI->setName(Arg->getName() + "." + llvm::Twine(Index));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,9 +28,9 @@ using namespace CodeGen;
|
||||||
/// CreateTempAlloca - This creates a alloca and inserts it into the entry
|
/// CreateTempAlloca - This creates a alloca and inserts it into the entry
|
||||||
/// block.
|
/// block.
|
||||||
llvm::AllocaInst *CodeGenFunction::CreateTempAlloca(const llvm::Type *Ty,
|
llvm::AllocaInst *CodeGenFunction::CreateTempAlloca(const llvm::Type *Ty,
|
||||||
const char *Name) {
|
const llvm::Twine &Name) {
|
||||||
if (!Builder.isNamePreserving())
|
if (!Builder.isNamePreserving())
|
||||||
Name = "";
|
return new llvm::AllocaInst(Ty, 0, "", AllocaInsertPt);
|
||||||
return new llvm::AllocaInst(Ty, 0, Name, AllocaInsertPt);
|
return new llvm::AllocaInst(Ty, 0, Name, AllocaInsertPt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,6 +34,7 @@ namespace llvm {
|
||||||
class LLVMContext;
|
class LLVMContext;
|
||||||
class Module;
|
class Module;
|
||||||
class SwitchInst;
|
class SwitchInst;
|
||||||
|
class Twine;
|
||||||
class Value;
|
class Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -508,7 +509,7 @@ public:
|
||||||
/// CreateTempAlloca - This creates a alloca and inserts it into the entry
|
/// CreateTempAlloca - This creates a alloca and inserts it into the entry
|
||||||
/// block.
|
/// block.
|
||||||
llvm::AllocaInst *CreateTempAlloca(const llvm::Type *Ty,
|
llvm::AllocaInst *CreateTempAlloca(const llvm::Type *Ty,
|
||||||
const char *Name = "tmp");
|
const llvm::Twine &Name = "tmp");
|
||||||
|
|
||||||
/// EvaluateExprAsBool - Perform the usual unary conversions on the specified
|
/// EvaluateExprAsBool - Perform the usual unary conversions on the specified
|
||||||
/// expression and compare the result against zero, returning an Int1Ty value.
|
/// expression and compare the result against zero, returning an Int1Ty value.
|
||||||
|
|
Loading…
Reference in New Issue