Commit Graph

710 Commits

Author SHA1 Message Date
Daniel Dunbar 2940303363 Move TokenCache option to PreprocessorOptions.
llvm-svn: 86940
2009-11-12 02:53:59 +00:00
Daniel Dunbar 1a54e3fbb9 Switch PTHManager to using diagnostics for most errors.
Also, always give errors on a token-cache PTH failure.

llvm-svn: 86939
2009-11-12 02:53:48 +00:00
Daniel Dunbar 51637a9ba4 Simplify.
llvm-svn: 86938
2009-11-12 02:53:34 +00:00
Daniel Dunbar 1619831fde clang-cc: Refactor ParseInputFollow to clearly split on the two primary cases,
when we are running an AST consumer and when we are just running the
preprocessor or parser alone.

llvm-svn: 86937
2009-11-12 02:53:27 +00:00
Daniel Dunbar 4806f2ea48 clang-cc: Factor ReadPCHFile out of ProcessInputFile.
llvm-svn: 86936
2009-11-12 02:53:20 +00:00
Daniel Dunbar 92641dca86 Simplify.
llvm-svn: 86935
2009-11-12 02:53:13 +00:00
Daniel Dunbar 7336edd8b2 clang-cc: Unify InitializeSourceManager calls.
llvm-svn: 86934
2009-11-12 02:53:06 +00:00
Daniel Dunbar f7316732b8 clang-cc: Move non-Consumer action handling to common location, to expose the massive amount of redundancy we have introduced through blind copy-and-paste.
llvm-svn: 86922
2009-11-12 01:36:27 +00:00
Daniel Dunbar f4408a29e1 Fix PCH/preprocess test to be more useful, and unbreak -E mode with implicit
PCH, which I broke.

llvm-svn: 86921
2009-11-12 01:36:20 +00:00
Daniel Dunbar 39b6e2a0fd Tweak formatting.
llvm-svn: 86907
2009-11-12 00:24:28 +00:00
Daniel Dunbar e6de40e747 Move AnalyzerOptions into CompilerInvocation.
llvm-svn: 86906
2009-11-12 00:24:10 +00:00
John Thompson 92ebab90fe Fix clang executable path for Windows
llvm-svn: 86896
2009-11-11 23:11:14 +00:00
Daniel Dunbar 2856ae444b Always initialize the header search object as part of InitializePreprocessor;
not doing this has little to no utility.

llvm-svn: 86883
2009-11-11 21:44:42 +00:00
Daniel Dunbar 0c6c930f05 Allow Preprocessor to take ownership of the HeaderSearch object. I think it should probably always own the header search object, but I'm not sure...
llvm-svn: 86882
2009-11-11 21:44:21 +00:00
Daniel Dunbar 55b781f85e Sink AttachDependencyFileGen into CreatePreprocessor.
llvm-svn: 86881
2009-11-11 21:44:00 +00:00
Daniel Dunbar 89d1fdff65 Add DependencyOutputOptions to wrap -M... options, and propogate to
CompilerInvocation and clang-cc.

llvm-svn: 86880
2009-11-11 21:43:12 +00:00
Daniel Dunbar f580187aed Simplify.
llvm-svn: 86830
2009-11-11 10:22:48 +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 22bdabf05f Add PreprocessorOutputOptions to CompilerInvocation, and move initialization to
clang-cc/Options.cpp

llvm-svn: 86828
2009-11-11 10:07:44 +00:00
Daniel Dunbar 531f6c662b Add PreprocessorOutputOptions, for things like -dM, -C, -CC which control -E
mode.

llvm-svn: 86827
2009-11-11 10:07:22 +00:00
Daniel Dunbar 979586e755 Simplifiy target feature handling by coalescing all the logic into
InitializeCompileOptions.

llvm-svn: 86826
2009-11-11 09:38:56 +00:00
Daniel Dunbar eced7e065f Minor formatting tweaks.
llvm-svn: 86825
2009-11-11 09:38:42 +00:00
Daniel Dunbar 759cab9a54 clang-cc: Refactor some -fixit-at handling.
llvm-svn: 86824
2009-11-11 09:38:35 +00:00
Daniel Dunbar d0c3bb0df2 Allow TextDiagnosticPrinter to have optional ownership of its output stream.
llvm-svn: 86823
2009-11-11 09:38:24 +00:00
Daniel Dunbar d2cfa0111c clang-cc: Move InitializeAnalyzerOptions into Options.cpp
llvm-svn: 86821
2009-11-11 08:13:55 +00:00
Daniel Dunbar ef0147c0e9 clang-cc: Start coalescing "frontend" options.
llvm-svn: 86820
2009-11-11 08:13:47 +00:00
Daniel Dunbar dcd40fb95f clang-cc: Move InitializeDiagnosticOptions to Options.cpp
llvm-svn: 86819
2009-11-11 08:13:40 +00:00
Daniel Dunbar f527a12e47 clang-cc: Move HeaderSearchOptions to Options.cpp
llvm-svn: 86818
2009-11-11 08:13:32 +00:00
Daniel Dunbar b6bac22d02 Turn LoggingDiagnosticClient into a more general ChainedDiagnosticClient and
move to libFrontend.

