[cfe-commits] r100119 - in /cfe/trunk: examples/clang-interpreter/main.cpp include/clang/Driver/Driver.h lib/Driver/Driver.cpp lib/Frontend/ASTUnit.cpp tools/driver/Makefile tools/driver/driver.cpp
Daniel Dunbar
daniel at zuster.org
Thu Apr 1 11:21:41 PDT 2010
Author: ddunbar
Date: Thu Apr 1 13:21:41 2010
New Revision: 100119
URL: http://llvm.org/viewvc/llvm-project?rev=100119&view=rev
Log:
Driver: Add support for a CLANGXX_IS_PRODUCTION build variable, which enable
Clang++ support, even in "Production" mode (for testing purposes).
Modified:
cfe/trunk/examples/clang-interpreter/main.cpp
cfe/trunk/include/clang/Driver/Driver.h
cfe/trunk/lib/Driver/Driver.cpp
cfe/trunk/lib/Frontend/ASTUnit.cpp
cfe/trunk/tools/driver/Makefile
cfe/trunk/tools/driver/driver.cpp
Modified: cfe/trunk/examples/clang-interpreter/main.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/examples/clang-interpreter/main.cpp?rev=100119&r1=100118&r2=100119&view=diff
==============================================================================
--- cfe/trunk/examples/clang-interpreter/main.cpp (original)
+++ cfe/trunk/examples/clang-interpreter/main.cpp Thu Apr 1 13:21:41 2010
@@ -71,7 +71,8 @@
Diagnostic Diags(&DiagClient);
Driver TheDriver(Path.getBasename(), Path.getDirname(),
llvm::sys::getHostTriple(),
- "a.out", /*IsProduction=*/false, Diags);
+ "a.out", /*IsProduction=*/false, /*CXXIsProduction=*/false,
+ Diags);
TheDriver.setTitle("clang interpreter");
// FIXME: This is a hack to try to force the driver to do something we can
Modified: cfe/trunk/include/clang/Driver/Driver.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Driver.h?rev=100119&r1=100118&r2=100119&view=diff
==============================================================================
--- cfe/trunk/include/clang/Driver/Driver.h (original)
+++ cfe/trunk/include/clang/Driver/Driver.h Thu Apr 1 13:21:41 2010
@@ -139,7 +139,8 @@
Driver(llvm::StringRef _Name, llvm::StringRef _Dir,
llvm::StringRef _DefaultHostTriple,
llvm::StringRef _DefaultImageName,
- bool IsProduction, Diagnostic &_Diags);
+ bool IsProduction, bool CXXIsProduction,
+ Diagnostic &_Diags);
~Driver();
/// @name Accessors
Modified: cfe/trunk/lib/Driver/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Driver.cpp?rev=100119&r1=100118&r2=100119&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Driver.cpp (original)
+++ cfe/trunk/lib/Driver/Driver.cpp Thu Apr 1 13:21:41 2010
@@ -45,7 +45,8 @@
Driver::Driver(llvm::StringRef _Name, llvm::StringRef _Dir,
llvm::StringRef _DefaultHostTriple,
llvm::StringRef _DefaultImageName,
- bool IsProduction, Diagnostic &_Diags)
+ bool IsProduction, bool CXXIsProduction,
+ Diagnostic &_Diags)
: Opts(createDriverOptTable()), Diags(_Diags),
Name(_Name), Dir(_Dir), DefaultHostTriple(_DefaultHostTriple),
DefaultImageName(_DefaultImageName),
@@ -66,7 +67,8 @@
CCCClangArchs.insert(llvm::Triple::x86_64);
CCCClangArchs.insert(llvm::Triple::arm);
- CCCUseClangCXX = false;
+ if (!CXXIsProduction)
+ CCCUseClangCXX = false;
}
// Compute the path to the resource directory.
Modified: cfe/trunk/lib/Frontend/ASTUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/ASTUnit.cpp?rev=100119&r1=100118&r2=100119&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/ASTUnit.cpp (original)
+++ cfe/trunk/lib/Frontend/ASTUnit.cpp Thu Apr 1 13:21:41 2010
@@ -378,7 +378,7 @@
// FIXME: We shouldn't have to pass in the path info.
driver::Driver TheDriver("clang", "/", llvm::sys::getHostTriple(),
- "a.out", false, Diags);
+ "a.out", false, false, Diags);
// Don't check that inputs exist, they have been remapped.
TheDriver.setCheckInputsExist(false);
Modified: cfe/trunk/tools/driver/Makefile
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/driver/Makefile?rev=100119&r1=100118&r2=100119&view=diff
==============================================================================
--- cfe/trunk/tools/driver/Makefile (original)
+++ cfe/trunk/tools/driver/Makefile Thu Apr 1 13:21:41 2010
@@ -11,6 +11,10 @@
TOOLNAME = clang
ifndef CLANG_IS_PRODUCTION
TOOLALIAS = clang++
+else
+ ifdef CLANGXX_IS_PRODUCTION
+ TOOLALIAS = clang++
+ endif
endif
CPP.Flags += -I$(PROJ_SRC_DIR)/../../include -I$(PROJ_OBJ_DIR)/../../include
@@ -33,4 +37,6 @@
ifdef CLANG_IS_PRODUCTION
CPP.Defines += -DCLANG_IS_PRODUCTION
endif
-
+ifdef CLANGXX_IS_PRODUCTION
+CPP.Defines += -DCLANGXX_IS_PRODUCTION
+endif
Modified: cfe/trunk/tools/driver/driver.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/driver/driver.cpp?rev=100119&r1=100118&r2=100119&view=diff
==============================================================================
--- cfe/trunk/tools/driver/driver.cpp (original)
+++ cfe/trunk/tools/driver/driver.cpp Thu Apr 1 13:21:41 2010
@@ -197,12 +197,19 @@
#ifdef CLANG_IS_PRODUCTION
const bool IsProduction = true;
+# ifdef CLANGXX_IS_PRODUCTION
+ const bool CXXIsProduction = true;
+# else
+ const bool CXXIsProduction = false;
+# endif
#else
const bool IsProduction = false;
+ const bool CXXIsProduction = false;
#endif
Driver TheDriver(Path.getBasename(), Path.getDirname(),
llvm::sys::getHostTriple(),
- "a.out", IsProduction, Diags);
+ "a.out", IsProduction, CXXIsProduction,
+ Diags);
// Check for ".*++" or ".*++-[^-]*" to determine if we are a C++
// compiler. This matches things like "c++", "clang++", and "clang++-1.1".
More information about the cfe-commits
mailing list