Commit Graph

288 Commits

Author SHA1 Message Date
Benjamin Kramer 4ab36ba726 Turns out that we may end up calling dladdr on GetExecutablePath, give it external linkage to make sure the lookup works on all platforms.
llvm-svn: 117813
2010-10-30 17:32:40 +00:00
Benjamin Kramer c482735d89 This function doesn't need external linkage either.
llvm-svn: 117786
2010-10-30 14:28:41 +00:00
Oscar Fuentes 16d73f9216 Do not use absolute path on the clang++ symlink.
Based on a patch by Ryuta Suzuki!

llvm-svn: 116695
2010-10-18 02:25:54 +00:00
Oscar Fuentes 95b6f045f1 Use a script for creating the clang++ executable.
The previous method used the DESTDIR environment variable at configure
time, but sometimes it is only available at install time. See PR8397.

llvm-svn: 116689
2010-10-17 16:10:32 +00:00
Rafael Espindola 85111907bb Call InitSections when assembling. This makes clang's output match that of
llvm-mc.

llvm-svn: 116405
2010-10-13 14:53:57 +00:00
Daniel Dunbar 2126aae674 build: Add support for a CLANG_ORDER_FILE build variable to specify the path to
the order file to use for the clang executable.

llvm-svn: 114052
2010-09-16 00:42:38 +00:00
Michael J. Spencer 09476212de Revert "CMake: Update to use standard CMake dependency tracking facilities instead"
This reverts commit r113631

Conflicts:

	CMakeLists.txt
	lib/CodeGen/CMakeLists.txt

llvm-svn: 113817
2010-09-13 23:54:41 +00:00
Daniel Dunbar b5b7d1a415 Driver: Set TOOL_NO_EXPORTS when building a "production" compiler, we don't
currently expect that to be useful for plugins, and this is important for
startup performance:
--
ddunbar@lordcrumb:tmp$ touch empty.c
ddunbar@lordcrumb:tmp$ runN 100 ~/llvm.obj.64/Release/bin/clang -c empty.c
name	  avg  	  min  	  med  	  max  	   SD  	 total 
user	 0.0054	 0.0052	 0.0054	 0.0055	 0.0000	 0.5350
 sys	 0.0084	 0.0090	 0.0078	 0.0087	 0.0008	 0.8390
wall	 0.0149	 0.0149	 0.0149	 0.0149	 0.0003	 1.4943
ddunbar@lordcrumb:tmp$ runN 100 ~/llvm.obj.64/Release/bin/clang -c empty.c
name	  avg  	  min  	  med  	  max  	   SD  	 total 
user	 0.0036	 0.0036	 0.0036	 0.0038	 0.0000	 0.3646
 sys	 0.0072	 0.0071	 0.0068	 0.0070	 0.0006	 0.7158
wall	 0.0123	 0.0123	 0.0122	 0.0136	 0.0003	 1.2262
--

llvm-svn: 113638
2010-09-10 21:42:03 +00:00
Michael J. Spencer 0881f4a367 CMake: Update to use standard CMake dependency tracking facilities instead
of whatever we were using before...

llvm-svn: 113631
2010-09-10 21:13:16 +00:00
Rafael Espindola b2d0d40c3d Make "-ccc-cxx" option work on Linux.
Patch by nobled.

I also took the opportunity to make the field private since now it is only ready from the
outside.

llvm-svn: 113138
2010-09-06 02:36:23 +00:00
Duncan Sands f610b5b622 Straighten out target triples provided on the command line
before using them.

llvm-svn: 112468
2010-08-30 09:42:39 +00:00
Peter Collingbourne 85dd0bd18d Move ExecuteCompilerInvocation to a new library FrontendTool
r110903 introduced a dependency from Frontend to every library that
declared an Action by introducing Action references that previously
resided in the driver in the file ExecuteCompilerInvocation.cpp.
This patch moves ExecuteCompilerInvocation to a new library named
FrontendTool which is intended to bear these dependencies.

llvm-svn: 111873
2010-08-24 00:31:22 +00:00
John McCall 8b0666cf79 Another step in the process of making the parser depend on Sema:
- move DeclSpec &c into the Sema library
  - move ParseAST into the Parse library
Reflect this change in a thousand different includes.
Reflect this change in the link orders.

