aboutsummaryrefslogtreecommitdiffstats
path: root/lib/VMCore/Function.cpp
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2007-12-19 21:13:37 +0000
committerDuncan Sands <baldrick@free.fr>2007-12-19 21:13:37 +0000
commitf0c3354d998507515ab39e26b5292ea0ceb06aef (patch)
treed4442f54d211307d792ee586467e8a127c908365 /lib/VMCore/Function.cpp
parent0a92af487b8ae5d004a3460e3518a3815d9b36a8 (diff)
downloadexternal_llvm-f0c3354d998507515ab39e26b5292ea0ceb06aef.zip
external_llvm-f0c3354d998507515ab39e26b5292ea0ceb06aef.tar.gz
external_llvm-f0c3354d998507515ab39e26b5292ea0ceb06aef.tar.bz2
When inlining through an 'nounwind' call, mark inlined
calls 'nounwind'. It is important for correct C++ exception handling that nounwind markings do not get lost, so this transformation is actually needed for correctness. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45218 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Function.cpp')
-rw-r--r--lib/VMCore/Function.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/VMCore/Function.cpp b/lib/VMCore/Function.cpp
index f985899..37e25ad 100644
--- a/lib/VMCore/Function.cpp
+++ b/lib/VMCore/Function.cpp
@@ -261,6 +261,32 @@ ParamAttrsList::getModified(const ParamAttrsList *PAL,
return get(newVec);
}
+const ParamAttrsList *
+ParamAttrsList::includeAttrs(const ParamAttrsList *PAL,
+ uint16_t idx, uint16_t attrs) {
+ uint16_t OldAttrs = PAL ? PAL->getParamAttrs(idx) : 0;
+ uint16_t NewAttrs = OldAttrs | attrs;
+ if (NewAttrs == OldAttrs)
+ return PAL;
+
+ ParamAttrsVector modVec;
+ modVec.push_back(ParamAttrsWithIndex::get(idx, NewAttrs));
+ return getModified(PAL, modVec);
+}
+
+const ParamAttrsList *
+ParamAttrsList::excludeAttrs(const ParamAttrsList *PAL,
+ uint16_t idx, uint16_t attrs) {
+ uint16_t OldAttrs = PAL ? PAL->getParamAttrs(idx) : 0;
+ uint16_t NewAttrs = OldAttrs & ~attrs;
+ if (NewAttrs == OldAttrs)
+ return PAL;
+
+ ParamAttrsVector modVec;
+ modVec.push_back(ParamAttrsWithIndex::get(idx, NewAttrs));
+ return getModified(PAL, modVec);
+}
+
ParamAttrsList::~ParamAttrsList() {
ParamAttrsLists->RemoveNode(this);
}