Emit calls to swift_willThrow as part of SILGen using a builtin.

Calls to willThrow are marked as read-none so that the optimizer can remove
them. The willThrow builtin is still generated for all throw/rethrow sites,
but I plan to look at this next.

rdar://20356658

Swift SVN r27877
This commit is contained in:
Nadav Rotem
2015-04-28 18:36:22 +00:00
parent b05c372c4f
commit 3e8c871c6a
9 changed files with 44 additions and 15 deletions

View File

@@ -285,6 +285,18 @@ BUILTIN_SIL_OPERATION(FixLifetime, "fixLifetime", Special)
#undef BUILTIN_SIL_OPERATION
// BUILTIN_RUNTIME_CALL - A call into a runtime function.
// These functions accept a single argument of any type.
#ifndef BUILTIN_RUNTIME_CALL
#define BUILTIN_RUNTIME_CALL(Id, Name, Attrs) \
BUILTIN(Id, Name, Attrs)
#endif
/// willThrow: T -> ()
BUILTIN_RUNTIME_CALL(WillThrow, "willThrow", "n")
#undef BUILTIN_RUNTIME_CALL
// BUILTIN_MISC_OPERATION - Miscellaneous operations without a unifying class.
// These have various types.
#ifndef BUILTIN_MISC_OPERATION