llvm-svn: 111667
2010-08-20 18:27:03 +00:00
Douglas Gregor 2dd19f1d5f Simplify the ownership model for DiagnosticClients, which was really
convoluted and a bit leaky. Now, the Diagnostic object owns its
DiagnosticClient.

llvm-svn: 111437
2010-08-18 22:29:43 +00:00
Dan Gohman b37af7de47 Call llvm::remove_fatal_error_handler before deallocating objects
which are used by the error handling functions.

llvm-svn: 111427
2010-08-18 21:23:17 +00:00
Sebastian Redl 135bcc791b Reintroduce the serialization library, with fixed dependencies.
llvm-svn: 111279
2010-08-17 20:43:28 +00:00
Douglas Gregor 256a7282e4 Revert Sebastian's build-breaking patch.
llvm-svn: 111265
2010-08-17 18:31:01 +00:00
Sebastian Redl 52ce9bb2fb Create a new Serialization module that contains all the PCH code, and will contain all the module code in the future. Update the Makefiles, CMake projects and the Xcode project. I hope I did everything right for Xcode. No functionality change.
llvm-svn: 111258
2010-08-17 17:55:49 +00:00
Daniel Dunbar e9e91b0597 Frontend: Move the bulk of the cc1_main() processing into
ExecuteCompilerInvocation in libFrontend.

llvm-svn: 110903
2010-08-12 02:53:12 +00:00
Daniel Dunbar 1cdf04c193 clang -cc1: Move real diagnostics client initialization to earlier.
llvm-svn: 110902
2010-08-12 02:53:07 +00:00
Daniel Dunbar 2be96746b4 Frontend: Change PluginASTAction::ParseArgs to take a CompilerInstance object
for use in reporting diagnostics.
 - We don't want to use the Action's own CompilerInstance, because that is only
   initialized during file processing and I like that invariant.

Also, if ParseArgs returns false then abandon execution.

Also, remove unused PluginASTAction::PrintHelp virtual method.

llvm-svn: 110039
2010-08-02 15:31:28 +00:00
Daniel Dunbar 88979914d7 Driver: Keep track of a separate "install dir", which is the path where clang
was invoked from (which may not be where the executable itself is).
 - This allows having e.g., /Developer/usr/bin/clang be a symlink to some other
   location, while still making sure the Driver finds 'as', 'ld', etc. relative
   to itself.

llvm-svn: 109989
2010-08-01 22:29:51 +00:00
Daniel Dunbar 5863fa5215 Simplify.
llvm-svn: 109988
2010-08-01 22:29:47 +00:00
Benjamin Kramer 4b5de0d6a3 Prepare for upcoming ownership change.
llvm-svn: 109766
2010-07-29 17:48:03 +00:00
Douglas Gregor 67ca40c419 Eliminate the "minimal" and printing parser actions, which only ever
worked for C anyway. Also kills the -cc1 options -parse-noop and
-parse-print-callbacks.

llvm-svn: 109392
2010-07-26 04:08:02 +00:00
Douglas Gregor af82e3510b Introduce a new lexer function to compute the "preamble" of a file,
which is the part of the file that contains all of the initial
comments, includes, and preprocessor directives that occur before any
of the actual code. Added a new -print-preamble cc1 action that is
only used for testing.

llvm-svn: 108913
2010-07-20 20:18:03 +00:00
Daniel Dunbar 9d8416b799 Driver: Switch to using a SmallVector instead of std::vector, and stop
accessing outside the range of the vector (which always asserts on Win32).

llvm-svn: 108802
2010-07-20 02:47:40 +00:00
Rafael Espindola 77a067a653 Implement support for reading arguments specified in a file with @file. If
there is no file named "file", keep the @file option unchanged.

llvm-svn: 108697
2010-07-19 15:20:12 +00:00
Daniel Dunbar 00c57967da Revert r108672, "Implement support for reading arguments specified in a file
with @file.", it doesn't correctly handle cases where arguments starting with
'@' are passed to other command line arguments.

llvm-svn: 108686
2010-07-19 07:21:12 +00:00
Rafael Espindola 129e43d29b Implement support for reading arguments specified in a file with @file.
llvm-svn: 108672
2010-07-19 03:08:01 +00:00
Zhongxing Xu 84f65e0692 Reapply r108617.
llvm-svn: 108668
2010-07-19 01:31:21 +00:00
Daniel Dunbar e38764c66c Driver: Change the driver to take the path to the main executable, instead of
taking it in pieces.
 - Fixes a problem where the Clang executable path was not initialized properly
   on Win32, because sys::Path::getBasename() doesn't do what I always think it
   does. Imagine that, a sys::Path interface that is confusing!

