summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/Instructions.cpp
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2008-02-22 17:49:45 +0000
committerDale Johannesen <dalej@apple.com>2008-02-22 17:49:45 +0000
commiteabc5f39af854fc78674f4851b23a3e5225a1de4 (patch)
tree9cd1637966e0cc33aad0e5b42f575e7d7b51d344 /llvm/lib/VMCore/Instructions.cpp
parenteac159c1f0890fc9ab014fec1531bf7d78e510a6 (diff)
downloadbcm5719-llvm-eabc5f39af854fc78674f4851b23a3e5225a1de4.tar.gz
bcm5719-llvm-eabc5f39af854fc78674f4851b23a3e5225a1de4.zip
Pass alignment on ByVal parameters, from FE, all
the way through. It is now used for codegen. llvm-svn: 47484
Diffstat (limited to 'llvm/lib/VMCore/Instructions.cpp')
-rw-r--r--llvm/lib/VMCore/Instructions.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/llvm/lib/VMCore/Instructions.cpp b/llvm/lib/VMCore/Instructions.cpp
index 4197f80c922..b3a78b729f5 100644
--- a/llvm/lib/VMCore/Instructions.cpp
+++ b/llvm/lib/VMCore/Instructions.cpp
@@ -61,6 +61,13 @@ bool CallSite::paramHasAttr(uint16_t i, ParameterAttributes attr) const {
else
return cast<InvokeInst>(I)->paramHasAttr(i, attr);
}
+uint16_t CallSite::getParamAlignment(uint16_t i) const {
+ if (CallInst *CI = dyn_cast<CallInst>(I))
+ return CI->getParamAlignment(i);
+ else
+ return cast<InvokeInst>(I)->getParamAlignment(i);
+}
+
bool CallSite::doesNotAccessMemory() const {
if (CallInst *CI = dyn_cast<CallInst>(I))
return CI->doesNotAccessMemory();
@@ -384,6 +391,14 @@ bool CallInst::paramHasAttr(uint16_t i, ParameterAttributes attr) const {
return false;
}
+uint16_t CallInst::getParamAlignment(uint16_t i) const {
+ if (ParamAttrs && ParamAttrs->getParamAlignment(i))
+ return ParamAttrs->getParamAlignment(i);
+ if (const Function *F = getCalledFunction())
+ return F->getParamAlignment(i);
+ return 0;
+}
+
/// @brief Determine if the call does not access memory.
bool CallInst::doesNotAccessMemory() const {
return paramHasAttr(0, ParamAttr::ReadNone);
@@ -508,6 +523,13 @@ bool InvokeInst::paramHasAttr(uint16_t i, ParameterAttributes attr) const {
return false;
}
+uint16_t InvokeInst::getParamAlignment(uint16_t i) const {
+ if (ParamAttrs && ParamAttrs->getParamAlignment(i))
+ return ParamAttrs->getParamAlignment(i);
+ if (const Function *F = getCalledFunction())
+ return F->getParamAlignment(i);
+ return 0;
+}
/// @brief Determine if the call does not access memory.
bool InvokeInst::doesNotAccessMemory() const {
OpenPOWER on IntegriCloud