Commit Graph

418 Commits

Author SHA1 Message Date
Chris Lattner 3fd869cc6c make unknown warnings a warning, not an error.
llvm-svn: 69239
2009-04-15 22:48:58 +00:00
Chris Lattner 7836eefefc add support for -Wextra and -W
llvm-svn: 69236
2009-04-15 22:38:06 +00:00
Chris Lattner 680eb1b893 use tablgen-generated warning groups.
llvm-svn: 69221
2009-04-15 20:58:49 +00:00
Chris Lattner 76732c2fca now that we've decoupled diagnostic classes from default mappings,
move the remaining default mapping exceptions from C++ code into
the .td files.

llvm-svn: 69183
2009-04-15 17:20:11 +00:00
Chris Lattner 5a8c8df08c rename variable in comment, not just in code :).
llvm-svn: 69166
2009-04-15 14:42:02 +00:00
Chris Lattner e007de3b9a Rejigger how -pedantic and -pedantic-errors work and their interaction
with other diagnostic mapping.  In the new scheme, -Wfoo or -Wno-foo or 
-Werror=foo all override the -pedantic options, and __extension__ 
robustly silences all extension diagnostics in their scope.

An added bonus of this change is that MAP_DEFAULT goes away, meaning that
per-diagnostic mapping information can now be stored in 2 bits, doubling
the density of the Diagnostic::DiagMapping array.  This also 
substantially simplifies Diagnostic::getDiagnosticLevel.

OTOH, this temporarily introduces some "macro intensive" code in 
Diagnostic.cpp.  This will be addressed in a later patch.

llvm-svn: 69154
2009-04-15 07:01:18 +00:00
Chris Lattner ce682d9ea5 remove some commented out -Wstrict-selector-match stuff.
llvm-svn: 69148
2009-04-15 04:57:48 +00:00
Chris Lattner 8a1dc20756 clean up error messages.
llvm-svn: 69142
2009-04-15 04:51:48 +00:00
Chris Lattner 384a59cac1 Add support for -Werror=foo and -Wno-error=foo
llvm-svn: 69138
2009-04-15 04:37:12 +00:00
Chris Lattner 4c73b67efb refactor a bunch of the warning parsing stuff to simplify it. This removes the
-Wfoo=ignore syntax.  GCC supports -Wno-foo, no need to invent our own stuff.

llvm-svn: 69136
2009-04-15 04:27:38 +00:00
Douglas Gregor f0b575f79d Add PCH support for ImplicitCastExprs. This is the first expression
kind PCH handles that has an expression as an operand, so most of this
work is in the infrastructure to rebuild expression trees from the
serialized representation. We now store expressions in post-order
(e.g., Reverse Polish Notation), so that we can easily rebuild the
appropriate expression tree.

llvm-svn: 69101
2009-04-14 23:32:43 +00:00
Chris Lattner 184e65d363 Change Lexer::MeasureTokenLength to take a LangOptions reference.
This allows it to accurately measure tokens, so that we get:

t.cpp:8:13: error: unknown type name 'X'
static foo::X  P;
       ~~~~~^

instead of the woefully inferior:

t.cpp:8:13: error: unknown type name 'X'
static foo::X  P;
       ~~~~ ^

Most of this is just plumbing to push the reference around.

llvm-svn: 69099
2009-04-14 23:22:57 +00:00
Chris Lattner b874dbd478 add support for -W[no-]extra-tokens
llvm-svn: 69071
2009-04-14 20:36:01 +00:00
Douglas Gregor 54feb84489 When building a PCH file, don't perform end-of-translation-unit
wrap-up (e.g., turning tentative definitions into definitions). Also,
very that, when we actually use the PCH file, we get the ride code
generation for tentative definitions and definitions that show up in
the PCH file.