llvm-svn: 108667
2010-07-19 00:44:04 +00:00
Daniel Dunbar deaff5d792 Update for LLVM API change.
llvm-svn: 108665
2010-07-19 00:33:53 +00:00
Rafael Espindola 7661436220 Refactor the code a bit so that there is only one call to BuildCompilation. The
StringPointers vector will also be used in the normal case to handle @file
arguments.

llvm-svn: 108660
2010-07-18 22:03:55 +00:00
Benjamin Kramer e2e031ed6f Revert r108617, it broke the build.
llvm-svn: 108621
2010-07-17 13:51:58 +00:00
Zhongxing Xu 8de7966fd5 Fix cmake build.
llvm-svn: 108619
2010-07-17 11:59:16 +00:00
Zhongxing Xu 4ca4a999b1 Prepare the analyzer for the callee in another translation unit:
Let AnalysisContext contain a TranslationUnit.
  Let CallEnter refer to an AnalysisContext instead of a FunctionDecl.

llvm-svn: 108617
2010-07-17 11:12:42 +00:00
Daniel Dunbar 05474285aa clang -cc1as: Switch to using AsmParser constructor function.
llvm-svn: 108605
2010-07-17 02:26:21 +00:00
Daniel Dunbar 758f87cb97 build/Darwin: Add missing Info.plist template.
llvm-svn: 108457
2010-07-15 20:26:56 +00:00
Daniel Dunbar 20267fefa2 build/Darwin: Enable version information for clang executable.
llvm-svn: 108445
2010-07-15 19:33:44 +00:00
Nick Lewycky 32a168c5f8 Clang do so have plugins, we can't prune exports. Fixes plugin support.
llvm-svn: 108054
2010-07-10 20:19:47 +00:00
Daniel Dunbar a2b1f8b5cd MC: Pass the target instance to the AsmParser constructor.
llvm-svn: 107427
2010-07-01 20:41:59 +00:00
Daniel Dunbar 7c995e8fac Frontend: Allow passing -cc1 level arguments to plugins. Patch by Troy Straszheim!
llvm-svn: 106113
2010-06-16 16:59:23 +00:00
Daniel Dunbar c1b1729b66 Break Frontend's dependency on Rewrite, Checker and CodeGen in shared library configuration
Currently, all AST consumers are located in the Frontend library,
meaning that in a shared library configuration, Frontend has a
dependency on Rewrite, Checker and CodeGen.  This is suboptimal for
clients which only wish to make use of the frontend.  CodeGen in
particular introduces a large number of unwanted dependencies.

This patch breaks the dependency by moving all AST consumers with
dependencies on Rewrite, Checker and/or CodeGen to their respective
libraries.  The patch therefore introduces dependencies in the other
direction (i.e. from Rewrite, Checker and CodeGen to Frontend).

After applying this patch, Clang builds correctly using CMake and
shared libraries ("cmake -DBUILD_SHARED_LIBS=ON").

N.B. This patch includes file renames which are indicated in the
patch body.

Changes in this revision of the patch:
 - Fixed some copy-paste mistakes in the header files
 - Modified certain aspects of the coding to comply with the LLVM
   Coding Standards

llvm-svn: 106010
2010-06-15 17:48:49 +00:00
Daniel Dunbar a442fd5da6 Driver: Fix arg_iterator typing to reflect that it is really an iterator over Arg*s.
llvm-svn: 105838
2010-06-11 22:00:13 +00:00
Daniel Dunbar ee6b692551 Makefiles: Set Clang CPP compiler flags in a single location, instead of scattered throughout the project Makefiles.
llvm-svn: 105638
2010-06-08 20:44:43 +00:00
Daniel Dunbar e6c1daa8fd Makefile: Switch Clang Makefiles to always include the top-level Clang Makefile.
- This eliminates most dependencies on how Clang is installed relative to LLVM.

llvm-svn: 105637
2010-06-08 20:34:18 +00:00
Daniel Dunbar 6f8362c6bf Frontend: Add CodeGenAction support for handling LLVM IR.
- This magically enables using 'clang -cc1' as a replacement for most of 'llvm-as', 'llvm-dis', 'llc' and 'opt' functionality.

