Disable all recognition of main() in -ffreestanding. Addresses bug #4720.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79070 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/Mangle.cpp b/lib/CodeGen/Mangle.cpp
index 341e230..71b84e7 100644
--- a/lib/CodeGen/Mangle.cpp
+++ b/lib/CodeGen/Mangle.cpp
@@ -91,7 +91,7 @@
// name mangling (always).
if (!FD->hasAttr<OverloadableAttr>()) {
// C functions are not mangled, and "main" is never mangled.
- if (!Context.getLangOptions().CPlusPlus || FD->isMain())
+ if (!Context.getLangOptions().CPlusPlus || FD->isMain(Context))
return false;
// No mangling in an "implicit extern C" header.