llvm-svn: 69043
2009-04-14 16:27:31 +00:00
Daniel Dunbar f5f359fb73 Clean up handling of visibility.
llvm-svn: 69027
2009-04-14 06:00:08 +00:00
Daniel Dunbar a431deb03c Reapply 68936, turned out to that clang's better debug info exposed a
codegenerator bug.

llvm-svn: 68983
2009-04-13 20:46:33 +00:00
Daniel Dunbar f3d0dccfff Revert 68936, LLVM still isn't ready to handle debug info + optimization.
llvm-svn: 68972
2009-04-13 18:03:39 +00:00
Chris Lattner 1050b99f8c the driver caught up. This makes -msse3 correctly set __SSE3__ etc.
llvm-svn: 68943
2009-04-13 06:33:49 +00:00
Devang Patel e8f66b3ed0 Enable debug info generation while optimizing.
llvm-svn: 68936
2009-04-13 04:22:59 +00:00
Chris Lattner cac63f359e Implement support for GCC's -dD mode, which dumps -E output *and*
macro definitions.

llvm-svn: 68884
2009-04-12 01:56:53 +00:00
Chris Lattner 225dd6c830 add some #includes for better compatibility with gcc 4.4,
thanks to Tobias Stadler for pointing this out.

llvm-svn: 68868
2009-04-11 18:40:46 +00:00
Douglas Gregor 92863e475e Compare the predefines buffer in the PCH file with the predefines
buffer generated for the current translation unit. If they are
different, complain and then ignore the PCH file. This effectively
checks for all compilation options that somehow would affect
preprocessor state (-D, -U, -include, the dreaded -imacros, etc.).

When we do accept the PCH file, throw away the contents of the
predefines buffer rather than parsing them, since all of the results
of that parsing are already stored in the PCH file. This eliminates
the ugliness with the redefinition of __builtin_va_list, among other
things.

llvm-svn: 68838
2009-04-10 23:10:45 +00:00
Chris Lattner d959d753bc do a dance with predefines, and finally enable reading of macros from
PCH.  This works now, except for limitations not being able to do things
with identifiers.  The basic example in the testcase works though.

llvm-svn: 68832
2009-04-10 22:13:17 +00:00
Chris Lattner 3c68407868 move a bunch of code for initializing the predefines buffer out of Preprocessor.cpp
into clang-cc.cpp.  This makes it so clang-cc constructs the *entire* predefines 
buffer, not just half of it.  A bonus of this is that we get to kill a copy
of DefineBuiltinMacro.

llvm-svn: 68830
2009-04-10 21:58:23 +00:00
Fariborz Jahanian 40458ec7ef Reject compiles for x86_64 target for MacOS versions which
do not support it.

llvm-svn: 68819
2009-04-10 20:33:45 +00:00
Daniel Dunbar 497ff13243 Support -miphoneos-version-min in clang-cc.
- Patch by Shantonu Sen (with a minor tweak to split out
   getDarwin{OSX,IPhoneOS}Defines)!

 - <rdar://problem/6776277> Need clang-cc/ccc-analyzer support for
   -miphoneos-version-min

llvm-svn: 68815
2009-04-10 19:52:24 +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
Chris Lattner 2199f5b4e5 emit tokens, constify the Preprocessor passed down into PCH writer.
llvm-svn: 68798
2009-04-10 18:08:30 +00:00
Douglas Gregor df47d734c2 Add PCH sources to CMake build files
llvm-svn: 68794
2009-04-10 17:28:42 +00:00
Chris Lattner eeffaef7b9 Arrange for the preprocessor to be passed down into the PCH writer.
llvm-svn: 68790
2009-04-10 17:15:23 +00:00
Douglas Gregor a7f71a91c5 PCH serialization/deserialization of the source manager. With this
improvement, source locations read from the PCH file will properly
resolve to the source files that were used to build the PCH file
itself.

Once we have the preprocessor state stored in the PCH file, source
locations that refer to macro instantiations that occur in the PCH
file should have the appropriate instantiation information.