For example, 'llvm-as' is:
  $ clang -cc1 -emit-llvm-bc FOO.ll -o FOO.bc
and 'llvm-dis' is:
  $ clang -cc1 -emit-llvm    FOO.bc -o -
and 'opt' is, e.g.:
  $ clang -cc1 -emit-llvm -O3 -o FOO.opt.ll FOO.ll
and 'llc' is, e.g.:
  $ clang -cc1 -S -o - FOO.ll

The nice thing about using the backend tools this way is that they are guaranteed to exactly match how the compiler generates code (for example, setting the same backend options).

llvm-svn: 105583
2010-06-07 23:27:59 +00:00
Daniel Dunbar 4c77a64391 Driver/Frontend: Add -emit-codegen-only, for running irgen + codegen but not the
.s printer or .o writer.

llvm-svn: 104623
2010-05-25 18:41:01 +00:00
Daniel Dunbar 0454f657ce clang -cc1as: Add -help, -version, and -mllvm support.
Also, fix output defaulting to match llvm-mc.

llvm-svn: 104246
2010-05-20 18:15:20 +00:00
Daniel Dunbar 2fcaa549a8 Driver/MC: Add 'clang -cc1as' integrated assembler tool, currently accepts approximately the same interface as 'llvm-mc'.
llvm-svn: 104239
2010-05-20 17:49:16 +00:00
Douglas Gregor 542ad31597 Add a stub frontend action for BoostCon, for next week's workshop.
llvm-svn: 103258
2010-05-07 15:41:56 +00:00
Douglas Gregor a9f7c3263e CMake: Fix DESTDIR-related installation problem on Windows, from the
mysterious Elrood on IRC.

llvm-svn: 102435
2010-04-27 16:14:06 +00:00
Dan Gohman 145f3f1e83 Fix -Wcast-qual warnings.
llvm-svn: 101786
2010-04-19 16:39:44 +00:00
Daniel Dunbar 76fa840d09 Driver/Frontend: Add support for -mllvm, which forwards options to the LLVM option parser.
- Note that this is a behavior change, previously -mllvm at the driver level forwarded to clang -cc1. The driver does a little magic to make sure that '-mllvm -disable-llvm-optzns' works correctly, but other users will need to be updated to use -Xclang.

llvm-svn: 101354
2010-04-15 06:09:03 +00:00
Daniel Dunbar 8ee6760971 Fronted: Kill overly specialized RecordLayoutDumper, just make -dump-record-layouts a bit that Sema honors.
llvm-svn: 100747
2010-04-08 02:59:56 +00:00
Chris Lattner 1f054ecca2 update for api change.
llvm-svn: 100718
2010-04-07 23:12:35 +00:00
Chris Lattner 6d67213ebb reduce indentation, tidy.
llvm-svn: 100537
2010-04-06 17:52:14 +00:00
Chris Lattner 61955ab200 inline in MC assembly parsers. clang -integrated-as now
works with inline asm!

llvm-svn: 100493
2010-04-05 23:33:20 +00:00
Daniel Dunbar e43887bd2b Driver: Add support for a CLANGXX_IS_PRODUCTION build variable, which enable
Clang++ support, even in "Production" mode (for testing purposes).

llvm-svn: 100119
2010-04-01 18:21:41 +00:00
Douglas Gregor 171b780c91 Teach Clang's -cc1 option -print-stats to print LLVM statistics.
llvm-svn: 99894
2010-03-30 17:33:59 +00:00
Chris Lattner 09f8cc8c70 make -ftime-report work even in -disable-free mode. Woo, finally.
rdar://7781603

llvm-svn: 99878
2010-03-30 05:39:52 +00:00
Daniel Dunbar 30b24e95fa Frontend: Don't free the CompilerInstance or FrontendActions when running under
-disable-free. Among other things, this fixes freeing of the LLVM module on
exit.
 - Note that this means we are disable-free'ing of a lot more stuff than we used to -- this should flush out bugs in anything left that is trying to do real work in its destructor. I did a mini-audit but '::~' is not totally uncommon.

llvm-svn: 99258
2010-03-23 05:09:16 +00:00
Daniel Dunbar 6a8efa8a79 Driver: Support CC_PRINT_OPTIONS, used for logging the compile commands (in -v style) to a file.
llvm-svn: 99054
2010-03-20 08:01:59 +00:00
Daniel Dunbar 1c201fbf73 clang -cc1: Kill off -empty-input only, and replace with -init-only which is an
actual action.
 - This is easier to use, and more reliable for timing the thing this was
   actually meant to be useful for.

