aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2008-04-08 07:23:58 +0000
committerDuncan Sands <baldrick@free.fr>2008-04-08 07:23:58 +0000
commite1fca41a6a76ebd133176b29e81d2419b348e991 (patch)
tree2dbab1fd56e77fc6ebd7537ffdb49bbe24dc6f73 /lib
parentbc610fcd224a41520f840c5d55d592a6c55c2633 (diff)
downloadexternal_llvm-e1fca41a6a76ebd133176b29e81d2419b348e991.zip
external_llvm-e1fca41a6a76ebd133176b29e81d2419b348e991.tar.gz
external_llvm-e1fca41a6a76ebd133176b29e81d2419b348e991.tar.bz2
Convenience method for setting the nounwind
attribute for a function. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49373 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/VMCore/Function.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/VMCore/Function.cpp b/lib/VMCore/Function.cpp
index 6571f10..de011c0 100644
--- a/lib/VMCore/Function.cpp
+++ b/lib/VMCore/Function.cpp
@@ -219,6 +219,15 @@ void Function::dropAllReferences() {
BasicBlocks.clear(); // Delete all basic blocks...
}
+void Function::setDoesNotThrow(bool doesNotThrow) {
+ PAListPtr PAL = getParamAttrs();
+ if (doesNotThrow)
+ PAL = PAL.addAttr(0, ParamAttr::NoUnwind);
+ else
+ PAL = PAL.removeAttr(0, ParamAttr::NoUnwind);
+ setParamAttrs(PAL);
+}
+
// Maintain the collector name for each function in an on-the-side table. This
// saves allocating an additional word in Function for programs which do not use
// GC (i.e., most programs) at the cost of increased overhead for clients which