llvm-svn: 68758
2009-04-10 03:52:48 +00:00
Douglas Gregor ef84c4b434 Implementation of pre-compiled headers (PCH) based on lazy
de-serialization of abstract syntax trees.

PCH support serializes the contents of the abstract syntax tree (AST)
to a bitstream. When the PCH file is read, declarations are serialized
as-needed. For example, a declaration of a variable "x" will be
deserialized only when its VarDecl can be found by a client, e.g.,
based on name lookup for "x" or traversing the entire contents of the
owner of "x".

This commit provides the framework for serialization and (lazy)
deserialization, along with support for variable and typedef
declarations (along with several kinds of types). More
declarations/types, along with important auxiliary structures (source
manager, preprocessor, etc.), will follow.

llvm-svn: 68732
2009-04-09 22:27:44 +00:00
Douglas Gregor bcced4ec31 Propagate the ASTContext to various AST traversal and lookup functions.
No functionality change (really).

llvm-svn: 68726
2009-04-09 21:40:53 +00:00
Daniel Dunbar f67829ac6a Make -include, -imacros paths absolute in Frontend.
- Otherwise paths will be resolved relative to the main input file,
   which is incorrect.

 - I don't know how to make a reasonable test case for this with our
   testing infrastructure.

 - PR3395

llvm-svn: 68665
2009-04-09 00:51:16 +00:00
Chris Lattner 2632dda471 add support for -Wtrigraphs and -Wno-trigraphs.
llvm-svn: 68649
2009-04-08 22:37:15 +00:00
Chris Lattner e01d82b81f finish the implementation of -imacros. The driver still needs to be hooked up.
llvm-svn: 68640
2009-04-08 20:53:24 +00:00
Chris Lattner 94f4248086 According to the GCC man page, all -imacros are included before any -include's.
llvm-svn: 68633
2009-04-08 20:15:42 +00:00
Chris Lattner 21f47dd8ac properly escape filenames when generating implicit #includes, this handles
things like " in paths etc.  Found by inspection.

llvm-svn: 68632
2009-04-08 20:10:57 +00:00
Chris Lattner 14a7f39733 Add initial support for -imacros. Right now it has the same semantics as
-include, but that will be fixed soon.

llvm-svn: 68625
2009-04-08 18:24:34 +00:00
Daniel Dunbar 17ddaa677e More fixes to builtin preprocessor defines.
- Add -static-define option driver can use when __STATIC__ should be
   defined (instead of __DYNAMIC__).

 - Don't set __OPTIMIZE_SIZE__ on Os, __OPTIMIZE_SIZE__ is tied to Oz.

 - Set __NO_INLINE__ following GCC 4.2.

 - Set __GNU_GNU_INLINE__ or __GNU_STDC_INLINE__ following GCC 4.2.

 - Set __EXCEPTIONS for Objective-C NonFragile ABI.

 - Set __STRICT_ANSI__ for standard conforming modes.

 - I added a clang style test case in utils for this, but its not
   particularly portable and I don't think it belongs in the test
   suite.

llvm-svn: 68621
2009-04-08 18:03:55 +00:00
Daniel Dunbar 3b358a3d83 Make debug info work when using -save-temps.
- This is pretty ugly, but the most obvious solution. Chime in if you
   have a nicer one.

 - The problem is that with -save-temps, clang-cc has no idea what the
   name of the original input file is. However, the user expects to be
   able to set breakpoints based on the input file name.

 - We support this by providing a new option -main-file-name (similar
   to -dumpbase used by gcc) which allows the driver to pass in the
   original file name.

 - <rdar://problem/6753383> building with clang using --save-temps
   gets the compile unit name from the .i file...

llvm-svn: 68595
2009-04-08 05:11:16 +00:00
Chris Lattner 4720840d7e fix typo, noticed by Gabor
llvm-svn: 68587
2009-04-08 03:36:03 +00:00
Daniel Dunbar ab7b2f5623 Set __PIC__ (more) correctly.
- Add -pic-level clang-cc option to specify the value for the define,
   updated driver to pass this.

 - Added __pic__

 - Added OBJC_ZEROCOST_EXCEPTIONS define while I was here (to match gcc).

