[PATCH] Work-in-progress omnibus patch for native Windows C++ EH outlining

David Majnemer david.majnemer at gmail.com
Wed Feb 25 15:39:05 PST 2015


REPOSITORY
  rL LLVM

================
Comment at: lib/CodeGen/WinEHPrepare.cpp:705-714
@@ -390,1 +704,12 @@
+  Function *Handler;
+  if (CatchOrCleanup == Catch) {
+    FunctionType *FnType = FunctionType::get(Int8PtrType, ArgTys, false);
+    Handler = Function::Create(FnType, GlobalVariable::ExternalLinkage,
+                               SrcFn->getName() + ".catch", M);
+  } else {
+    FunctionType *FnType =
+        FunctionType::get(Type::getVoidTy(Context), ArgTys, false);
+    Handler = Function::Create(FnType, GlobalVariable::ExternalLinkage,
+                               SrcFn->getName() + ".cleanup", M);
+  }
 
----------------
andrew.w.kaylor wrote:
> majnemer wrote:
> > I'm guessing we are not going to want to always give them `ExternalLinkage` but I guess we can fix that later.  Perhaps we should have a TODO?
> That's a good point.  I'm not sure I know all the implications of the various linkage options, but it sounds like PrivateLinkage is probably what we want here.
`InternalLinkage` is a bit nicer, it allows us to remove it if it becomes transitively unreferenced at link-time.

http://reviews.llvm.org/D7886

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






More information about the llvm-commits mailing list