r205729 - -fms-extensions: Don't define __PRETTY_FUNCTION__ to __FUNCTION__

Reid Kleckner reid at kleckner.net
Mon Apr 7 12:27:58 PDT 2014


Author: rnk
Date: Mon Apr  7 14:27:58 2014
New Revision: 205729

URL: http://llvm.org/viewvc/llvm-project?rev=205729&view=rev
Log:
-fms-extensions: Don't define __PRETTY_FUNCTION__ to __FUNCTION__

This reverts r90596 from 2009. Having this macro definition makes Clang
strictly less useful with -fms-extensions.

Modified:
    cfe/trunk/lib/Frontend/InitPreprocessor.cpp
    cfe/trunk/test/CodeGen/predefined-expr.c

Modified: cfe/trunk/lib/Frontend/InitPreprocessor.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/InitPreprocessor.cpp?rev=205729&r1=205728&r2=205729&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/InitPreprocessor.cpp (original)
+++ cfe/trunk/lib/Frontend/InitPreprocessor.cpp Mon Apr  7 14:27:58 2014
@@ -508,10 +508,6 @@ static void InitializePredefinedMacros(c
   }
 
   if (LangOpts.MicrosoftExt) {
-    // Both __PRETTY_FUNCTION__ and __FUNCTION__ are GCC extensions, however
-    // VC++ appears to only like __FUNCTION__.
-    Builder.defineMacro("__PRETTY_FUNCTION__", "__FUNCTION__");
-    // Work around some issues with Visual C++ headers.
     if (LangOpts.WChar) {
       // wchar_t supported as a keyword.
       Builder.defineMacro("_WCHAR_T_DEFINED");

Modified: cfe/trunk/test/CodeGen/predefined-expr.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/predefined-expr.c?rev=205729&r1=205728&r2=205729&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/predefined-expr.c (original)
+++ cfe/trunk/test/CodeGen/predefined-expr.c Mon Apr  7 14:27:58 2014
@@ -1,4 +1,5 @@
 // RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -fms-extensions %s -emit-llvm -o - | FileCheck %s
 
 // CHECK: @__func__.plainFunction = private unnamed_addr constant [14 x i8] c"plainFunction\00"
 // CHECK: @__PRETTY_FUNCTION__.plainFunction = private unnamed_addr constant [21 x i8] c"void plainFunction()\00"





More information about the cfe-commits mailing list