llvm-svn: 68584
2009-04-08 03:03:23 +00:00
Daniel Dunbar c44b4ccca8 Driver: Fix forwarding of -{std,ansi,trigraphs} when there are
multiple instances of an option.

Also, removed direct -ansi support from clang-cc.

llvm-svn: 68558
2009-04-07 22:13:21 +00:00
Daniel Dunbar d18049ab1d Driver: Manually translate a number of -f with no- variants options to
clang.
 - We will eventually want some more driver infrastructre for this
   probably.

 - For now, the clang-cc interface stays relatively the same, but we
   don't accept multiple instances anymore, or the [no-] variants
   directly.

llvm-svn: 68550
2009-04-07 21:16:11 +00:00
Chris Lattner 84d573f256 add a warning for this crazy case, as suggested by Eli.
llvm-svn: 68524
2009-04-07 18:18:09 +00:00
Chris Lattner 0f98a286a3 implement rdar://6762183. I'm not sure if it is more insane that
GCC ignores macro definitions after \n's or that real code depends
on this.

llvm-svn: 68511
2009-04-07 06:02:44 +00:00
Daniel Dunbar f247b30abb Remove a FIXME, the driver handles -O4.
llvm-svn: 68481
2009-04-07 00:38:22 +00:00
Anders Carlsson 65cb90efc1 Define __OPTIMIZE__ and __OPTIMIZE_SIZE__ if the -O[12] and -Os flags are passed to the compiler.
llvm-svn: 68450
2009-04-06 17:37:10 +00:00
Chris Lattner 8887072bce enable -std=c9x and -std=iso9899:199x, patch by Ed Schouten!
llvm-svn: 68449
2009-04-06 17:17:55 +00:00
Zhongxing Xu 01a5beb8cd Apply a patch which adds 'OriginalParmVar' to the DeclContextPrinter by Jon
Simons.

llvm-svn: 68436
2009-04-05 02:04:38 +00:00
Fariborz Jahanian befc9dfbff Implement -fvisibility.
llvm-svn: 68369
2009-04-03 03:28:57 +00:00
Douglas Gregor 97186b07e4 Rename GeneratePCH action to GeneratePTH
llvm-svn: 68348
2009-04-02 23:43:50 +00:00
Douglas Gregor 9c0d38a7a0 Add a new command-line option "-fixit-at=file:line:column" that only
applies fix-its to error messages that occur at that specific location
in the program. 

llvm-svn: 68342
2009-04-02 19:05:20 +00:00
Mike Stump d3e3885f2d Remove -ftrapu.
llvm-svn: 68330
2009-04-02 18:15:54 +00:00
Douglas Gregor a42bd8433d Provide FIX-IT notes to describe what fix-it is doing behind the
scenes, using the underlying diagnostic client to format the
messages.

llvm-svn: 68324
2009-04-02 17:13:00 +00:00
Douglas Gregor 578dae57ca Introduce a "-fixit" mode to clang-cc that applies code-modification hints.
llvm-svn: 68268
2009-04-02 01:08:08 +00:00
Mike Stump 40968598c7 Fixup -ftrapv to be more gcc compatible. -ftrapu (for want of a
better name) is the option that SmallTalk can use to intercept all
overflows, including unsigned.  I added some testcases so we don't
break anything.

Also included is another patch from David for += and friends.

llvm-svn: 68267
2009-04-02 01:03:55 +00:00
Mike Stump 0c61b7322a Add -ftrapv support, patch from David Chisnall; well all except the
clang option code that is and two bug fixes.

llvm-svn: 68240
2009-04-01 20:28:16 +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
Douglas Gregor b4b81d8ab1 Revert r68221, -ftrapv support, which causes several regressions in
Clang's test suite.

