[cfe-commits] r82583 - in /cfe/trunk: include/clang/Driver/Driver.h lib/Driver/Driver.cpp tools/driver/Makefile tools/driver/driver.cpp
Daniel Dunbar
daniel at zuster.org
Tue Sep 22 15:31:13 PDT 2009
Author: ddunbar
Date: Tue Sep 22 17:31:13 2009
New Revision: 82583
URL: http://llvm.org/viewvc/llvm-project?rev=82583&view=rev
Log:
Push "clang-is-production" logic up to tools/driver, and make it hittable by
defining the CLANG_IS_PRODUCTION Makefile variable.
Modified:
cfe/trunk/include/clang/Driver/Driver.h
cfe/trunk/lib/Driver/Driver.cpp
cfe/trunk/tools/driver/Makefile
cfe/trunk/tools/driver/driver.cpp
Modified: cfe/trunk/include/clang/Driver/Driver.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Driver.h?rev=82583&r1=82582&r2=82583&view=diff
==============================================================================
--- cfe/trunk/include/clang/Driver/Driver.h (original)
+++ cfe/trunk/include/clang/Driver/Driver.h Tue Sep 22 17:31:13 2009
@@ -115,7 +115,7 @@
Driver(const char *_Name, const char *_Dir,
const char *_DefaultHostTriple,
const char *_DefaultImageName,
- Diagnostic &_Diags);
+ bool IsProduction, 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=82583&r1=82582&r2=82583&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Driver.cpp (original)
+++ cfe/trunk/lib/Driver/Driver.cpp Tue Sep 22 17:31:13 2009
@@ -43,26 +43,28 @@
Driver::Driver(const char *_Name, const char *_Dir,
const char *_DefaultHostTriple,
const char *_DefaultImageName,
- Diagnostic &_Diags)
+ bool IsProduction, Diagnostic &_Diags)
: Opts(new OptTable()), Diags(_Diags),
Name(_Name), Dir(_Dir), DefaultHostTriple(_DefaultHostTriple),
DefaultImageName(_DefaultImageName),
Host(0),
CCCIsCXX(false), CCCEcho(false), CCCPrintBindings(false),
CCCGenericGCCName("gcc"), CCCUseClang(true),
-#ifdef USE_PRODUCTION_CLANG
- CCCUseClangCXX(false),
-#else
- CCCUseClangCXX(true),
-#endif
- CCCUseClangCPP(true), CCCUsePCH(true),
+ CCCUseClangCXX(true), CCCUseClangCPP(true), CCCUsePCH(true),
SuppressMissingInputWarning(false) {
-#ifdef USE_PRODUCTION_CLANG
- // In a "production" build, only use clang on architectures we expect to work.
- CCCClangArchs.insert(llvm::Triple::x86);
- CCCClangArchs.insert(llvm::Triple::x86_64);
- CCCClangArchs.insert(llvm::Triple::arm);
-#endif
+ if (IsProduction) {
+ // In a "production" build, only use clang on architectures we expect to
+ // work, and don't use clang C++.
+ //
+ // During development its more convenient to always have the driver use
+ // clang, but we don't want users to be confused when things don't work, or
+ // to file bugs for things we don't support.
+ CCCClangArchs.insert(llvm::Triple::x86);
+ CCCClangArchs.insert(llvm::Triple::x86_64);
+ CCCClangArchs.insert(llvm::Triple::arm);
+
+ CCCUseClangCXX = false;
+ }
}
Driver::~Driver() {
Modified: cfe/trunk/tools/driver/Makefile
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/driver/Makefile?rev=82583&r1=82582&r2=82583&view=diff
==============================================================================
--- cfe/trunk/tools/driver/Makefile (original)
+++ cfe/trunk/tools/driver/Makefile Tue Sep 22 17:31:13 2009
@@ -21,3 +21,9 @@
USEDLIBS = clangDriver.a clangBasic.a
include $(LEVEL)/Makefile.common
+
+# Translate make variable to define when building a "production" clang.
+ifdef CLANG_IS_PRODUCTION
+CPP.Defines += -DCLANG_IS_PRODUCTION
+endif
+
Modified: cfe/trunk/tools/driver/driver.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/driver/driver.cpp?rev=82583&r1=82582&r2=82583&view=diff
==============================================================================
--- cfe/trunk/tools/driver/driver.cpp (original)
+++ cfe/trunk/tools/driver/driver.cpp Tue Sep 22 17:31:13 2009
@@ -188,9 +188,14 @@
Diagnostic Diags(&DiagClient);
+#ifdef CLANG_IS_PRODUCTION
+ bool IsProduction = true;
+#else
+ bool IsProduction = false;
+#endif
Driver TheDriver(Path.getBasename().c_str(), Path.getDirname().c_str(),
llvm::sys::getHostTriple().c_str(),
- "a.out", Diags);
+ "a.out", IsProduction, Diags);
llvm::OwningPtr<Compilation> C;
More information about the cfe-commits
mailing list