Don't promote asynch EH invokes of nounwind functions to calls

If the landingpad of the invoke is using a personality function that
catches asynch exceptions, then it can catch a trap.

Also add some landingpads to invalid LLVM IR test cases that lack them.

Over-the-shoulder reviewed by David Majnemer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228782 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Reid Kleckner
2015-02-11 01:23:16 +00:00
parent 9f5d593c1f
commit 690248bf52
13 changed files with 150 additions and 27 deletions

View File

@@ -18,6 +18,7 @@
#include "llvm/Analysis/AliasAnalysis.h"
namespace llvm {
class InvokeInst;
/// LibCallLocationInfo - This struct describes a set of memory locations that
/// are accessed by libcalls. Identification of a location is doing with a
@@ -168,14 +169,21 @@ namespace llvm {
GNU_C,
GNU_CXX,
GNU_ObjC,
MSVC_X86SEH,
MSVC_Win64SEH,
MSVC_CXX,
};
/// ClassifyEHPersonality - See if the given exception handling personality
/// function is one that we understand. If so, return a description of it;
/// otherwise return Unknown_Personality.
EHPersonality ClassifyEHPersonality(Value *Pers);
/// \brief See if the given exception handling personality function is one
/// that we understand. If so, return a description of it; otherwise return
/// Unknown.
EHPersonality classifyEHPersonality(Value *Pers);
/// \brief Returns true if this personality function catches asynchronous
/// exceptions.
bool isAsynchronousEHPersonality(EHPersonality Pers);
bool canSimplifyInvokeNoUnwind(const InvokeInst *II);
} // end namespace llvm