llvm-svn: 68230
2009-04-01 18:59:55 +00:00
Mike Stump fbc8c132ba Add -ftrapv support, patch from David Chisnall; well all except the
clang option code that is.

llvm-svn: 68221
2009-04-01 18:19:33 +00:00
Daniel Dunbar 386ef885bb Pull clang-cc code for generating PTH files based on the input type.
- <rdar://problem/6741594> [pth] don't abuse -x to drive pth
   generation

 - Simpler, and fixes PR3915.

Cleanup test cases for PTH:
 - Update to use -emit-pth

 - Removed PTH test of carbon.c and cocoa.mm; these didn't actually
   verify anything, and since PTH is token based the extra coverage
   (over cocoa.m) isn't particularly helpful.

 - Split PTH tests in cocoa.m to cocoa-pth.m, solely to increase
   available parallelism when running tests.

Ted, could you update the PTH test cases (include-pth.c and
cocoa-pth.m) to have some sort of positive check that the PTH is
getting used? "# of PTH cache hits" or "tokens read from PTH cache"
statistics would work great. :)

llvm-svn: 68189
2009-04-01 05:09:09 +00:00
Ted Kremenek 0df7051783 Add '-emit-pth' option to clang-cc as an alternate API for the high-level driver
to generate PTH files. Soon we will remove from clang-cc the GCC-style '-x
c-header' interface for generating PTH files and push this logic to 'clang'.

llvm-svn: 68164
2009-04-01 00:23:28 +00:00
Daniel Dunbar 4cb6715434 Add two FIXMEs
llvm-svn: 68138
2009-03-31 20:10:05 +00:00
Ted Kremenek 7b4df3c3e6 Rename clang.[cpp,h] to clang-cc.[cpp,h] to reflect the name change of the
low-level frontend driver.

llvm-svn: 68131
2009-03-31 18:58:14 +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
Douglas Gregor f1b876d5de Implement -Wmissing-prototypes. Fixes PR3911.
llvm-svn: 68110
2009-03-31 16:35:03 +00:00
Steve Naroff ea9a107ada Add support for -Wdeprecated-declarations.
This fixes <rdar://problem/6712496> Unable to disable deprecated warning.

llvm-svn: 68108
2009-03-31 15:00:11 +00:00
Eli Friedman 1a4029c5df Implement -Wno-pointer-sign.
llvm-svn: 68062
2009-03-30 21:19:48 +00:00
Daniel Dunbar d67a32252c Driver: Support -M and -MM.
- Not particularly elegant, but my hand is forced by gcc.

Also, tweak -ccc-print-bindings output.

llvm-svn: 68027
2009-03-30 06:36:42 +00:00
Daniel Dunbar 52e96cc932 Improve dependency file support.
- Rip out various bits of logic from clang-cc's dependency file gen,
   force driver to provide instead.

 - -MD output now goes to proper location
<rdar://problem/6723948> clang -MD puts dep file in /tmp with wrong name

 - -M and -MM still don't work correctly.

llvm-svn: 68022
2009-03-30 00:34:04 +00:00
Chris Lattner 5bbb3c8ad9 Push DeclGroup much farther throughout the compiler. Now the various
productions (except the already broken ObjC cases like @class X,Y;) in 
the parser that can produce more than one Decl return a DeclGroup instead
of a Decl, etc.

This allows elimination of the Decl::NextDeclarator field, and exposes
various clients that should look at all decls in a group, but which were
only looking at one (such as the dumper, printer, etc).  These have been
fixed.

Still TODO:

1) there are some FIXME's in the code about potentially using
DeclGroup for better location info.
2) ParseObjCAtDirectives should return a DeclGroup due to @class etc.
3) I'm not sure what is going on with StmtIterator.cpp, or if it can
   be radically simplified now.
4) I put a truly horrible hack in ParseTemplate.cpp.

