diff options
author | Keno Fischer <kfischer@college.harvard.edu> | 2015-07-14 19:22:51 +0000 |
---|---|---|
committer | Keno Fischer <kfischer@college.harvard.edu> | 2015-07-14 19:22:51 +0000 |
commit | aff703a2ca704a55eadf024497bc5914ed089372 (patch) | |
tree | c7b7ff39807894a23917ff6c8be033aa08742017 /llvm/lib/CodeGen/MachineModuleInfo.cpp | |
parent | fea7765219c18743800785d8c58290695f661594 (diff) | |
download | llvm-aff703a2ca704a55eadf024497bc5914ed089372.zip llvm-aff703a2ca704a55eadf024497bc5914ed089372.tar.gz llvm-aff703a2ca704a55eadf024497bc5914ed089372.tar.bz2 |
[CodeGen] Force emission of personality directive if explicitly specified
Summary:
Before this change, personality directives were not emitted
if there was no invoke left in the function (of course until
recently this also meant that we couldn't know what
the personality actually was). This patch forces personality directives
to still be emitted, unless it is known to be a noop in the absence of
invokes, or the user explicitly specified `nounwind` (and not
`uwtable`) on the function.
Reviewers: majnemer, rnk
Subscribers: rnk, llvm-commits
Differential Revision: http://reviews.llvm.org/D10884
llvm-svn: 242185
Diffstat (limited to 'llvm/lib/CodeGen/MachineModuleInfo.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineModuleInfo.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineModuleInfo.cpp b/llvm/lib/CodeGen/MachineModuleInfo.cpp index 42d0603..6a20624 100644 --- a/llvm/lib/CodeGen/MachineModuleInfo.cpp +++ b/llvm/lib/CodeGen/MachineModuleInfo.cpp @@ -320,7 +320,10 @@ void MachineModuleInfo::addPersonality(MachineBasicBlock *LandingPad, const Function *Personality) { LandingPadInfo &LP = getOrCreateLandingPadInfo(LandingPad); LP.Personality = Personality; + addPersonality(Personality); +} +void MachineModuleInfo::addPersonality(const Function *Personality) { for (unsigned i = 0; i < Personalities.size(); ++i) if (Personalities[i] == Personality) return; |