mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-15 03:26:05 +00:00
Move EH personality type classification to Analysis/LibCallSemantics.h
Summary: Also add enum types for __C_specific_handler and _CxxFrameHandler3 for which we know a few things. Reviewers: majnemer Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D7214 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227284 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -15,6 +15,7 @@
|
||||
|
||||
#include "llvm/Analysis/LibCallSemantics.h"
|
||||
#include "llvm/ADT/StringMap.h"
|
||||
#include "llvm/ADT/StringSwitch.h"
|
||||
#include "llvm/IR/Function.h"
|
||||
using namespace llvm;
|
||||
|
||||
@ -61,3 +62,18 @@ LibCallInfo::getFunctionInfo(const Function *F) const {
|
||||
return Map->lookup(F->getName());
|
||||
}
|
||||
|
||||
/// See if the given exception handling personality function is one that we
|
||||
/// understand. If so, return a description of it; otherwise return Unknown.
|
||||
EHPersonality llvm::ClassifyEHPersonality(Value *Pers) {
|
||||
Function *F = dyn_cast<Function>(Pers->stripPointerCasts());
|
||||
if (!F)
|
||||
return EHPersonality::Unknown;
|
||||
return StringSwitch<EHPersonality>(F->getName())
|
||||
.Case("__gnat_eh_personality", EHPersonality::GNU_Ada)
|
||||
.Case("__gxx_personality_v0", EHPersonality::GNU_CXX)
|
||||
.Case("__gcc_personality_v0", EHPersonality::GNU_C)
|
||||
.Case("__objc_personality_v0", EHPersonality::GNU_ObjC)
|
||||
.Case("__C_specific_handler", EHPersonality::MSVC_Win64SEH)
|
||||
.Case("__CxxFrameHandler3", EHPersonality::MSVC_CXX)
|
||||
.Default(EHPersonality::Unknown);
|
||||
}
|
||||
|
Reference in New Issue
Block a user