I plan to bring up #3/4 on the mailing list, but don't plan to tackle
#1/2 in the short term.

llvm-svn: 68002
2009-03-29 16:50:03 +00:00
Chris Lattner 83f095cc7e Introduce a new OpaquePtr<N> struct type, which is a simple POD wrapper for a
pointer.  Its purpose in life is to be a glorified void*, but which does not
implicitly convert to void* or other OpaquePtr's with a different UID.

Introduce Action::DeclPtrTy which is a typedef for OpaquePtr<0>.  Change the 
entire parser/sema interface to use DeclPtrTy instead of DeclTy*.  This
makes the C++ compiler enforce that these aren't convertible to other opaque
types.

We should also convert ExprTy, StmtTy, TypeTy, AttrTy, BaseTy, etc,
but I don't plan to do that in the short term.

The one outstanding known problem with this patch is that we lose the 
bitmangling optimization where ActionResult<DeclPtrTy> doesn't know how to
bitmangle the success bit into the low bit of DeclPtrTy.  I will rectify
this with a subsequent patch.

llvm-svn: 67952
2009-03-28 19:18:32 +00:00
Chris Lattner 529efc74ad rename some methods.
llvm-svn: 67923
2009-03-28 06:33:19 +00:00
Chris Lattner c0c3dffa3d reduce indentation, no functionality change.
llvm-svn: 67916
2009-03-28 05:44:17 +00:00
Chris Lattner 1ad4eeb9c7 remove TranslationUnit.
llvm-svn: 67914
2009-03-28 04:31:31 +00:00
Chris Lattner a5adead17b push more ASTContext goodness out through interfaces that use
TranslationUnit

llvm-svn: 67913
2009-03-28 04:27:18 +00:00
Chris Lattner 66918ee148 remove TranslationUnit from ParseAST.
llvm-svn: 67911
2009-03-28 04:13:34 +00:00
Chris Lattner cf16983179 change HandleTranslationUnit to take an ASTContext instead of TranslationUnit
llvm-svn: 67910
2009-03-28 04:11:33 +00:00
Chris Lattner 040d4570c7 remove dead ivar.
llvm-svn: 67907
2009-03-28 04:05:05 +00:00
Chris Lattner edf7eb77cf hoist TranslationUnit some more.
llvm-svn: 67905
2009-03-28 03:56:54 +00:00
Chris Lattner 96c339a661 eliminate some wrappers.
llvm-svn: 67904
2009-03-28 03:53:02 +00:00
Chris Lattner f7d9e2ba1c eliminate ReadASTBitcodeFile
llvm-svn: 67903
2009-03-28 03:49:26 +00:00
Chris Lattner d286851b57 move serialization logic from TranslationUnit to ASTContext.
llvm-svn: 67902
2009-03-28 03:45:20 +00:00
Chris Lattner a0b08dcd6b don't poke at TranslationUnit directly
llvm-svn: 67900
2009-03-28 03:29:40 +00:00
Chris Lattner 5cf49fe587 eliminate ASTConsumer::InitializeTU, all clients are
happy with just ASTContext, they don't need a TU.

llvm-svn: 67894
2009-03-28 02:18:25 +00:00
Chris Lattner 8671ca9d97 revert mike's patch which broke test/CodeGen/no-common.c.
llvm-svn: 67893
2009-03-28 02:12:08 +00:00
Chris Lattner a6f4ca2b6f remove TranslationUnit::OwnsDecls, which is only set, never read.
llvm-svn: 67891
2009-03-28 01:44:40 +00:00
Chris Lattner 84bcc4795e simplify ParseAST by sucking -disable-free handling logic up into
clang.cpp