llvm-svn: 98978
2010-03-19 19:44:04 +00:00
Jeffrey Yasskin f6442f80cb Allow users to set CPPFLAGS and CXXFLAGS on the make command line.
Tested: make CPPFLAGS=-m64 CXXFLAGS=-m64 -j8 && (cd tools/clang;make test)
llvm-svn: 98399
2010-03-12 22:55:16 +00:00
Kovarththanan Rajaratnam 4bc61181f9 Mark variable as const
llvm-svn: 97951
2010-03-08 18:33:04 +00:00
Daniel Dunbar cea0c70f12 Frontend: Pull CodeGenAction out more, and eliminate CreateBackendConsumer.
This is the way I would like to move the frontend function towards -- distinct
pieces of functionality should be exposed only via FrontendAction
implementations which have clean and relatively-stable APIs.

This also isolates the surface area in clang which depends on LLVM CodeGen.

llvm-svn: 97110
2010-02-25 04:37:45 +00:00
Daniel Dunbar 12ee380a61 Driver: Use TextDiagnosticPrinter instead of a custom one.
llvm-svn: 97102
2010-02-25 03:23:43 +00:00
Daniel Dunbar 43b464cfe5 Remove unused includes.
llvm-svn: 96760
2010-02-21 21:47:19 +00:00
Daniel Dunbar d2b20c1348 clang: Add support for s// edit form of QA_OVERRIDE_GCC3_OPTIONS.
- Used to do regex patsubst on arguments.

llvm-svn: 96512
2010-02-17 21:00:34 +00:00
Daniel Dunbar e922d9bdf0 CompilerInstance: Move LLVMContext member out of constructor.
llvm-svn: 96314
2010-02-16 01:54:47 +00:00
Daniel Dunbar aced322c3c Switch clang to use its own LLVMContext (not the global one).
llvm-svn: 96313
2010-02-16 01:54:33 +00:00
Douglas Gregor 62d311fdf4 Introduce a testbed for merging multiple ASTs into a single AST
context with the AST importer. WIP, still useless but at least it has
a test.

llvm-svn: 95683
2010-02-09 19:21:46 +00:00
Daniel Dunbar 92db0fbe5a clang -cc1: Wire up -emit-obj, for emitting object files.
llvm-svn: 95182
2010-02-03 01:18:43 +00:00
Chandler Carruth 7e6c0fcc59 Bring driver link order in CMake into alignment with the order in the Makefile.
This includes the fix in r94797 to reflect the new dependency of Sema on
Analysis.

llvm-svn: 94806
2010-01-29 10:03:42 +00:00
Zhongxing Xu 0fcbe369aa Fix linking problem on Linux.
llvm-svn: 94797
2010-01-29 03:25:47 +00:00
Ted Kremenek d6b8708643 Split libAnalysis into two libraries: libAnalysis and libChecker.
(1) libAnalysis is a generic analysis library that can be used by
    Sema.  It defines the CFG, basic dataflow analysis primitives, and
    inexpensive flow-sensitive analyses (e.g. LiveVariables).

(2) libChecker contains the guts of the static analyzer, incuding the
    path-sensitive analysis engine and domain-specific checks.

Now any clients that want to use the frontend to build their own tools
don't need to link in the entire static analyzer.

This change exposes various obvious cleanups that can be made to the
layout of files and headers in libChecker.  More changes pending.  :)

