[PATCH] Classify functions by EH personality type rather than using the triple

Reid Kleckner rnk at google.com
Fri Jan 23 10:04:46 PST 2015


================
Comment at: include/llvm/MC/MCAsmInfo.h:491
@@ -491,6 +490,3 @@
   WinEH::EncodingType getWinEHEncodingType() const { return WinEHEncodingType; }
-
-  /// Return true if the exception handling type uses the language-specific data
-  /// area (LSDA) format specified by the Itanium C++ ABI.
-  bool usesItaniumLSDAForExceptions() const {
+  bool isExceptionHandlingDwarf() const {
     return (ExceptionsType == ExceptionHandling::DwarfCFI ||
----------------
majnemer wrote:
> This name isn't great, can we come up with a better one? Perhaps `usesCFI`?
Sounds good.

================
Comment at: lib/CodeGen/AsmPrinter/DwarfCFIException.cpp:54
@@ -53,3 +53,3 @@
 
-  if (!Asm->MAI->usesItaniumLSDAForExceptions())
+  if (!Asm->MAI->isExceptionHandlingDwarf())
     return;
----------------
majnemer wrote:
> This should probably be an assert.
No, SjLj is chained on top of DwarfCFIException. See TargetPassConfig::addPassesToHandleExceptions() and the fallthrough. =/

================
Comment at: lib/CodeGen/MachineModuleInfo.cpp:568-569
@@ +567,4 @@
+    PersonalityTypeCache = EHPersonality::None;
+  else if (Per->getName() == "__C_specific_handler")
+    PersonalityTypeCache = EHPersonality::Win64SEH;
+  else // Assume everything else is Itanium.
----------------
majnemer wrote:
> This doesn't work for C++ exceptions, they use the same personality routine name for 32-bit and 64-bit.
It's possible that the 32 and 64 bit CxxFrameHandler3 tables are similar enough in nature that we won't want to classify them differently. If they are, I think we can get the triple in here and make a decision based on target isa.

http://reviews.llvm.org/D6987

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list