llvm-svn: 67890
2009-03-28 01:37:17 +00:00
Chris Lattner 2b9e7efccd move StatListener out to top level.
llvm-svn: 67886
2009-03-28 00:55:35 +00:00
Chris Lattner a94d139a1f various cleanups, no functionality change
llvm-svn: 67883
2009-03-28 00:16:20 +00:00
Mike Stump e5fdfd5930 Fixup -fcommon and -fno-common to be more gcc compatible.
llvm-svn: 67863
2009-03-27 20:15:22 +00:00
Chris Lattner 839150e0d2 push line markers through -E mode.
llvm-svn: 67854
2009-03-27 17:13:49 +00:00
Chris Lattner 984fac5f5f most of this is plumbing to get CompileOptions down into
CodeGenModule.  Once there, add a new NoCommon option to
it and implement -fno-common.

llvm-svn: 67735
2009-03-26 05:00:52 +00:00
Douglas Gregor 6c2adff380 Pass access specifiers through to member classes and member enums.
llvm-svn: 67710
2009-03-25 22:00:53 +00:00
Ted Kremenek 7b7b3f0817 Turn on '-analyzer-eagerly-assume' by default in ccc for the static analyzer.
llvm-svn: 67663
2009-03-25 00:32:30 +00:00
Mike Stump 90a3707225 Really fix cmake style builds.
llvm-svn: 67633
2009-03-24 17:52:34 +00:00
Chris Lattner 02428f6aa6 -arch ppc should change the triple to powerpc-foo not to ppc-foo.
Similarly for ppc64.  This should probably move into the driver, along
with all the other target selection stuff other than -triple.

llvm-svn: 67621
2009-03-24 16:18:41 +00:00
Daniel Dunbar 2dbe89af65 Install clang-cc to libexec/clang-cc (instead of bin/clang-cc).
- Updated ccc & driver to look in libexec/ for tools.

llvm-svn: 67607
2009-03-24 04:07:10 +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 a45cf5b6b0 Rename clang to clang-cc.
Tests and drivers updated, still need to shuffle dirs.

llvm-svn: 67602
2009-03-24 02:24:46 +00:00
Daniel Dunbar d5f35ca0bf ccc: Have generic GCC tool chain search the driver directory for
executables (e.g., clang).
 - This matches the clang-driver behavior.

llvm-svn: 67590
2009-03-24 01:06:18 +00:00
Daniel Dunbar b5860facfd ccc/Driver: -r option doesn't take an argument.
llvm-svn: 67581
2009-03-24 00:20:13 +00:00
Daniel Dunbar fefce128c5 ccc: Forward -f[no-]builtin to clang.
llvm-svn: 67517
2009-03-23 14:57:31 +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 ea9f032613 ccc/Driver: .s defaults to 'assembler-with-cpp' on Darwin.
- <rdar://problem/6669441> ccc doesn't handle assembler-with-cpp
   semantics correctly (but clang supports it)

 - This is sad, because it requires a fairly useless target
   hook. C'est la vie.

llvm-svn: 67418
2009-03-20 23:39:23 +00:00
Daniel Dunbar 9b726f88a2 ccc: Use -include-pth.
llvm-svn: 67410
2009-03-20 22:13:54 +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 d72468a61b ccc: Pass --relocation-model as separate arguments (to match Driver).
llvm-svn: 67190
2009-03-18 09:36:19 +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 a493ff47bd Update test.
llvm-svn: 66967
2009-03-13 22:11:42 +00:00
Daniel Dunbar 427d6f1a95 ccc: Handle limited forms of -ccc-host-triple for testing
compatibility with C++ rewrite.

