1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00

Use use_iterator::getOperandNo instead of CallSite::hasArgument to check if a

function is passed as an argument instead of called. Also do this check a bit
earlier.

llvm-svn: 51990
This commit is contained in:
Matthijs Kooijman 2008-06-05 08:34:25 +00:00
parent 6216df14cb
commit 8e980a31d5

View File

@ -302,6 +302,12 @@ void DAE::SurveyFunction(Function &F) {
FunctionIntrinsicallyLive = true;
else
for (Value::use_iterator I = F.use_begin(), E = F.use_end(); I != E; ++I) {
// If the function is PASSED IN as an argument, its address has been taken
if (I.getOperandNo() != 0) {
FunctionIntrinsicallyLive = true;
break;
}
// If this use is anything other than a call site, the function is alive.
CallSite CS = CallSite::get(*I);
Instruction *TheCall = CS.getInstruction();
@ -329,13 +335,6 @@ void DAE::SurveyFunction(Function &F) {
RetValLiveness = Live;
break;
}
// If the function is PASSED IN as an argument, its address has been taken
if (CS.hasArgument(&F)) {
FunctionIntrinsicallyLive = true;
break;
}
}
if (FunctionIntrinsicallyLive) {