LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 1145 - Support nothrow attribute on function calls
Summary: Support nothrow attribute on function calls
Status: RESOLVED FIXED
Alias: None
Product: libraries
Classification: Unclassified
Component: LLVM assembly language parser (show other bugs)
Version: 1.0
Hardware: All All
: P enhancement
Assignee: Reid Spencer
URL:
Keywords: new-feature
Depends on:
Blocks:
 
Reported: 2007-01-30 11:23 PST by Chris Lattner
Modified: 2010-02-22 12:41 PST (History)
2 users (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Lattner 2007-01-30 11:23:13 PST
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
Comment 1 Reid Spencer 2007-01-30 14:17:23 PST
this is akin to the existing "noreturn" attribute, not a big deal.
Comment 2 Chris Lattner 2007-01-30 15:37:21 PST
yep
Comment 3 Reid Spencer 2007-03-21 19:33:53 PDT
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.
Comment 4 Chris Lattner 2007-03-21 19:59:45 PDT
doesn't this need asm/bc support?
Comment 5 Reid Spencer 2007-03-21 20:59:06 PDT
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.

Comment 6 Reid Spencer 2007-03-21 21:21:22 PDT
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.