This change also exposed a layering violation between AnalysisContext
and MemRegion.  BlockInvocationContext shouldn't explicitly know about
BlockDataRegions.  For now I've removed the BlockDataRegion* from
BlockInvocationContext (removing context-sensitivity; although this
wasn't used yet).  We need to have a better way to extend
BlockInvocationContext (and any LocationContext) to add
context-sensitivty.

llvm-svn: 94406
2010-01-25 04:41:41 +00:00
Chris Lattner 0bcc858a2b -fno-rtti is now the default.
llvm-svn: 94379
2010-01-24 20:43:31 +00:00
Douglas Gregor fb00d93c98 Make CMake's clang++ installation respect DESTDIR, based on a patch by
Ingmar Vanhassel. Fixes PR6046.

llvm-svn: 93741
2010-01-18 18:27:29 +00:00
Daniel Dunbar e2aa06d4ae Don't build/install clang++ in CLANG_IS_PRODUCTION build mode yet.
llvm-svn: 93732
2010-01-18 17:52:48 +00:00
Daniel Dunbar 4f2bc55d4e cc1: Factor out CompilerInstance::ExecuteAction which has the majority of the
clang -cc1 logic for running an action against a set of options.
 - This should make it easier to build tools that have a clang -cc1 like
   interface, but aren't actually part of clang -cc1.

llvm-svn: 93282
2010-01-13 00:48:06 +00:00
Daniel Dunbar 7d38d4da61 cc1: Lift creation of the FrontendAction higher.
llvm-svn: 93281
2010-01-13 00:47:51 +00:00
Daniel Dunbar b2138e5529 Driver: Use "g++" as generic gcc name when running in C++ mode, for platforms
that lack real tool definitions.

llvm-svn: 92164
2009-12-25 20:21:23 +00:00
Kovarththanan Rajaratnam 55e74a1a6a Remove RewriteBlocks. It has been superseded by RewriteObjC
llvm-svn: 92014
2009-12-23 18:03:34 +00:00
Daniel Dunbar 282c9b9cc1 Fix pretty stack traces.
llvm-svn: 91537
2009-12-16 11:47:38 +00:00
Daniel Dunbar a5a166d01a Add -resource-dir to clang -cc1, this allows the base directory for compiler
resources (e.g., /usr/lib/clang/1.1) to be passed on the command line instead of
computed.

llvm-svn: 91370
2009-12-15 00:06:45 +00:00
Daniel Dunbar d613677ec9 CompilerInvocation: Move builtin-include-path logic out of CompilerInvocation::CreateFromArgs.
llvm-svn: 91237
2009-12-13 03:45:58 +00:00
Jeffrey Yasskin 1615d45daa Un-namespace-qualify llvm_unreachable. It's a macro, so the qualification gave
no extra safety anyway.

llvm-svn: 91207
2009-12-12 05:05:38 +00:00
Daniel Dunbar f72bdf7eed Implement clang -cc1.
- I apologize for the link time horrors, my goal is to kill off clang-cc in fairly short order.

llvm-svn: 91170
2009-12-11 22:20:12 +00:00
Jeffrey Yasskin 567ae47b4a Remove several .c_str() to be forward-compatible with StringRef.
llvm-svn: 90822
2009-12-08 01:46:24 +00:00
Rafael Espindola 73d4637545 Add gcc's -no-canonical-prefixes option to clang.
llvm-svn: 90577
2009-12-04 19:31:58 +00:00
Daniel Dunbar 1c39f3c89d Put CompilerInvocation testing code in clang-cc instead of clang for now, I can't bear to link all of clang into 'clang' yet. :)
- Still triggered by a magic leading -cc1 argument, as before.

llvm-svn: 90114
2009-11-30 07:18:13 +00:00
Daniel Dunbar fcb9caa772 Change CompilerInvocation::CreateFromArgs to report errors using a proper diagnostic engine.
- Clients that care about having the diagnostics output honor the user-controllable diagnostic options can buffer the diagnostics and issue them later.

llvm-svn: 90092
2009-11-29 20:58:50 +00:00
Daniel Dunbar 65ca1c6f02 Change CompilerInvocation::CreateFromArgs to take Argv0 and the address of main (or something in the main executable) so it can find the builtin compiler files.
llvm-svn: 90090
2009-11-29 20:58:32 +00:00
Daniel Dunbar a604639635 Switch CompilerInvocation::CreateFromArgs to take const char** arguments until Driver itself switches to StringRef.
llvm-svn: 89503
2009-11-20 22:47:55 +00:00
Benjamin Kramer df5280df05 Add a workaround to silence a bogus g++-4.4 -pedantic warning.
driver.cpp:211: warning: ISO C++ forbids zero-size array 'argv'

llvm-svn: 89455
2009-11-20 11:49:06 +00:00
Daniel Dunbar 84e8a249fa Fix some default in the option classes, and some CompilerInvocation argification
errors.

llvm-svn: 89388
2009-11-19 20:54:59 +00:00
Douglas Gregor 45959e5556 Try yet again to de-bork CMake Windows build w.r.t. clang++
llvm-svn: 89361
2009-11-19 16:42:34 +00:00
Douglas Gregor c3851cd0d8 Try to fix CMake clang++ creation on Windows
llvm-svn: 89336
2009-11-19 07:59:29 +00:00
Daniel Dunbar 51cd8f085f Sketch some 'clang -cc1' support, for testing parts of CompilerInvocation.
llvm-svn: 89333
2009-11-19 07:37:51 +00:00
Douglas Gregor 564d41fbe4 CMake goop to create clang++ symlink
llvm-svn: 89320
2009-11-19 05:46:45 +00:00
Daniel Dunbar da13faf982 Driver: ArgList doesn't depend on Options.h anymore.
llvm-svn: 89313
2009-11-19 04:25:22 +00:00
Daniel Dunbar b8c4825fed Use TOOLALIAS so that clang++ gets 'built'.
llvm-svn: 89286
2009-11-19 00:21:33 +00:00
Daniel Dunbar 559f7a5c3c Fix unsafe use of StringRef I introduced.
llvm-svn: 86829
2009-11-11 10:10:25 +00:00
Daniel Dunbar f76c9d270a Driver: Run 'clang' in C++ mode based on the name it was invoked by. We match
anything that ends with ++ or ++-FOO (e.g., c++, clang++, clang++-1.1) as being
a "C++ compiler".

This allows easy testing of the C++ compiler by 'ln -s clang clang++', or by 'cp
clang clang++'.

Based on patch by Roman Divacky.

llvm-svn: 86697
2009-11-10 18:47:41 +00:00
Daniel Dunbar 5564ba743f Push "clang-is-production" logic up to tools/driver, and make it hittable by
defining the CLANG_IS_PRODUCTION Makefile variable.

llvm-svn: 82583
2009-09-22 22:31:13 +00:00
Douglas Gregor 33870d908f CMake: Improve installation of Clang
- Install clang-cc into libexec
  - Install headers into lib/clang/<version>/include
  - Don't install other clang-based tools (clang-wpa, clang-index, etc.)

llvm-svn: 79827
2009-08-23 05:28:29 +00:00
Daniel Dunbar c3ccd180e7 Fix indentation / trailing white space.
llvm-svn: 76200
2009-07-17 18:10:27 +00:00
Daniel Dunbar 54091b82b5 [llvm up] Add support for '#' component of QA_OVERRIDE_GCC3_OPTIONS.
- This silences the output about how command line arguments are being changed.

llvm-svn: 76107
2009-07-16 21:32:51 +00:00
Daniel Dunbar 38bfda6ab5 Driver: Move Compilation::Execute to Driver::ExecuteCompilation.
- The Compilation is just a helper class, it shouldn't have that amount of
   logic in it.

 - No functionality change.

llvm-svn: 74634
2009-07-01 20:03:04 +00:00
Douglas Gregor b4fd5b03c9 Make the clang executable target depend on clang-cc
llvm-svn: 73568
2009-06-16 22:26:26 +00:00
Daniel Dunbar fed44d215e Revert to using &...[0] for std::vector, apparently .data isn't generally
available (and it isn't necessary in this case).

llvm-svn: 72425
2009-05-26 18:00:25 +00:00
Daniel Dunbar 33794edae7 Use .data() vs &...[0]
llvm-svn: 72420
2009-05-26 17:13:50 +00:00
Daniel Dunbar f7323f3f65 The driver/diagnostic client don't need to be on the heap.
llvm-svn: 72418
2009-05-26 16:15:44 +00:00
Daniel Dunbar 3f4a2c286e Support QA_OVERRIDE_GCC3_OPTIONS
- Cover your eyes...

 - This is a simple but effective way to allow developers to build a
   project with clang while manipulating the command line, without
   having to edit the project itself.

llvm-svn: 69342
2009-04-17 01:54:00 +00:00
Daniel Dunbar 8b723e299c Driver: CCC_ADD_ARGS could end up using dangling pointers.
llvm-svn: 68805
2009-04-10 18:32:59 +00:00
Daniel Dunbar 35b0c52add Allow CCC_ADD_ARGS to add empty arguments
llvm-svn: 68235
2009-04-01 19:38:07 +00:00
Daniel Dunbar dae1d347df Support CCC_ADD_ARGS in new driver.
llvm-svn: 68231
2009-04-01 19:08:46 +00:00
Daniel Dunbar d640be24fd (LLVM up) Update to use llvm::sys::getHostTriple().
- Always pass -triple to clang-cc (-arch will be removed).

 - clang-cc doesn't play guess work with the target triple anymore.

llvm-svn: 68119
2009-03-31 17:35:15 +00:00
Mike Stump 90a3707225 Really fix cmake style builds.
llvm-svn: 67633
2009-03-24 17:52:34 +00:00
Daniel Dunbar 36245c5a90 Rename clang-driver to clang.
Again, I tried to update cmake but it is untested.

llvm-svn: 67606
2009-03-24 03:07:05 +00:00
Daniel Dunbar e5a7ecc23a Move <root>/Driver into <root>/tools/clang-cc.
Again, I tried to update cmake but it is untested.

llvm-svn: 67605
2009-03-24 03:00:12 +00:00
Daniel Dunbar 3db73ab7f6 Add CMake files for tools/driver; I am just guessing here, can someone test/fix?
llvm-svn: 67604
2009-03-24 02:52:57 +00:00
Daniel Dunbar 1acb0eb24f Driver: Give Compilation::Execute total control over the Driver result
code; and don't return an error code when -### is present, even if
errors occur.

llvm-svn: 67425
2009-03-21 00:40:53 +00:00
Daniel Dunbar da382a88bf Driver: Get executable path using llvm::sys::Path::GetMainExecutable.
llvm-svn: 67228
2009-03-18 20:25:53 +00:00
Daniel Dunbar d9b80c2af8 Driver: Use custom diag printer to drop dependency on libFrontend and
libLex.

llvm-svn: 67155
2009-03-18 02:11:26 +00:00
Daniel Dunbar 2608c548b5 Driver: Use PrettyStackTrace.
llvm-svn: 67149
2009-03-18 01:38:48 +00:00
Douglas Gregor 23d75bb326 Build system changes to use TableGen to generate the various
diagnostics. This builds on the patch that Sebastian committed and
then revert. Major differences are:

  - We don't remove or use the current ".def" files. Instead, for now,
    we just make sure that we're building the ".inc" files.
  - Fixed CMake makefiles to run TableGen and build the ".inc" files
    when needed. Tested with both the Xcode and Makefile generators
    provided by CMake, so it should be solid.
  - Fixed normal makefiles to handle out-of-source builds that involve
    the ".inc" files.

I'll send a separate patch to the list with Sebastian's changes that
eliminate the use of the .def files.

llvm-svn: 67058
2009-03-16 23:06:59 +00:00
Daniel Dunbar e75d834c7c Driver: Implement majority tool binding logic.
- Still need code for determining proper output location.

 - Doesn't work yet, of course, as the host isn't providing real
   tool chains.

 - Interface still has a few warts, but has gotten a nice bit of
   polish during the rewrite.

llvm-svn: 67038
2009-03-16 06:56:51 +00:00
Daniel Dunbar 3efedddcf9 Driver: Return 0 from BuildCompilation on -ccc-print-phases,
-ccc-print-options.

llvm-svn: 66907
2009-03-13 17:24:34 +00:00
Daniel Dunbar c0b3e95a1a Driver: Use standard Diagnostic interface for diagnostics.
llvm-svn: 66786
2009-03-12 08:55:43 +00:00
Daniel Dunbar 4dff6a4973 Driver: Add host info.
- Replace assorted -ccc-host-* options by -ccc-host-triple which is
   more sane.

llvm-svn: 66600
2009-03-10 23:41:59 +00:00
Daniel Dunbar ee66cf2249 Driver: Handle magic -ccc- options.
- Follows ccc currently, but this functionality should eventually be
   outside the Driver lib.

llvm-svn: 66575
2009-03-10 20:52:46 +00:00
Daniel Dunbar b2cd66bf4d Driver: Sink Driver/Compilation into clang::driver namespace.
- Add OptTable instance to Driver.

llvm-svn: 66063
2009-03-04 20:49:20 +00:00
Daniel Dunbar 5637208a88 Driver: More Option implementation.
- Add Options.def file, collects option information.

 - Actual option instantiation is handled lazily by OptTable to allow
   the driver to not need to instantiate all options.

 - cast<> support for Option, other minor tweaks.

llvm-svn: 66028
2009-03-04 08:33:23 +00:00
Daniel Dunbar b2da933989 Sketch Driver Option classes.
llvm-svn: 65933
2009-03-03 05:55:11 +00:00
Daniel Dunbar 544ecd14b6 Stub out some structure for C++ driver.
llvm-svn: 65867
2009-03-02 19:59:07 +00:00