llvm-svn: 66938
2009-03-13 20:33:09 +00:00
Daniel Dunbar 52183091f1 ccc/Driver: Forward -fheinous-gnu-extensions to clang.
llvm-svn: 66915
2009-03-13 18:12:01 +00:00
Daniel Dunbar 7326ad57a4 ccc/Driver: Normalize phase spelling in -ccc-print-phases.
llvm-svn: 66912
2009-03-13 17:52:07 +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 92d19016b5 ccc: Don't print the arch for every action when printing phases.
llvm-svn: 66886
2009-03-13 12:16:31 +00:00
Daniel Dunbar 5a3b818dea ccc/Driver: Forward -fprint-source-range-info to clang.
llvm-svn: 66879
2009-03-13 10:03:45 +00:00
Daniel Dunbar 34c4187152 ccc/Driver: Mark {dump{machine,specs,version},
print-{multi-{directory,lib,os-directory}, search-dirs} as unsupported
instead of handling separately.

llvm-svn: 66848
2009-03-13 00:17:48 +00:00
Daniel Dunbar f336cc279c ccc: Fix broken assertion.
llvm-svn: 66793
2009-03-12 15:59:34 +00:00
Daniel Dunbar 024882184b ccc: Fix -ccc-print-phases when doing a universal build.
llvm-svn: 66792
2009-03-12 15:57:47 +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 6f2650de80 ccc: Tweak some group names.
llvm-svn: 66772
2009-03-12 04:50:20 +00:00
Daniel Dunbar a27669f1d8 ccc: Cleanup arguments a bit; we don't need a separate group for
-fblocks, and there were some duplicate options scattered in.

llvm-svn: 66764
2009-03-12 03:28:55 +00:00
Daniel Dunbar d295bf1d46 ccc: -x assembler-with-cpp was broken for darwin, and it wasn't using
clang as the preprocessor even when it should.

llvm-svn: 66737
2009-03-11 23:07:54 +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 7ea58c355b Forward -ftemplate-depth-<N> to clang's -ftemplate-depth N.
llvm-svn: 66516
2009-03-10 00:35:30 +00:00
Daniel Dunbar 1e6efc0cf4 ccc: Parse -T{bss,data,text}, -iwithsysroot, -specs correctly.
Also, fix some test cases.

llvm-svn: 66425
2009-03-09 17:43:51 +00:00
Daniel Dunbar 13e9eff3f2 Fix thinko. *cough* ofcourseItestedit *cough*
llvm-svn: 66283
2009-03-06 18:35:43 +00:00
Daniel Dunbar 3a45e4fffb Tidy file removal cleanup & remove race condition on file existence.
llvm-svn: 66281
2009-03-06 18:32:01 +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 03f32e7638 ccc: Fix passing of -nozero-initialized-in-bss.
- PR3722.

llvm-svn: 66052
2009-03-04 19:17:10 +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
Ted Kremenek 32a59b2315 Do not automatically run the 'missing -dealloc' check until we have adequate time to make it much smarter (too much noise).
llvm-svn: 65474
2009-02-25 21:08:30 +00:00
Daniel Dunbar cdff38b1f6 ccc: Don't remove result files on error when -save-temps is present.
llvm-svn: 65349
2009-02-23 23:37:18 +00:00
Daniel Dunbar 9e5dfc6111 ccc: Remove unknown host warning, it was breaking gcc's configure.
llvm-svn: 65276
2009-02-22 08:15:14 +00:00
Daniel Dunbar f175ba1d17 ccc: Remove temporary files used in compilation, and remove
compilation results on failures.

llvm-svn: 65254
2009-02-22 01:23:52 +00:00
Daniel Dunbar e8f256c7f9 Unbreak Darwin PIC handling; my refactoring yesterday was bogus.
llvm-svn: 65154
2009-02-20 20:52:47 +00:00
Daniel Dunbar 6ef6a04dd6 Fix test case.
llvm-svn: 65139
2009-02-20 18:53:07 +00:00
Daniel Dunbar ba1c8f5a3c ccc: Spell mattr correctly.
llvm-svn: 65119
2009-02-20 07:47:48 +00:00
Daniel Dunbar e1889f935a ccc: Basic translation of gcc subtarget feature options to LLVM
options (i.e., -mno-red-zone, -msoft-float, -mno-sse, etc.)
 - Also, make sure unwind tables default to on Darwin/x86_64.
 - PR3604.

llvm-svn: 65118
2009-02-20 07:35:04 +00:00