diff options
| author | Reid Kleckner <reid@kleckner.net> | 2015-02-14 00:21:02 +0000 |
|---|---|---|
| committer | Reid Kleckner <reid@kleckner.net> | 2015-02-14 00:21:02 +0000 |
| commit | 2d5fb68ee0149129c29ac6a0bfe93814de5e317e (patch) | |
| tree | 224963400c6e29d2f2ea951e9ef496678f256b93 /llvm/lib/CodeGen/MachineModuleInfo.cpp | |
| parent | b3fc83c40344f5ec4b0c0a09478bb0d3048c59a6 (diff) | |
Unify the two EH personality classification routines I wrote
We only need one.
llvm-svn: 229193
Diffstat (limited to 'llvm/lib/CodeGen/MachineModuleInfo.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/MachineModuleInfo.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/llvm/lib/CodeGen/MachineModuleInfo.cpp b/llvm/lib/CodeGen/MachineModuleInfo.cpp index b4ce673659f7..fca7df097b64 100644 --- a/llvm/lib/CodeGen/MachineModuleInfo.cpp +++ b/llvm/lib/CodeGen/MachineModuleInfo.cpp @@ -9,6 +9,7 @@ #include "llvm/CodeGen/MachineModuleInfo.h" #include "llvm/ADT/PointerUnion.h" +#include "llvm/Analysis/LibCallSemantics.h" #include "llvm/Analysis/ValueTracking.h" #include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/MachineFunctionPass.h" @@ -276,7 +277,7 @@ bool MachineModuleInfo::doInitialization(Module &M) { DbgInfoAvailable = UsesVAFloatArgument = UsesMorestackAddr = false; // Always emit some info, by default "no personality" info. Personalities.push_back(nullptr); - PersonalityTypeCache = EHPersonality::None; + PersonalityTypeCache = EHPersonality::Unknown; AddrLabelSymbols = nullptr; TheModule = nullptr; @@ -561,17 +562,11 @@ const Function *MachineModuleInfo::getPersonality() const { return nullptr; } -EHPersonality MachineModuleInfo::getPersonalityTypeSlow() { - const Function *Per = getPersonality(); - if (!Per) - PersonalityTypeCache = EHPersonality::None; - else if (Per->getName() == "__C_specific_handler") - PersonalityTypeCache = EHPersonality::Win64SEH; - else // Assume everything else is Itanium. - PersonalityTypeCache = EHPersonality::Itanium; +EHPersonality MachineModuleInfo::getPersonalityType() { + if (PersonalityTypeCache == EHPersonality::Unknown) + PersonalityTypeCache = classifyEHPersonality(getPersonality()); return PersonalityTypeCache; } - /// getPersonalityIndex - Return unique index for current personality /// function. NULL/first personality function should always get zero index. unsigned MachineModuleInfo::getPersonalityIndex() const { |
