aboutsummaryrefslogtreecommitdiffstats
path: root/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
commitafa3b6da11bc05281bcf09e45de9e037e0ee5011 (patch)
treebad8f7480a6ea8ab2cbce2ad3427e8173247f68e /lib/ExecutionEngine/Interpreter/Execution.cpp
parent1e7b1bbd9c939ce1581862a6e0f8961279ea5992 (diff)
downloadexternal_llvm-afa3b6da11bc05281bcf09e45de9e037e0ee5011.zip
external_llvm-afa3b6da11bc05281bcf09e45de9e037e0ee5011.tar.gz
external_llvm-afa3b6da11bc05281bcf09e45de9e037e0ee5011.tar.bz2
Add some convenience methods for querying attributes, and
use them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44403 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/Interpreter/Execution.cpp')
-rw-r--r--lib/ExecutionEngine/Interpreter/Execution.cpp21
1 files changed, 9 insertions, 12 deletions
diff --git a/lib/ExecutionEngine/Interpreter/Execution.cpp b/lib/ExecutionEngine/Interpreter/Execution.cpp
index 6ab1231..687814b 100644
--- a/lib/ExecutionEngine/Interpreter/Execution.cpp
+++ b/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