[cfe-commits] r137563 - in /cfe/trunk: include/clang/Driver/Types.def lib/Driver/Tools.cpp lib/Driver/Types.cpp test/Driver/objc++-cpp-output.mm test/Driver/objc-cpp-output.m
Nico Weber
nicolasweber at gmx.de
Sat Aug 13 16:13:37 PDT 2011
Author: nico
Date: Sat Aug 13 18:13:37 2011
New Revision: 137563
URL: http://llvm.org/viewvc/llvm-project?rev=137563&view=rev
Log:
Add support of -x objc-cpp-output, -x objc++-cpp-output to the Driver.
Matches gcc, and is also required for using ccache with clang.
Added:
cfe/trunk/test/Driver/objc++-cpp-output.mm
cfe/trunk/test/Driver/objc-cpp-output.m
Modified:
cfe/trunk/include/clang/Driver/Types.def
cfe/trunk/lib/Driver/Tools.cpp
cfe/trunk/lib/Driver/Types.cpp
Modified: cfe/trunk/include/clang/Driver/Types.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Types.def?rev=137563&r1=137562&r2=137563&view=diff
==============================================================================
--- cfe/trunk/include/clang/Driver/Types.def (original)
+++ cfe/trunk/include/clang/Driver/Types.def Sat Aug 13 18:13:37 2011
@@ -44,10 +44,12 @@
TYPE("cl", CL, PP_C, 0, "u")
TYPE("cuda", CUDA, PP_CXX, 0, "u")
TYPE("objective-c-cpp-output", PP_ObjC, INVALID, "mi", "u")
+TYPE("objc-cpp-output", PP_ObjC_Alias, INVALID, "mi", "u")
TYPE("objective-c", ObjC, PP_ObjC, 0, "u")
TYPE("c++-cpp-output", PP_CXX, INVALID, "ii", "u")
TYPE("c++", CXX, PP_CXX, 0, "u")
TYPE("objective-c++-cpp-output", PP_ObjCXX, INVALID, "mii", "u")
+TYPE("objc++-cpp-output", PP_ObjCXX_Alias, INVALID, "mii", "u")
TYPE("objective-c++", ObjCXX, PP_ObjCXX, 0, "u")
// C family input files to precompile.
Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=137563&r1=137562&r2=137563&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Sat Aug 13 18:13:37 2011
@@ -2400,13 +2400,15 @@
case types::TY_PP_C: case types::TY_PP_CHeader:
return "cc1";
case types::TY_ObjC: case types::TY_ObjCHeader:
- case types::TY_PP_ObjC: case types::TY_PP_ObjCHeader:
+ case types::TY_PP_ObjC: case types::TY_PP_ObjC_Alias:
+ case types::TY_PP_ObjCHeader:
return "cc1obj";
case types::TY_CXX: case types::TY_CXXHeader:
case types::TY_PP_CXX: case types::TY_PP_CXXHeader:
return "cc1plus";
case types::TY_ObjCXX: case types::TY_ObjCXXHeader:
- case types::TY_PP_ObjCXX: case types::TY_PP_ObjCXXHeader:
+ case types::TY_PP_ObjCXX: case types::TY_PP_ObjCXX_Alias:
+ case types::TY_PP_ObjCXXHeader:
return "cc1objplus";
}
}
Modified: cfe/trunk/lib/Driver/Types.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Types.cpp?rev=137563&r1=137562&r2=137563&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Types.cpp (original)
+++ cfe/trunk/lib/Driver/Types.cpp Sat Aug 13 18:13:37 2011
@@ -79,9 +79,9 @@
case TY_C: case TY_PP_C:
case TY_CL:
case TY_CUDA:
- case TY_ObjC: case TY_PP_ObjC:
+ case TY_ObjC: case TY_PP_ObjC: case TY_PP_ObjC_Alias:
case TY_CXX: case TY_PP_CXX:
- case TY_ObjCXX: case TY_PP_ObjCXX:
+ case TY_ObjCXX: case TY_PP_ObjCXX: case TY_PP_ObjCXX_Alias:
case TY_CHeader: case TY_PP_CHeader:
case TY_ObjCHeader: case TY_PP_ObjCHeader:
case TY_CXXHeader: case TY_PP_CXXHeader:
@@ -110,10 +110,10 @@
default:
return false;
- case TY_ObjC: case TY_PP_ObjC:
+ case TY_ObjC: case TY_PP_ObjC: case TY_PP_ObjC_Alias:
case TY_ObjCXX: case TY_PP_ObjCXX:
case TY_ObjCHeader: case TY_PP_ObjCHeader:
- case TY_ObjCXXHeader: case TY_PP_ObjCXXHeader:
+ case TY_ObjCXXHeader: case TY_PP_ObjCXXHeader: case TY_PP_ObjCXX_Alias:
return true;
}
}
Added: cfe/trunk/test/Driver/objc++-cpp-output.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/objc%2B%2B-cpp-output.mm?rev=137563&view=auto
==============================================================================
--- cfe/trunk/test/Driver/objc++-cpp-output.mm (added)
+++ cfe/trunk/test/Driver/objc++-cpp-output.mm Sat Aug 13 18:13:37 2011
@@ -0,0 +1,8 @@
+// RUN: %clang -x objc++-cpp-output -c %s -o /dev/null
+
+// Should compile without errors
+ at protocol P
+- (void)m;
+ at end
+void f() {}
+class C {};
Added: cfe/trunk/test/Driver/objc-cpp-output.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/objc-cpp-output.m?rev=137563&view=auto
==============================================================================
--- cfe/trunk/test/Driver/objc-cpp-output.m (added)
+++ cfe/trunk/test/Driver/objc-cpp-output.m Sat Aug 13 18:13:37 2011
@@ -0,0 +1,7 @@
+// RUN: %clang -x objc-cpp-output -c %s -o /dev/null
+
+// Should compile without errors
+ at protocol P
+- (void)m;
+ at end
+void f() {}
More information about the cfe-commits
mailing list