[PATCH] [-cxx-abi microsoft] Mangle user defined entry points properly
Richard Smith
richard at metafoo.co.uk
Fri Sep 13 13:18:18 PDT 2013
================
Comment at: cfe/trunk/lib/AST/MicrosoftMangle.cpp:83-95
@@ +82,15 @@
+// unit.
+static bool isUserDefinedEntryPoint(const FunctionDecl *FD) {
+ if (!FD->getIdentifier())
+ return false;
+
+ return llvm::StringSwitch<bool>(FD->getName())
+ .Cases("main", // An ANSI console app
+ "wmain", // A Unicode console App
+ "WinMain", // An ANSI GUI app
+ "wWinMain", // A Unicode GUI app
+ "DllMain", // A DLL
+ true)
+ .Default(false);
+}
+
----------------
You should also check that the function was declared in the translation unit (and not, say, in a namespace or as a member function).
http://llvm-reviews.chandlerc.com/D1670
COMMIT
http://llvm-reviews.chandlerc.com/rL190675
More information about the cfe-commits
mailing list