With exception table support under development, it will soon be useful to know if a function can throw or not. The front-end has this info for some functions (those marked throw()) and the prune-eh pass computes this info, but there is no way to record this info in the IR for the code generator to use. It should be straight-forward to add an attribute to functions to indicate that they cannot throw. If the front-end sets this, it will make the prune-eh pass more effective (deleting more landing pads) and the code generator can then start using it. -Chris
this is akin to the existing "noreturn" attribute, not a big deal.
yep
This patch: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070319/046076.html adds a "NoUnwindAttribute" to the FunctionType class's list of attributes. No use of it is yet made.
doesn't this need asm/bc support?
Did I close the PR? :) Nothing needs to be done for bytecode, its just stored as an integer bit mask. This is just using another bit. AsmParser and AsmWriter do need to be updated to support the flag. After that, its up to someone else to actually use it.
These patches add assembly support for nounwind and noreturn attributes: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070319/046082.html http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070319/046084.html http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070319/046086.html http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070319/046088.html Test case is here: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070319/046087.html Both nothrow and noreturn are now fully supported in VMCore, Bytecode, and Assembly. I'm closing this bug as done since all that it asks has been completed. Changes to the prune-eh pass should be done under a separate PR.