aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2007-11-28 17:07:01 +0000
committerDuncan Sands <baldrick@free.fr>2007-11-28 17:07:01 +0000
commit5208d1ab4ae3ea453f4363e4d4582e2df09b7927 (patch)
treee5db86677b4e4522de2cfd2bc0dec21912517b96 /llvm/lib/ExecutionEngine/Interpreter/Execution.cpp
parentb5452fb829347e51e51e053a4d97f3cdf9d5101f (diff)
downloadllvm-5208d1ab4ae3ea453f4363e4d4582e2df09b7927.zip
llvm-5208d1ab4ae3ea453f4363e4d4582e2df09b7927.tar.gz
llvm-5208d1ab4ae3ea453f4363e4d4582e2df09b7927.tar.bz2
Add some convenience methods for querying attributes, and
use them. llvm-svn: 44403
Diffstat (limited to 'llvm/lib/ExecutionEngine/Interpreter/Execution.cpp')
-rw-r--r--llvm/lib/ExecutionEngine/Interpreter/Execution.cpp21
1 files changed, 9 insertions, 12 deletions
diff --git a/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp b/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp
index 6ab1231..687814b9 100644
--- a/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp
+++ b/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp
@@ -896,18 +896,15 @@ void Interpreter::visitCallSite(CallSite CS) {
e = SF.Caller.arg_end(); i != e; ++i, ++pNum) {
Value *V = *i;
ArgVals.push_back(getOperandValue(V, SF));
- if (F) {
- // Promote all integral types whose size is < sizeof(i32) into i32.
- // We do this by zero or sign extending the value as appropriate
- // according to the parameter attributes
- const Type *Ty = V->getType();
- if (Ty->isInteger() && (ArgVals.back().IntVal.getBitWidth() < 32))
- if (const ParamAttrsList *PA = F->getParamAttrs())
- if (PA->paramHasAttr(pNum, ParamAttr::ZExt))
- ArgVals.back().IntVal = ArgVals.back().IntVal.zext(32);
- else if (PA->paramHasAttr(pNum, ParamAttr::SExt))
- ArgVals.back().IntVal = ArgVals.back().IntVal.sext(32);
- }
+ // Promote all integral types whose size is < sizeof(i32) into i32.
+ // We do this by zero or sign extending the value as appropriate
+ // according to the parameter attributes
+ const Type *Ty = V->getType();
+ if (Ty->isInteger() && (ArgVals.back().IntVal.getBitWidth() < 32))
+ if (CS.paramHasAttr(pNum, ParamAttr::ZExt))
+ ArgVals.back().IntVal = ArgVals.back().IntVal.zext(32);
+ else if (CS.paramHasAttr(pNum, ParamAttr::SExt))
+ ArgVals.back().IntVal = ArgVals.back().IntVal.sext(32);
}
// To handle indirect calls, we must get the pointer value from the argument