[PATCH] D10884: [CodeGen] Force emission of personality directive	if explicitly specified
    Reid Kleckner 
    rnk at google.com
       
    Mon Jul 13 14:05:57 PDT 2015
    
    
  
rnk added inline comments.
================
Comment at: include/llvm/Analysis/LibCallSemantics.h:209-211
@@ -208,1 +208,5 @@
 
+  /// \brief Return true if this personality may be safely removed if there
+  /// are no landing pads in the current function.
+  inline bool isNoOpWithoutLpad(EHPersonality Pers) {
+    switch (Pers) {
----------------
We're about to add new blocks that invokes can unwind to, so perhaps let's flip this around and talk about invokes. Maybe isNoOpWithoutInvoke?
================
Comment at: lib/CodeGen/AsmPrinter/DwarfCFIException.cpp:119
@@ +118,3 @@
+  const Function *Per = F->hasPersonalityFn()
+                            ? dyn_cast<Function>(F->getPersonalityFn())
+                            : nullptr;
----------------
For historical reasons, we often have bitcasts around personality functions. You should do getPersonalityFn()->stripPointerCasts().
================
Comment at: lib/CodeGen/AsmPrinter/DwarfCFIException.cpp:121-122
@@ -108,1 +120,4 @@
+                            : nullptr;
+  if (!Per)
+    Per = MMI->getPersonality();
 
----------------
Now that the personality is on the IR function, this should never return anything other than the value computed above. After fixing the casting issue, can we change this to an assertion?
Repository:
  rL LLVM
http://reviews.llvm.org/D10884
    
    
More information about the llvm-commits
mailing list