llvm-svn: 86817
2009-11-11 08:13:24 +00:00
Daniel Dunbar 84dfbfde26 clang-cc: Move InitializeLangOptions to Options.cpp.
Also, inline InitializeLanguageStandard into InitializeLangOptions; this code
needs to be refactored but the current division doesn't make any sense.

llvm-svn: 86816
2009-11-11 07:26:12 +00:00
Daniel Dunbar f0f6f0efb0 Inline some trivial functions.
llvm-svn: 86815
2009-11-11 07:26:02 +00:00
Daniel Dunbar 999215c8c8 clang-cc: Move InitializePreprocessorOptions to Options.cpp
llvm-svn: 86811
2009-11-11 06:10:03 +00:00
Daniel Dunbar de142beafb clang-cc: Simplify this code, now that predefines handling is uniform in the
PCH/-E and PCH/not--E cases.

llvm-svn: 86808
2009-11-11 05:33:31 +00:00
Daniel Dunbar 000c4ffd16 Redo how PCH handles its implicit include. Instead of treating this specially in
the front-end (as far as the preprocessor goes), follow the usual logic of
inserting the (original include path) name into the predefines buffer. This
pushes the responsibility for handling this to PCH instead of the front-end.  In
PCH this requires being a little more clever when we diff the predefines
buffers.

Neither of these solutions are particularly great, I think what we eventually
should do is something like gcc where we insert a special marker to indicate the
PCH file, but then run the preprocessor as usual. This would be clearer and
would allow us to drop the overly clever predefines handling.

llvm-svn: 86806
2009-11-11 05:29:04 +00:00
Daniel Dunbar 3618834da8 Recognize -fsyntax-only as a "consumer only" action.
llvm-svn: 86776
2009-11-11 00:54:56 +00:00
Daniel Dunbar 93097b3906 Add Diagnostic::Report method for reporting diagnostics without a location.
llvm-svn: 86760
2009-11-10 23:55:23 +00:00
Daniel Dunbar de02f63945 PreprocessorOptions: Get rid of unnecessary 'isPTH' flag for include entries.
llvm-svn: 86757
2009-11-10 23:53:43 +00:00
Daniel Dunbar 47ea8628a5 Decouple more of clang-cc by moving ImplicitP[CT]H options into
PreprocessorOptions.

Global variables used as [in] [out] parameters considered harmful.

llvm-svn: 86728
2009-11-10 22:09:38 +00:00
Ted Kremenek 4a720a363c Update CMake file.
llvm-svn: 86721
2009-11-10 21:38:41 +00:00
Dan Gohman ad5ef3d70f Use #include <stdio.h> when using fprintf and stderr.
llvm-svn: 86717
2009-11-10 21:21:27 +00:00
Daniel Dunbar f89a32ac45 clang-cc: Start moving "pure" option handling to Options.cpp, to separate it
from the logic part of clang-cc, and to enforce limited scoping.

llvm-svn: 86711
2009-11-10 19:51:53 +00:00
Daniel Dunbar d96cd43f13 clang-cc: Sink more options inside codegenopts namespace.
llvm-svn: 86710
2009-11-10 19:51:46 +00:00
Daniel Dunbar a35a2cb56b Change LangOpts initialization to directly test the code generation options,
instead of reproducing their logic.

llvm-svn: 86709
2009-11-10 19:51:33 +00:00
Ted Kremenek ba64574c9a CIndex: Only display diagnostics to llvm::errs() when the client has set the 'displayDiagnostics' option to 1 in clang_createIndex(). This fixes <rdar://problem/7370691>.
llvm-svn: 86700
2009-11-10 19:18:52 +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 ef2919f1fa Factor out parts of InitializeCompileOptions that depend on the LangOptions.
llvm-svn: 86696
2009-11-10 18:47:35 +00:00
Daniel Dunbar be50f5ab9d Localize -disable-llvm-optzns handling to BackendConsumer::CreatePasses.
- This is conceptually better since the only thing we want this option to do is
   preserve the internal module as constructed by IRgen, before running any
   passes.

 - This also fixes bugs in -disable-llvm-optzns handling with regards to debug
   info.

llvm-svn: 86691
2009-11-10 17:50:53 +00:00
Daniel Dunbar ede182ef05 clang-cc: Start sinking (CodeGen) options into namespaces to limit their scope.
llvm-svn: 86690
2009-11-10 17:50:42 +00:00
Daniel Dunbar 68ac06142b Cleanup some clang-cc FIXMEs
llvm-svn: 86686
2009-11-10 16:23:44 +00:00
Daniel Dunbar 754c11ec48 Add CompileOptions to CompilerInvocation.
llvm-svn: 86685
2009-11-10 16:19:45 +00:00