[PATCH] D47862: [CodeGen] Always use MSVC personality for windows-msvc targets

Shoaib Meenai via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 7 17:17:50 PDT 2018


smeenai added inline comments.


================
Comment at: lib/CodeGen/CGException.cpp:134-135
   const llvm::Triple &T = Target.getTriple();
+  if (T.isWindowsMSVCEnvironment())
+    return EHPersonality::MSVC_CxxFrameHandler3;
+
----------------
rnk wrote:
> I guess previously we carefully arranged to go to whatever the regular objc personality would be, but we're not doing that now with funclet windows eh.
> Maybe we could drastically simplify this by checking for an msvc environment and seh before checking each language?
I gave this a shot. EHPersonality::get already has code to make SEH functions always get the SEH personality (line 223 below), so I added another condition below to make an MSVC triple always get the MSVC personality, and then removed all those conditionals from the individual get*Personality functions. Unfortunately, there's also code below (in SimplifyPersonality) that calls getCXXPersonality directly, so we still need to leave the MSVC check in there, and having the check in there but not any of the other get*Personality functions seems really ugly. The other option is to adjust SimplifyPersonality instead, which ends up looking like P8086; do you think that's worth it? Or did you mean something else entirely?


Repository:
  rC Clang

https://reviews.llvm.org/D47862





More information about the cfe-commits mailing list