forked from OSchip/llvm-project
Temporarily backing out r47337. It breaks a number of CBE tests.
llvm-svn: 47385
This commit is contained in:
parent
e7b462b329
commit
e43b6054b1
|
@ -1198,12 +1198,12 @@ void CWriter::writeOperandRaw(Value *Operand) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void CWriter::writeOperand(Value *Operand) {
|
void CWriter::writeOperand(Value *Operand) {
|
||||||
if (isa<GlobalVariable>(Operand) || isDirectAlloca(Operand) || ByValParams.count(Operand))
|
if (isa<GlobalVariable>(Operand) || isDirectAlloca(Operand))
|
||||||
Out << "(&"; // Global variables are referenced as their addresses by llvm
|
Out << "(&"; // Global variables are referenced as their addresses by llvm
|
||||||
|
|
||||||
writeOperandInternal(Operand);
|
writeOperandInternal(Operand);
|
||||||
|
|
||||||
if (isa<GlobalVariable>(Operand) || isDirectAlloca(Operand) || ByValParams.count(Operand))
|
if (isa<GlobalVariable>(Operand) || isDirectAlloca(Operand))
|
||||||
Out << ')';
|
Out << ')';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2723,11 +2723,13 @@ void CWriter::visitCallInst(CallInst &I) {
|
||||||
// Check if the argument is expected to be passed by value.
|
// Check if the argument is expected to be passed by value.
|
||||||
bool isOutByVal = PAL && PAL->paramHasAttr(ArgNo+1, ParamAttr::ByVal);
|
bool isOutByVal = PAL && PAL->paramHasAttr(ArgNo+1, ParamAttr::ByVal);
|
||||||
// Check if this argument itself is passed in by reference.
|
// Check if this argument itself is passed in by reference.
|
||||||
//bool isInByVal = ByValParams.count(*AI);
|
bool isInByVal = ByValParams.count(*AI);
|
||||||
if (isOutByVal)
|
if (isOutByVal && !isInByVal)
|
||||||
Out << "*(";
|
Out << "*(";
|
||||||
|
else if (!isOutByVal && isInByVal)
|
||||||
|
Out << "&(";
|
||||||
writeOperand(*AI);
|
writeOperand(*AI);
|
||||||
if (isOutByVal)
|
if (isOutByVal ^ isInByVal)
|
||||||
Out << ")";
|
Out << ")";
|
||||||
PrintedArg = true;
|
PrintedArg = true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue