Граф коммитов

1007 Коммитов

Автор SHA1 Сообщение Дата
Ted Kremenek 9298cfc747 Have clang_getCursorSource() return NULL when the source location is invalid or refers to a built-in buffer. Implements <rdar://problem/7296243>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89044 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-17 05:31:58 +00:00
Daniel Dunbar 223ebe399b Move InitializeAnalyzerOptions for consistency.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89040 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-17 05:05:08 +00:00
Daniel Dunbar 962b8b4e33 Remove unused NoPreprocess variable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89039 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-17 05:04:57 +00:00
Daniel Dunbar 1b483e70ad Remove unused IsCXXAware and IgnoreSysRoots option from HeaderSearchOptions::Entry.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89035 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-17 05:04:15 +00:00
Daniel Dunbar 9119e7e0a4 Trim includes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88982 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16 22:38:48 +00:00
Daniel Dunbar c363cb1929 Store more information in HeaderSearchOptions so that its initialization is not
language dependent.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88981 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16 22:38:40 +00:00
Daniel Dunbar 6143ea28a9 clang-cc: Eliminate cyclic dependency in initializing CodeGenOptions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88980 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16 22:38:14 +00:00
Daniel Dunbar d58c03f42e Add TargetOptions and use it when constructing targets.
- This ended up being hard to factor, sorry for the large diff.

 - Some post-commit cleanup to come.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88833 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-15 06:48:46 +00:00
Daniel Dunbar 297b0833ad Add examples dir, built with BUILD_EXAMPLES=1 (Makefiles, no CMake equivalent yet).
Move tools/wpa to examples/wpa, and unbreak its build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88825 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-15 00:22:33 +00:00
Daniel Dunbar d10c5b8833 Add pluggable action support to clang-cc, via -plugin command line option.
- Expects the plugin has been loaded with -load.

 - Using this may require disabling TOOL_NO_EXPORTS in the clang-cc Makefile, this breaks the llvm::Registry way of working (static constructors are bad, kids). This should be replaced with a "real" plugin model that has explicit plugin interfaces.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88824 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-15 00:12:04 +00:00
Daniel Dunbar 9a8a83b8fe Move the program action enum to FrontendOptions.
--
ddunbar@giles:clang-cc (master)$ grep llvm:🆑:opt clang-cc.cpp  # Woot
ddunbar@giles:clang-cc (master)$
--

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88820 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-14 22:32:38 +00:00
Daniel Dunbar 4fdba99ccc clang-cc: Switch to using FrontendAction. Whee.
Please report any discrepancies you see in clang-cc, I'm not confident that our regression tests cover all the fun ways one can use clang-cc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88776 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-14 10:53:49 +00:00
Daniel Dunbar ccb6cb6fd9 Add CompilerInstance::InitializeSourceManager.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88764 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-14 07:53:04 +00:00
Daniel Dunbar 79b55f97c8 Turn -fixit it back into a mode, but make -fixit-at imply that mode this time
(instead of running it with arbitrary consumers).
 - Also, turn any -fixit-at lookup failure into an error.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88757 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-14 04:39:29 +00:00
Daniel Dunbar f79dced038 Switch -verify implementation to use VerifyDiagnosticClient.
- Not tested, but -verify with multiple inputs should work now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88750 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-14 03:24:39 +00:00
Daniel Dunbar 7d90199f10 Pass Preprocessor through DiagnosticClient::BeginSourceFile.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88744 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-14 02:48:04 +00:00
Ted Kremenek 8382cf57b7 Add clang-cc option "--analyzer-experimental-internal-checks". This
option enables new "internal" checks that will eventually be turned on
by default but still require broader testing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88671 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-13 18:46:29 +00:00
Daniel Dunbar f482d59386 Add CompilerInstance utility functions for creating output files.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88667 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-13 18:32:08 +00:00
Daniel Dunbar a920483163 Add output file list to CompilerInstance, so that it can track them instead of
forcing all clients to do it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87103 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-13 10:37:48 +00:00
Daniel Dunbar 84c639a1a8 clang-cc: Move output file initialization closer to use.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87102 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-13 10:18:59 +00:00
Daniel Dunbar 3d0dab330b Simplify, in anticipation of introducing explicit action instances.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87101 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-13 09:57:06 +00:00
Daniel Dunbar c2f484f1f0 Add CodeCompletion consumer to CompilerInvocation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87100 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-13 09:36:05 +00:00
Daniel Dunbar 3a2838d142 Rework Sema code completion interface.
- Provide Sema in callbacks, instead of requiring it in constructor. This
   eliminates the need for a factory function. Clients now just pass the object
   to consume the results in directly.

 - CodeCompleteConsumer is cheap to construct, so building it whenever we are
   doing code completion is reasonable.

Doug, please review.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87099 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-13 08:58:20 +00:00
Daniel Dunbar 0f800391ff Add CompilerInstance::createPCHExternalASTSource.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87097 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-13 08:21:10 +00:00
Daniel Dunbar 704e48ae75 Add CompilerInstance::has* methods for testing if the instance has a particular
subobject.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87096 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-13 08:20:57 +00:00
Daniel Dunbar 5eb810024d Add ASTContext to CompilerInstance.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87095 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-13 08:20:47 +00:00
Daniel Dunbar 0fbb3d9a9c Add CompilerInstance::createDiagnostics, and move clang-cc to it.
clang-cc.cpp is now under 1k lines, if anyone is counting.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87090 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-13 05:52:34 +00:00
Daniel Dunbar f819b25bbf Add a FIXME.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87089 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-13 05:52:19 +00:00
Daniel Dunbar 22dacfacac Add Preprocessor to CompilerInstance, and move clang-cc CreatePreprocessor to
CompilerInstance::createPreprocessor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87088 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-13 05:52:11 +00:00
Daniel Dunbar 444be7366d Wherein the TargetInfo argument to Preprocessor is made 'const' and propogated.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87087 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-13 05:51:54 +00:00
Daniel Dunbar 16b7449d86 Add {File,Source}Manager to CompilerInstance.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87079 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-13 04:12:06 +00:00
Daniel Dunbar 2a79e162a3 Add CompilerInstance, and starting moving clang-cc to it.
- The design philosophy is in the CompilerInstance doxyment, if you don't agree
   with it now would be a good time to speak up.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87078 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-13 03:51:44 +00:00
Daniel Dunbar fbe2fafe31 Move input kind identification (-x) into FrontendOptions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87066 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-13 02:06:12 +00:00
Ted Kremenek eb94113be0 Add clang-cc option "-analyzer-experimental-checks" to enable experimental path-sensitive checks. The idea is to separate "barely working" or "skunkworks" checks from ones that should always run. Later we need more fine-grain checker control.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87053 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-13 01:15:47 +00:00
Daniel Dunbar 21dac5e24a Move -target-{triple,abi} options into FrontendOptions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87051 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-13 01:02:19 +00:00
Daniel Dunbar 914474ca51 Move code completion options to clang-cc
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87050 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-13 01:02:10 +00:00
Daniel Dunbar c86804bc9c Move FixItAtLocations into FrontendOptions
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87046 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 23:52:56 +00:00
Daniel Dunbar 1417c74b82 clang-cc: Keep Verbose option with HeaderSearchOptions, for now.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87045 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 23:52:46 +00:00
Daniel Dunbar 26266885d6 Add FrontendOptions, and starting moving clang-cc to it.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87044 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 23:52:32 +00:00
Chandler Carruth 2811ccf48d Move CompileOptions -> CodeGenOptions, and sink it into the CodeGen library.
This resolves the layering violation where CodeGen depended on Frontend.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86998 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 17:24:48 +00:00
Daniel Dunbar e0c4ff2fce Disallow FIX-ITs when generating code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86990 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 15:42:53 +00:00
Daniel Dunbar aa57614b89 clang-cc: Coalesce frontend options further.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86988 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 15:23:20 +00:00
Daniel Dunbar 6907943901 Move warning options into DiagnosticOptions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86968 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 07:28:44 +00:00
Daniel Dunbar 11e729d295 Move dump-build-information option into DiagnosticOptions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86966 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 07:28:21 +00:00
Daniel Dunbar 00e5b8d451 clang-cc: Factor CreateDiagnosticEngine out of main.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86963 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 06:48:31 +00:00
Daniel Dunbar bfbeadba36 clang-cc: -fixit is actually option, not an action, although its use with non
-fsyntax-only is probably untested.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86962 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 06:48:24 +00:00
Daniel Dunbar 32358e24af Simplify.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86961 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 06:48:17 +00:00
Daniel Dunbar b3cb98ee35 Move TokenCache option to PreprocessorOptions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86940 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 02:53:59 +00:00
Daniel Dunbar 3574f46cf4 Switch PTHManager to using diagnostics for most errors.
Also, always give errors on a token-cache PTH failure.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86939 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 02:53:48 +00:00
Daniel Dunbar c67a5f9038 Simplify.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86938 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 02:53:34 +00:00
Daniel Dunbar d1e7a964c6 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86937 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 02:53:27 +00:00
Daniel Dunbar 975790e8f8 clang-cc: Factor ReadPCHFile out of ProcessInputFile.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86936 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 02:53:20 +00:00
Daniel Dunbar 6606864161 Simplify.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86935 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 02:53:13 +00:00
Daniel Dunbar b4373b235d clang-cc: Unify InitializeSourceManager calls.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86934 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 02:53:06 +00:00
Daniel Dunbar 8e1bcb0ad3 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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86922 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 01:36:27 +00:00
Daniel Dunbar 1ea52949b2 Fix PCH/preprocess test to be more useful, and unbreak -E mode with implicit
PCH, which I broke.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86921 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 01:36:20 +00:00
Daniel Dunbar c8daaa4513 Tweak formatting.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86907 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 00:24:28 +00:00
Daniel Dunbar 5746f1ff62 Move AnalyzerOptions into CompilerInvocation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86906 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 00:24:10 +00:00
John Thompson 6a6742a8fc Fix clang executable path for Windows
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86896 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 23:11:14 +00:00
Daniel Dunbar 961c76ea8d Always initialize the header search object as part of InitializePreprocessor;
not doing this has little to no utility.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86883 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 21:44:42 +00:00
Daniel Dunbar 5814e657c9 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...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86882 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 21:44:21 +00:00
Daniel Dunbar ca11f61233 Sink AttachDependencyFileGen into CreatePreprocessor.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86881 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 21:44:00 +00:00
Daniel Dunbar 0e0bae8139 Add DependencyOutputOptions to wrap -M... options, and propogate to
CompilerInvocation and clang-cc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86880 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 21:43:12 +00:00
Daniel Dunbar 387ecbd1e6 Simplify.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86830 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 10:22:48 +00:00
Daniel Dunbar e26bd90e5f Fix unsafe use of StringRef I introduced.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86829 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 10:10:25 +00:00
Daniel Dunbar 29cf746aef Add PreprocessorOutputOptions to CompilerInvocation, and move initialization to
clang-cc/Options.cpp

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86828 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 10:07:44 +00:00
Daniel Dunbar 775bee71ad Add PreprocessorOutputOptions, for things like -dM, -C, -CC which control -E
mode.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86827 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 10:07:22 +00:00
Daniel Dunbar 29a790ba42 Simplifiy target feature handling by coalescing all the logic into
InitializeCompileOptions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86826 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 09:38:56 +00:00
Daniel Dunbar dc8bbac2f8 Minor formatting tweaks.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86825 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 09:38:42 +00:00
Daniel Dunbar bd9f04b68b clang-cc: Refactor some -fixit-at handling.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86824 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 09:38:35 +00:00
Daniel Dunbar aea364195b Allow TextDiagnosticPrinter to have optional ownership of its output stream.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86823 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 09:38:24 +00:00
Daniel Dunbar 339c13460e clang-cc: Move InitializeAnalyzerOptions into Options.cpp
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86821 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 08:13:55 +00:00
Daniel Dunbar d1cdcf38ca clang-cc: Start coalescing "frontend" options.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86820 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 08:13:47 +00:00
Daniel Dunbar 0db4b765d7 clang-cc: Move InitializeDiagnosticOptions to Options.cpp
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86819 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 08:13:40 +00:00
Daniel Dunbar f797329454 clang-cc: Move HeaderSearchOptions to Options.cpp
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86818 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 08:13:32 +00:00
Daniel Dunbar dbf75feeb6 Turn LoggingDiagnosticClient into a more general ChainedDiagnosticClient and
move to libFrontend.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86817 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 08:13:24 +00:00
Daniel Dunbar 56749087b5 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86816 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 07:26:12 +00:00
Daniel Dunbar d9beeaf1f1 Inline some trivial functions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86815 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 07:26:02 +00:00
Daniel Dunbar b52d243d36 clang-cc: Move InitializePreprocessorOptions to Options.cpp
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86811 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 06:10:03 +00:00
Daniel Dunbar d8daaa7450 clang-cc: Simplify this code, now that predefines handling is uniform in the
PCH/-E and PCH/not--E cases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86808 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 05:33:31 +00:00
Daniel Dunbar 7b5a1210d9 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86806 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 05:29:04 +00:00
Daniel Dunbar 5ee0aa715d Recognize -fsyntax-only as a "consumer only" action.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86776 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 00:54:56 +00:00
Daniel Dunbar 0f9fed70ce Add Diagnostic::Report method for reporting diagnostics without a location.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86760 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 23:55:23 +00:00
Daniel Dunbar b6d1cc84d1 PreprocessorOptions: Get rid of unnecessary 'isPTH' flag for include entries.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86757 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 23:53:43 +00:00
Daniel Dunbar e0a9581d60 Decouple more of clang-cc by moving ImplicitP[CT]H options into
PreprocessorOptions.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86728 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 22:09:38 +00:00
Ted Kremenek 7976f5923c Update CMake file.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86721 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 21:38:41 +00:00
Dan Gohman 0063e98f59 Use #include <stdio.h> when using fprintf and stderr.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86717 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 21:21:27 +00:00
Daniel Dunbar 0498cfc445 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86711 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 19:51:53 +00:00
Daniel Dunbar 9773429c26 clang-cc: Sink more options inside codegenopts namespace.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86710 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 19:51:46 +00:00
Daniel Dunbar e359445fd7 Change LangOpts initialization to directly test the code generation options,
instead of reproducing their logic.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86709 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 19:51:33 +00:00
Ted Kremenek 0854d70dab 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>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86700 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 19:18:52 +00:00
Daniel Dunbar 8fa01c8f98 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86697 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 18:47:41 +00:00
Daniel Dunbar fcb0c3b39b Factor out parts of InitializeCompileOptions that depend on the LangOptions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86696 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 18:47:35 +00:00
Daniel Dunbar 8d35314401 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86691 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 17:50:53 +00:00
Daniel Dunbar bc2ea3406b clang-cc: Start sinking (CodeGen) options into namespaces to limit their scope.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86690 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 17:50:42 +00:00
Daniel Dunbar 9af869510b Cleanup some clang-cc FIXMEs
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86686 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 16:23:44 +00:00
Daniel Dunbar 36f4ec353b Add CompileOptions to CompilerInvocation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86685 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 16:19:45 +00:00
Daniel Dunbar 89f8c1d40e Simplify, following MemoryBuffer::getSTDIN API fix.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86633 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 00:46:25 +00:00
Daniel Dunbar 9253e49492 Remove some if-0'd code, we can resurrect this if we ever decide to support
continuing after invalid PCH loads.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86631 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 00:46:12 +00:00
Daniel Dunbar 5fc7d344ae Add PreprocessorOptions to CompilerInvocation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86623 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-09 23:12:31 +00:00
Daniel Dunbar 2cdafa8001 Privatize InitHeaderSearch, this functionality is only exposed via
ApplyHeaderSearchOptions now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86617 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-09 23:02:47 +00:00
Daniel Dunbar 26a0cac165 Move LangOptions, HeaderSearchOptions, and the target feature map into
CompilerInvocation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86612 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-09 22:46:17 +00:00
Daniel Dunbar 638c901ae3 Switch Target* to Target&.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86611 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-09 22:46:09 +00:00
Daniel Dunbar 227b2380f6 Change clang-cc to expect that all inputs have the same language (so we can only construct a single LangInfo). This matches how it is used in practice (since the compiler only it invokes it for one file at a time).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86609 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-09 22:45:57 +00:00
Daniel Dunbar 094a84cc06 (llvm up) Convert clang-cc.cpp:GetLanguage to StringSwitch.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86608 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-09 22:45:47 +00:00
Douglas Gregor ff4393c1ce Make sure that we look into nested, transparent declaration contexts
when looking for a name within a given DeclContext. Now enumerators
will show up in code-completion results.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86591 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-09 21:35:27 +00:00
Daniel Dunbar e29709f32e Add CompilerInvocation object, to capture all the options one needs to invoke
the compiler, and start flood filling it into clang-cc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86586 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-09 20:55:08 +00:00
Benjamin Kramer 62cf322cf1 Factor CXString creation into a helper method.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86577 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-09 19:13:48 +00:00
Benjamin Kramer 858e5de143 Writing to a struct passed by value is pointless. Remove dead code.
- free(NULL) is a nop anyway.
- if someone thinks calling clang_disposeString twice should be legal
  please change the method to take a pointer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86568 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-09 18:24:53 +00:00
Douglas Gregor 88d23952ea Improve c-index-test's parsing of the -code-completion-at=file:line:column argument
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86566 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-09 18:19:57 +00:00
Steve Naroff ef0cef6cec Introduce CXString type and associated functions clang_getCString() and clang_disposeString().
This abstraction will help us manage string memory for complex names that cross the C++/C boundary (e.g. ObjC methods, selectors). This patch also uses it in clang_getTranslationUnitSpelling (which I'm not sure is necessary). Will investigate later...since the extra malloc() can't hurt (for now).

Patch by John Thompson.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86562 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-09 17:45:52 +00:00
Douglas Gregor d5a2089663 C doesn't allow mixing declarations and statements, silly
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86556 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-09 17:05:28 +00:00
Douglas Gregor 3ac738567f Minor cleanup for CIndex-based code-completion:
- Provide an actual test for code-completion via CIndex. 
  - Actually print optional strings in c-index-test
  - Export clang_getCompletionChunkCompletionString from CIndex



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86550 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-09 16:04:45 +00:00
Daniel Dunbar 4ee17acbf7 Revert unintentional change to this file.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86455 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-08 09:46:33 +00:00
Daniel Dunbar c6190330e7 Move a function which returns a class outside of extern C scope.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86439 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-08 04:13:53 +00:00
Daniel Dunbar 4dc99f8928 CIndex: Add temporary hack to leak memory instead of returning invalid pointers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86438 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-08 04:11:32 +00:00
Daniel Dunbar f8297f1512 Fix some build warnings.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86393 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-07 18:34:24 +00:00
Daniel Dunbar 597e7c380d Add some missing libraries for CMake as well.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86390 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-07 17:53:40 +00:00
Daniel Dunbar 286bf95a86 Add some missing libraries.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86389 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-07 17:52:11 +00:00
Daniel Dunbar dd35ce9a78 Switch clang-cc to use ApplyHeaderSearchOptions, and fix a thinko.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86341 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-07 04:58:12 +00:00
Daniel Dunbar e166582f8f Lift InitHeaderSearch::AddEnvVarPaths logic higher.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86337 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-07 04:20:39 +00:00
Daniel Dunbar 8863b985f1 Rename PreprocessorInitOptions to PreprocessorOptions for consistency, and fix
filenames.

Also, move InitializePreprocessor to Utils.h.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86335 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-07 04:20:15 +00:00
Daniel Dunbar 750156aec2 Lift compiler builtin include path logic higher.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86334 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-07 04:19:57 +00:00
Douglas Gregor 0c8296dfb4 Various improvements to Clang's code-completion infrastructure:
- Introduce more code-completion string "chunk" kinds that describe
  symbols, the actual text that the user is expected to type, etc.
  - Make the generation of macro results optional, since it can be
  slow
  - Make code-completion accessible through the C API, marshalling the
  code-completion results through a temporary file (ick) to maintain
  process separation.

The last doesn't have tests yet.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86306 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-07 00:00:49 +00:00
John Thompson 40d1bb6383 Eliminate tabls
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86183 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-05 22:03:02 +00:00
John Thompson a6fda124bf Adding -fshort-wchar option.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86167 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-05 20:14:16 +00:00
Daniel Dunbar efcbe94753 Replace DiagnosticClient::setLangOptions with {Begin,End}SourceFile, and clarify
invariants (diagnostics with source informations must occur between
{Begin,End}SourceFile).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86113 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-05 02:42:12 +00:00
Daniel Dunbar efceabd238 Convert CreateAnalysisConsumer and friends to just take a const Preprocessor&, and simplify.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86112 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-05 02:41:58 +00:00
Daniel Dunbar ad451ccdbf Remove clang-cc -html-diags option, this doesn't fit in well and we get plenty
of coverage of this from the analyzer.

If this bothers you, I can add it back in a mode where non-source diagnostics go
to stderr and only source diagnostics use -html-diags, but I don't think anyone
uses this.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86109 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-05 02:11:37 +00:00
Daniel Dunbar 4cc1a25932 Simplify.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86104 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-05 01:53:23 +00:00
Daniel Dunbar 64acf1dd2f CreatePreprocessor cannot fail
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86103 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-05 01:53:12 +00:00
Daniel Dunbar 90b1827c1c Kill PreprocessorFactory, which was both morally repugnant and totally unused.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86076 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-04 23:56:25 +00:00
Daniel Dunbar 593c41fb0b Turn if chain into switch.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86071 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-04 23:41:40 +00:00
Daniel Dunbar 938963f076 InitializePreprocessor cannot fail.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86048 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-04 21:13:15 +00:00
Daniel Dunbar 468fe24619 Move -undef flag into PreprocessorInitOptions
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86047 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-04 21:13:02 +00:00
Daniel Dunbar 838be483dc Move -fcolor-diagnostics logic to driver.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86014 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-04 06:24:57 +00:00
Daniel Dunbar 55efe142a8 Move logic for selection -fmessage-length= to driver.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86013 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-04 06:24:47 +00:00
Daniel Dunbar eace874303 Factor out a diagnostic options class.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86010 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-04 06:24:30 +00:00
Tanya Lattner 59876c2713 Merge constant array and structures. This will create a global variables for arrays and structs that are constant and their initializer is constant. It is on by default but can be disable with the flag -fno-merge-all-constants.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85991 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-04 01:18:09 +00:00
Chris Lattner e6113de52d Implement support for the -undef command line option, patch by
Roman Divacky! PR5363


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85932 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-03 19:50:27 +00:00
Daniel Dunbar 1184191ac0 Sort export list.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85832 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-02 22:23:08 +00:00
Daniel Dunbar 7c15e71fb2 Remove clang-cc code for handling -mmacosx-version-min and
-miphoneos-version-min.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85601 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-30 18:12:31 +00:00
Steve Naroff 0d69b8cc8e - Add/tweak some comments.
- change ObjCCategoryImplDecl::getCategoryClass() to getCategoryDecl().

No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85528 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-29 21:11:04 +00:00
Daniel Dunbar 8cb6562f7b Move some clang-cc errors to use diagnostics, and simplify.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85527 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-29 21:05:18 +00:00
Steve Naroff f9f6196e9f clang_getDeclSpelling(): For category implementations, make sure we hand back the category name (not the class name). This fixes <rdar://problem/7297518>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85521 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-29 18:55:50 +00:00
Daniel Dunbar 607d7f6d8f Reject -I- in driver instead of clang-cc.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85469 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-29 01:53:44 +00:00
Daniel Dunbar bea5a84ea6 Formatting fixes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85468 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-29 01:53:18 +00:00
Steve Naroff f96b524306 Remove _clang_initCXLookupHint() and _clang_getCursorWithHint(). Related to <rdar://problem/7310688>.
Localize the optimization to ResolveLocationInAST(). The last valid AST location is now stored with ASTUnit. There still isn't optimal, however it's an improvement (with a much cleaner API). Having the client manage an "hint" is error prone and complex.

I wanted to land the major changes before finishing up the optimizations. 


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85425 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 20:44:47 +00:00
Zhongxing Xu f20288c916 make CallGraph more flexible by letting it accept ASTContext instead of ASTUnit.
Patch by Simone Pellegrini.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85386 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 12:23:03 +00:00
Steve Naroff 8814503469 Add support for 'CXFile' (<rdar://problem/7303360>).
- 4 new functions (clang_getCursorSourceFile, clang_getDeclSourceFile, clang_getFileName, clang_getFileTime).

- Should remove clang_getDeclSource() and clang_getCursorSource(). For now, just put 'deprecate' comment in header. 

- Also changed CXX style comment to C style (to eliminate warning).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85238 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-27 14:35:18 +00:00
John Thompson 2e06fc877a Changes for building as a Windows DLL
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85234 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-27 13:42:56 +00:00
Ted Kremenek feb15e3f39 Unify Unix and Windows code paths when executing 'clang'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85163 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-26 22:14:08 +00:00
Ted Kremenek 779e5f487d Remove unnecessary calls to 'flush()'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85162 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-26 22:08:39 +00:00
Daniel Dunbar 09bdd599c1 clang-cc: Allow building for x86_64 with -mmacosx-version-min=10.4.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85132 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-26 17:52:49 +00:00
Rafael Espindola 8d737cc78c Rename -nostdclanginc to -nobuiltininc.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85116 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-26 13:36:57 +00:00
Fariborz Jahanian cab9882dac Fixes a warning.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84909 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-22 22:49:47 +00:00
Ted Kremenek 8ee1f3fc0d Always emit error diagnostics when an error occurs within clang_createTranslationUnit() and clang_createTranslationUnitFromSource(). These kind of errors are ones that shouldn't be missed.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84904 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-22 22:19:00 +00:00
Ted Kremenek fbcb2b716b Split clang_getCursor() into clang_getCursor() and clang_getCursorWithHint().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84873 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-22 17:22:53 +00:00
Ted Kremenek 379afec20c Add some explanatory diagnostics when clang_createTranslationUnitFromSource fails.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84825 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-22 03:24:01 +00:00
Ted Kremenek 139ba86a36 Enhance 'clang_createTranslationUnitFromSourceFile()' in two ways:
(1) Allow the source file to be specified in the actual command line arguments by allowing the
    caller to set 'source_filename' to NULL.

(2) Automatically strip off the arguments '-emit-ast', '-fsyntax-only', and '-c'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84802 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-22 00:03:57 +00:00
Steve Naroff 6a6de8b4fc Extend clang_getCursor() to take a 'relativeDecl' argument (so speed up searching). Without a 'relativeDecl', the algorithm is n-squared. For example, running the following command on 'Large.m' takes hours without a 'relatvieDecl'.
snaroff% time ../../Debug/bin/c-index-test Large.ast all > Large.out
snaroff% cat Large.m
#import <Cocoa/Cocoa.h>
#import <QuickTime/QuickTime.h>
#import <OpenGL/OpenGL.h>

With a 'relativeDecl', it takes <30 seconds:-)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84760 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-21 13:56:23 +00:00
Steve Naroff e56b4baeba - Extend clang_createIndex() to support PCH and diagnostic 'filtering'. This seems cleaner to me without sacrificing much flexibility.
- Remove clang_wantOnlyLocalDeclarations().

- Remove 'displayDiagnostics' arguments to clang_createTranslationUnitFromSourceFile() and clang_createTranslationUnit().

- Have clang_createTranslationUnitFromSourceFile() strip the '-o <outfile>' command line arguments if they exist. Document this semantic in the header. Also verify we have a valid ASTUnit before telling it to 'unlinkTemporaryFile()'.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84634 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-20 14:46:24 +00:00
Ted Kremenek c46e463f13 Fix inverted preprocessor guard, and fix the resulting compiler error that was unmasked.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84555 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 22:27:32 +00:00
Ted Kremenek 1374598619 Really fix <rdar://problem/7312058> by adding a 'displayDiagnostics' option to
clang_createTranslationUnit() and clang_createTranslationUnitFromSourceFile(). The user can now
specify if the diagnostics from Clang are printed to stderr or are silenced completely. We can
obviously evolve this API to be more general in the future.

Note: Added a FIXME since I wasn't certain what was the best way to redirect to something analogous
to '/dev/null' on Windows.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84548 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 22:15:09 +00:00
Ted Kremenek fc0622155f The constructor for ASTUnit now takes a DiagnosticClient*, allowing uses of ASTUnit to specify
alternate DiagnosticClients. To match this API, ASTUnit::LoadFromPCHFile() now takes a corresponding
DiagnosticClient* argument as well. The DiagnosticClient object is destroyed when the ASTUnit object
is destroyed.

The CIndex library now uses this API to create a 'IgnoreDiagnosticsClient' that simply silences
diagnostics when using the clang_createTranslationUnitFromSourceFile() function. This fixes
<rdar://problem/7312058>. This API can change in the future as we add more flexibility for clients.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84539 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 21:44:57 +00:00
Ted Kremenek 49358d85d7 Re-order includes so that the logic involving '#ifdef LLVM_ON_WIN32' appears after the main #includes. The ultimate solution is to just use LLVM-portable methods in llvm/System.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84534 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 21:17:25 +00:00
Steve Naroff 36c4464ba6 Move Diagnostic/DiagClient/FileManager from Indexer => ASTUnit.
Removing this shared data should enable clang_createTranslationUnit/clang_createTranslationUnitFromSourceFile to be run from multiple threads (related to <rdar://problem/7303432>).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84499 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 14:34:22 +00:00
Steve Naroff bade7de59d Change indenting for case/compound statements to conform to the rest of clang.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84498 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 13:41:39 +00:00
Benjamin Kramer c5a9e9511e CIndex: make variable non-static to avoid potential race conditions, per
Daniel's comment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84484 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 10:20:24 +00:00
Daniel Dunbar e013d685c6 Move clients to use IdentifierInfo::getNameStart() instead of getName()
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84436 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-18 20:26:12 +00:00
Benjamin Kramer 63444b3a54 Try to unbreak MSVC build.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84433 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-18 19:59:44 +00:00
Benjamin Kramer b14346b95e CIndex: fix typo.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84422 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-18 16:52:07 +00:00
Benjamin Kramer edcd8286f2 Missed a paren.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84421 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-18 16:20:58 +00:00
Benjamin Kramer 20d758132f CIndex: add a (untested) WIN32 codepath to get ClangPath.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84420 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-18 16:13:48 +00:00
Benjamin Kramer 5e4bc590b0 CIndex: compute ClangPath lazily.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84419 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-18 16:11:04 +00:00
Benjamin Kramer 0829a839b0 CIndex: replace fork/exec with our portable ExecuteAndWait wrapper.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84414 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-18 11:19:36 +00:00
Benjamin Kramer 9670762c0d CIndex: avoid a dangling pointer issue.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84413 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-18 11:10:55 +00:00
Daniel Dunbar a47dd19171 Attempt to unbreak the MSVC build.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84381 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-17 23:53:11 +00:00
Daniel Dunbar 8b88ca68e2 Simplify (move guard to caller instead of callee).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84325 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-17 09:04:56 +00:00
Ted Kremenek 85f5468d87 Fix compiler warning: "ISO C90 forbids mixed declarations and code"
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84318 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-17 06:42:15 +00:00
Ted Kremenek 8ce88a449c Fix warning: 'warning: C++ style comments are not allowed in ISO C90'
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84317 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-17 06:37:16 +00:00
Ted Kremenek dff76894ff Resolve FIXME: delete the 'Program' object in the destructor of CIndexer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84313 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-17 06:21:47 +00:00
Ted Kremenek 5cf48766d6 Add 'UseBumpPtrAllocator' flag to ASTUnit::LoadFromPCHFile() to cause the created ASTContext to use
its own BumpPtrAllocator to allocate ASTs.

Change clang_createTranslationUnit (CIndex) to pass 'UseBumpPtrAllocator = true' to
ASTUnit::LoadFromPCHFile().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84296 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-17 00:34:24 +00:00
Douglas Gregor 02465750c8 Make CIndex and c-index-test a little bit more robust. The only
substantive change is that clang_getCursorSource() now returns the
file in which a macro was instantiated when the cursor points into a
macro instantiation, rather than crashing.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84275 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-16 21:24:31 +00:00
Douglas Gregor 7d1d49d297 Keep track of whether declararions were loaded from a precompiled
header or not via a new "PCHLevel" field in Decl. We currently use
this information to help CIndex filter out declarations that came from
a precompiled header (rather than from an AST file). Further down the
road, it can be used to help implement multi-level precompiled
headers.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84267 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-16 20:01:17 +00:00
Ted Kremenek 74cd0694f9 Use an std::vector<> instead of an array of ARG_MAX size, as ARG_MAX may not be defined everywhere.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84220 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-15 23:21:22 +00:00
Steve Naroff e19944c939 Make sure temporary files get unlinked.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84208 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-15 22:23:48 +00:00
Ted Kremenek 8c4195eefb Add missing #include for wait().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84207 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-15 22:10:56 +00:00
Steve Naroff 37b5ac2909 Minor improvement to format...no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84203 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-15 20:50:09 +00:00
Steve Naroff 5b7d8e254f Implement <rdar://problem/7303432> [Clang/Index] In-memory-style AST generation API (initial API implementation).
Added clang_createTranslationUnitFromSourceFile().
Changed clang_createIndex() to lookup the location of clang (using dladdr).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84198 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-15 20:04:39 +00:00
Mike Stump 43d8176d2e Set up include paths for VC++ and Cygwin headers, along with the
existing MinGW headers, plus the newer 4.4.0 version.  Patch by John
Thompson.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83594 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-08 23:29:47 +00:00
Douglas Gregor 9a3dcf2234 Make sure that c-index-test links as a C++ executable
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83335 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-05 22:29:42 +00:00
Douglas Gregor 2588830b88 Make sure that libCIndex links as a C++ library
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83331 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-05 22:25:29 +00:00
Eric Christopher f393c3b770 Fix C90 compile warning about mixed declarations and code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83327 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-05 21:33:42 +00:00
Steve Naroff f9adf8f930 - Fix assert in clang_getCursorDecl (having to do with recently added ObjC_ProtocolRef).
- Make sure CHECK: lines in test case match the expected output. 


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83316 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-05 17:58:19 +00:00
Rafael Espindola 1bb15a9afa Add a -nostdclanginc flag to clang-cc that prevents it from searching
its own binary-relative headers. Useful when using clang's preprocessor
with gcc.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83302 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-05 13:12:17 +00:00
Steve Naroff 85e2db7213 Add support for class and protocol references.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83186 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-01 00:31:07 +00:00
Argyrios Kyrtzidis 05a7651c7a When pointing at a type decl reference, ASTLocation is a NamedDeclRef.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83099 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-29 19:45:58 +00:00
Argyrios Kyrtzidis f4526e3fd4 Modify ASTLocation and apart from being a Decl or Stmt, allow it to also be:
-A NamedDecl reference
-A TypeLoc

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83095 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-29 19:44:27 +00:00
Douglas Gregor 214904e358 Set GNUMode only for the "gnu" language standard options, from Ken Dyck!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83064 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-29 14:42:43 +00:00
Daniel Dunbar 1cf13cdc2c Disable c-index-test on MSVC until someone figures out the real problem.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82830 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-26 01:21:38 +00:00
Steve Naroff 7416524283 Fix cut/paste error resulting in bad column info.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82810 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-25 22:15:54 +00:00
Steve Naroff ee9405e807 Add clang_getDeclSource().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82807 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-25 21:45:39 +00:00
Steve Naroff 699a07d8a0 Add clang_getDeclLine and clang_getDeclColumn
Fix clang_getCursorDecl to do the right thing for expr refs
Fixup test file to accommodate new output (which includes the line/column for the referenced decl)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82798 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-25 21:32:34 +00:00
Douglas Gregor ac47bc76fe CMake build support for libCIndex and c-index-test. The indexing tests
are now running properly from within CMake.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82755 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-25 06:35:15 +00:00
Douglas Gregor 9773f6065b Hide clang-wpa executable behind a CMake variable so it won't be built by default
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82751 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-25 05:41:21 +00:00
Steve Naroff ff9e18cb38 Add test for C-based indexing API, using FileCheck utility.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82706 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-24 20:03:06 +00:00
Chris Lattner e7a5fd4a29 wpa is an experiment, don't build it by default, it adds to build times due to everything it links in.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82704 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-24 19:45:12 +00:00
Anders Carlsson 78762ebb9a Add a -dump-record-layouts argument to clang-cc.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82703 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-24 18:54:49 +00:00
Steve Naroff f7469a38ca Some minor cleanups...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82646 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-23 20:00:53 +00:00
Steve Naroff 4ade6d6eae More work to enable more exhaustive testing of the indexing API.
Next step: Add actual some test cases:-)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82636 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-23 17:52:52 +00:00
Daniel Dunbar f44c585632 Push "clang-is-production" logic up to tools/driver, and make it hittable by
defining the CLANG_IS_PRODUCTION Makefile variable.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82583 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-22 22:31:13 +00:00
Douglas Gregor b657f115c3 Replace the -code-completion-dump option with
-code-completion-at=filename:line:column

which performs code completion at the specified location by truncating
the file at that position and enabling code completion. This approach
makes it possible to run multiple tests from a single test file, and
gives a more natural command-line interface.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82571 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-22 21:11:38 +00:00
Steve Naroff fb5704295c - Implement support for various types of "refs" (initially to help test clang_getCursor()).
- Add missing prototypes for dispose functions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82564 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-22 19:25:29 +00:00
Daniel Dunbar d172bf3927 This FIXME is done.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82509 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-22 02:17:27 +00:00
Fariborz Jahanian b924259cc5 Removed -fobjc-newgc-api option. clang now conforms to
gcc-style write-barrier api only.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82493 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-21 23:03:37 +00:00
Daniel Dunbar a674bf437e Switch ProcessASTInputFile to still use ParseAST.
- Currently this requires us to fake an input file.

 - This allows Sema to be keep all the logic for how to pull decls out of the external AST source and how to handle things like tentative definitions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82432 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-21 03:03:56 +00:00
Daniel Dunbar 31b87d8006 Change ASTUnit to take the Diagnostic as an argument, the client should have control of this.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82430 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-21 03:03:39 +00:00
Daniel Dunbar a39075952c Add Diagnostic to Indexer, and have it keep its own FileManager instead of taking an external reference (which was leaked in the case of the CIndex library).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82429 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-21 03:03:22 +00:00
Chris Lattner 59b2172751 switch command line 'parse' methods to use StringRef for efficiency, which
is also required for an llvm-side change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82344 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-20 00:39:15 +00:00
Douglas Gregor 81b747b7fc Initial implementation of a code-completion interface in Clang. In
essence, code completion is triggered by a magic "code completion"
token produced by the lexer [*], which the parser recognizes at
certain points in the grammar. The parser then calls into the Action
object with the appropriate CodeCompletionXXX action.

Sema implements the CodeCompletionXXX callbacks by performing minimal
translation, then forwarding them to a CodeCompletionConsumer
subclass, which uses the results of semantic analysis to provide
code-completion results. At present, only a single, "printing" code
completion consumer is available, for regression testing and
debugging. However, the design is meant to permit other
code-completion consumers.

This initial commit contains two code-completion actions: one for
member access, e.g., "x." or "p->", and one for
nested-name-specifiers, e.g., "std::". More code-completion actions
will follow, along with improved gathering of code-completion results
for the various contexts.

[*] In the current -code-completion-dump testing/debugging mode, the
file is truncated at the completion point and EOF is translated into
"code completion".


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82166 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-17 21:32:03 +00:00
Steve Naroff 2bd6b9f298 Add clang_disposeTranslationUnit() and clang_disposeIndex().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82154 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-17 18:33:27 +00:00
Daniel Dunbar aca2ebdf41 Initial support for code generation from .ast files.
- Doesn't actually work yet because only module level asm's get correctly marked as externally visible in the PCH.

 - Other things like 'clang-cc foo.ast -ast-dump' now work, as well.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82107 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-17 00:48:13 +00:00
Daniel Dunbar 0794d8d50f clang-cc: Factor out code for creating one of the standard AST consumer actions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82106 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-17 00:48:00 +00:00
Daniel Dunbar 13fdf28968 Simplify.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82104 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-17 00:47:46 +00:00
Daniel Dunbar 9f43534277 clang-cc: Remove -ObjC -ObjC++ handling from clang-cc.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82103 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-17 00:47:27 +00:00
Fariborz Jahanian b123ea395e Starting patch to generate more specific API for objc's
GC. Currently, new API will be generated under
clang-cc's -fobjc-newgc-api flag which will eventually
become the default. WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82082 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-16 21:37:16 +00:00
Mike Stump 3cbf5a0548 Be sure to use the correct version instead of the wrong one.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81925 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-15 21:49:22 +00:00
Steve Naroff 77128ddd30 - clang_getCursor(): Replace asserts with error codes (CXCursor_InvalidFile, CXCursor_NoDeclFound).
- Add predicate clang_isInvalid().
- Implement clang_getCursorFromDecl().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81908 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-15 20:25:34 +00:00
Daniel Dunbar 73b79596ba Add -target-abi clang-cc option, currently unused.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81731 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-14 00:02:12 +00:00
Chris Lattner 2f60af7dd4 rewrite the parsing code for -miphoneos-version-min and
-mmacosx-version-min to work on llvm::Triple.  Simplify
it to use x-'0' to parse single digit integer strings.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81646 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-12 22:45:58 +00:00
Steve Naroff 8b26cbd4e4 Make sure ObjCInterfaceDecl's that are forward declared always contain a valid location.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81487 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-11 00:12:01 +00:00
Fariborz Jahanian d9a1db3a4d Non fragile ABI for GNU runtime. Patch bu David Chisnall.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81462 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-10 21:48:21 +00:00
Mike Stump 1eb4433ac4 Remove tabs, and whitespace cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81346 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-09 15:08:12 +00:00
Daniel Dunbar 2e30e594dd Use llvm::sys::getHostTriple, not LLVM_HOSTTRIPLE.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81013 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-04 17:43:10 +00:00
Steve Naroff 9efa767be8 Implement accessors clang_getCursorKind(), clang_getCursorDecl().
Implement clang_getCursor() - wired up to Argiris's work.
Implement callbacks for CXCursor_ObjCProtocolRef.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81004 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-04 15:44:05 +00:00
Steve Naroff 77accc11f0 Add ASTUnit::getOriginalSourceFileName() and use in clang_getTranslationUnitSpelling().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80932 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 18:19:54 +00:00
Steve Naroff af08ddc8f1 - Add back some harmless code that part of a reverted commit (r80859). I'll investigate the lifetime snafu (with ASTUnit) separately.
- Traverse category methods, add a "class ref" and make the little test harness a bit more flexible.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80921 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 15:49:00 +00:00
Daniel Dunbar bce6f62ae7 Revert "Visit function/method bodies and issue callback for parameters and local
variables.", this is breaking x86_64-apple-darwin10 and Linux tests.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80896 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 05:59:50 +00:00
Daniel Dunbar 5345c391c6 Add basic support for -pthread.
- Patch by David Chisnall, with PCH and Darwin support mixed in.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80883 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 04:54:28 +00:00
Daniel Dunbar 4d861516e5 Tweak comment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80882 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 04:54:12 +00:00
Steve Naroff 23d8bea705 Visit function/method bodies and issue callback for parameters and local variables.
Add clang_getTranslationUnitSpelling().



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80859 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 00:32:06 +00:00
Daniel Dunbar d6970811dc Initialize targets before parsing command line options, so --version shows registered targets.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80849 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-02 23:20:15 +00:00
Eli Friedman 10c2d319a8 Fix warnings.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80833 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-02 20:07:26 +00:00
Steve Naroff 1164d859c7 Fix some newly added bugs uncovered by the RELEASE build.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80813 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-02 18:58:52 +00:00
Steve Naroff f334b4e3ed Start issuing callback for references (add some predicates, refactor some code).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80810 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-02 18:26:48 +00:00
Steve Naroff c857ea4d22 Flesh out CXCursorKind...
- More declaration types (distinguish between struct/union/class, instance/class methods).
- Add definition types (class, category, function, instance/class method, etc.).

Add client data to clang_loadDeclaration() and implement.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80787 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-02 13:28:54 +00:00
Steve Naroff 2b8ee6c299 Add explicit "blind" client data to callback function (since we aren't using blocks).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80673 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 15:55:40 +00:00
David Chisnall 8a5a9aaddb Updated GNU runtime non-fragile ABI.
Added -fconstant-string-class= option.
Added __has_feature() test for non-fragile ABI.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80591 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 16:41:57 +00:00
Steve Naroff 2d4d629d8a Implement source/line/column hooks.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80585 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 14:26:51 +00:00
Steve Naroff 89922f86f4 More fleshing out the C-based indexing API (under construction).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80529 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 00:59:03 +00:00
Benjamin Kramer d01a0bc444 gcc 4.4 needs cstdio for printf. Reorder includes while at it.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80430 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-29 12:56:35 +00:00
Ted Kremenek 80088a96bd Add CIndex dependencies: libLLVMC and libclangSema (for IdentifierResolver).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80385 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-28 18:33:53 +00:00
Ted Kremenek 2349672887 Tweak CIndex file to resolve to linking issues with the clang libraries. In
particular, clangFrontend was not being linked in.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80384 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-28 18:29:48 +00:00
Daniel Dunbar 1eb79b58e5 Hide IdxVisitor and remove unimplemented method (causing link errors on x86_64
linux builder).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80376 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-28 16:30:07 +00:00
Steve Naroff 50398199fb Lot's of little changes to get the C-based indexing API going...
Work in progress.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80367 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-28 15:28:48 +00:00
Steve Naroff 7e8f8189d0 Add CX prefix to Cursor and move a comment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80359 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-28 12:07:44 +00:00
Ted Kremenek f710789aa7 Update exports list.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80306 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 23:50:46 +00:00
Steve Naroff 600866cc7d Fill in Index.h header file and add stubs to implementation file.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80279 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 19:51:58 +00:00
Ted Kremenek d2fa56687f Add initial boilerplate for CIndex, a shared library that will vend high-level
source symbol information (harvested by Clang) through a C API.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80166 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-26 22:36:44 +00:00
Eli Friedman ab24c8dfb4 Since the HexFloats option only controls a warning, it shouldn't depend
on whether we're in GNUMode.  Adjust the code appropriately.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80132 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-26 20:15:14 +00:00
Dan Gohman b044c473a1 Update clang for raw_fd_ostream no longer requiring F_Force.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79991 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-25 15:36:09 +00:00
Chris Lattner 0fa0daafdf prune #includes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79889 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-24 04:11:30 +00:00
Chris Lattner d57a7ef925 API changes to match llvm ToT.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79868 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-23 22:45:33 +00:00
Douglas Gregor 7f7b74888e 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.)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79827 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-23 05:28:29 +00:00
Chris Lattner 92bcc27ada adjust for raw_fd_ostream api change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79809 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-23 02:59:41 +00:00
Anders Carlsson 92f5822df6 Add a -fno-elide-constructors option to clang-cc.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79782 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-22 22:30:33 +00:00
Daniel Dunbar 8165ced072 Don't install wpa or index-test tools.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79557 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-20 18:45:52 +00:00
Nate Begeman 2ef13e5abe Take 2 on AltiVec-style vector initializers.
Fixes PR4704 problems

Addresses Eli's patch feedback re: ugly cast code

Updates all postfix operators to remove ParenListExprs.  While this is awful,
no better solution (say, in the parser) is obvious to me.  Better solutions
welcome.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78621 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-10 23:49:36 +00:00
Chris Lattner 797c3c4f5d fix a couple of problems with section attributes:
1. Passing something that isn't a string used to cause:
   "argument to annotate attribute was not a string literal"
  make it say "section attribute" instead.

2. Fix the location of the above message to point to the
   bad argument instead of the section token.

3. Implement rdar://4341926, by diagnosing invalid section
   specifiers in the frontend rather than letting them slip all
   the way to the assembler (a QoI win).

An example of #3 is that we used to produce something like this:

/var/folders/n7/n7Yno9ihEm894640nJdSQU+++TI/-Tmp-//ccFPFGtT.s:2:Expected comma after segment-name
/var/folders/n7/n7Yno9ihEm894640nJdSQU+++TI/-Tmp-//ccFPFGtT.s:2:Rest of line ignored. 1st junk character valued 46 (.).

Daniel improved clang to use llvm_report_error, so now we got:

$ clang t.c -c
fatal error: error in backend: Global variable 'x' has an invalid section specifier 'sadf': mach-o section specifier
      requires a segment and section separated by a comma.

with no loc info.  Now we get:

$ clang t.c -fsyntax-only
t.c:4:30: error: argument to 'section' attribute is not valid for this target: mach-o section specifier requires a segment
      and section separated by a comma
int x __attribute__((section("sadf")));
                             ^

which is nice :)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78586 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-10 19:03:04 +00:00
Daniel Dunbar 70121ebd65 Use LLVM's new error handler API to report back end errors using Diagnostic.
For example,
--
ddunbar@giles:Frontend$ clang -c backend-errors.c
fatal error: error in backend: Global variable 'a' has an invalid section specifier
      'I AM, not, legal': mach-o section specifier uses an unknown section type.
--
compare to:
--
ddunbar@giles:Frontend$ gcc -c backend-errors.c
/var/folders/DQ/DQ8GT3++HESEzT1obWBynE+++TI/-Tmp-//cc45w2pq.s:2:Expected comma after segment-name
/var/folders/DQ/DQ8GT3++HESEzT1obWBynE+++TI/-Tmp-//cc45w2pq.s:2:Rest of line ignored. 1st junk character valued 77 (M).
--

Yay!

I am not tied to my wording choice, we could also go with "uncoverable error"
for the prefix, or just leave it off entirely.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78554 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-10 03:40:28 +00:00
Daniel Dunbar 1df5109f47 Revert r78535, it is causing a number of failures to build projects.
--- Reverse-merging r78535 into '.':
D    test/Sema/altivec-init.c
U    include/clang/Basic/DiagnosticSemaKinds.td
U    include/clang/AST/Expr.h
U    include/clang/AST/StmtNodes.def
U    include/clang/Parse/Parser.h
U    include/clang/Parse/Action.h
U    tools/clang-cc/clang-cc.cpp
U    lib/Frontend/PrintParserCallbacks.cpp
U    lib/CodeGen/CGExprScalar.cpp
U    lib/Sema/SemaInit.cpp
U    lib/Sema/Sema.h
U    lib/Sema/SemaExpr.cpp
U    lib/Sema/SemaTemplateInstantiateExpr.cpp
U    lib/AST/StmtProfile.cpp
U    lib/AST/Expr.cpp
U    lib/AST/StmtPrinter.cpp
U    lib/Parse/ParseExpr.cpp
U    lib/Parse/ParseExprCXX.cpp


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78551 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-10 03:01:36 +00:00
Nate Begeman 25b4fdb9d6 AltiVec-style vector initializer syntax, vec4 a = (vec4)(a, b, c, d);
In addition to being defined by the AltiVec PIM, this is also the vector
initializer syntax used by OpenCL, so that vector literals are compatible
with macro arguments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78535 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-09 17:55:44 +00:00
Benjamin Kramer 21fde994b2 Remove duplicated colon.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77891 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 12:12:11 +00:00
Mike Stump 738f8c278d Add beginnigs of rtti generation, wire up more of -fno-exceptions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77751 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 23:15:31 +00:00
Argyrios Kyrtzidis 19b732a546 Add support for ObjC message expressions, in the Analyzer:
-Accept an ObjC method and find all message expressions that this method may respond to.
-Accept an ObjC message expression and find all methods that may respond to it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77551 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-30 00:03:55 +00:00
Argyrios Kyrtzidis 87bcb504f6 Support ObjC methods as Entities.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77547 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29 23:41:46 +00:00
Argyrios Kyrtzidis 0f3984809f Add TranslationUnit::getSelectorMap().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77542 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29 23:41:08 +00:00
Argyrios Kyrtzidis 7f4656eb6b -Introduce the idx::Analyzer class used for getting indexing information, like finding
references of a declaration across translation units.

-Modify the index-test tool to use it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77536 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29 23:40:14 +00:00
Argyrios Kyrtzidis 768a6c94a5 Add getDeclReferenceMap() to the abstract interface of TranslationUnit class.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77530 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29 23:39:18 +00:00
Argyrios Kyrtzidis 0594545b5b Remove the TranslationUnit usage from clang-wpa.cpp since it's not really
necessary.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77529 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29 23:39:09 +00:00
Argyrios Kyrtzidis 94431b5b4c Introduce a helper template for the Handler classes and use it instead
of the iterator of the Indexer class.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77528 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29 23:39:03 +00:00
Argyrios Kyrtzidis b17dc46c79 -Make IndexProvider an abstract interface for getting indexing information.
-Introduce Indexer as an IndexProvider implementation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77524 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29 23:38:21 +00:00
Daniel Dunbar 70186ab134 Destroy the ASTConsumer prior to the Context, HTMLPrinter for example wants to
do a significant amount of work in its destructor, which may access the
context. (PR4642).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77423 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29 02:40:09 +00:00
Zhongxing Xu 56a5d80877 Add two nodes to the call graph:
- Root is the main function or 0.
 - ExternalCallingNode has edges to all external functions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76876 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-23 13:39:38 +00:00
Argyrios Kyrtzidis f7cf15ca3c Change the semantics for Entity.
Entity can now refer to declarations that are not visible outside the translation unit.
It is a wrapper of a pointer union, it's either a Decl* for declarations that don't
"cross" translation units, or an EntityImpl* which is associated with the specific "visible" Decl.

Included is a test case for handling fields across translation units.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76515 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 00:07:06 +00:00
Argyrios Kyrtzidis ec930d3d81 Add '\n' to the end of error message.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76506 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 00:05:10 +00:00
Argyrios Kyrtzidis dc50c64c13 Introduce ASTLocation::getReferencedDecl(), for getting the declaration that the ASTLocation references.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76336 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-18 21:17:58 +00:00
Argyrios Kyrtzidis 1e4bc09988 Introduce a redecl_iterator in Decl class, so that we can do a "iterate over all declarations of the same decl" without knowing the exact type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76298 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-18 08:50:35 +00:00
Daniel Dunbar 237a31bf66 Fix indentation / trailing white space.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76200 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-17 18:10:27 +00:00
Daniel Dunbar e3d6023cbf [llvm up] Add support for '#' component of QA_OVERRIDE_GCC3_OPTIONS.
- This silences the output about how command line arguments are being changed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76107 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-16 21:32:51 +00:00
Ted Kremenek 0d9ff0bcba Add 'clang-wpa' to the CMake-based build.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76091 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-16 18:10:20 +00:00
Daniel Dunbar 9797a8760b Unbreak build?
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75887 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-16 02:02:48 +00:00
Zhongxing Xu c5965992f5 update makefile.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75878 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-16 01:05:34 +00:00
Zhongxing Xu 22daf79314 add copyright comments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75877 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-16 01:03:49 +00:00
Zhongxing Xu dc3240c5b7 Add a primitive clang whole primitive analyzer tool.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75874 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-16 01:00:25 +00:00
Owen Anderson d720046f18 Update for LLVM API change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75869 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-16 00:14:12 +00:00
Dan Gohman 92db284169 Update for raw_fd_ostream API changes. raw_fd_ostream now has a
Force flag to control whether the case of opening an existing
file is considered an error.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75802 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-15 17:32:18 +00:00
Argyrios Kyrtzidis c7377632d0 Handle redeclarations properly at the index-test tool.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75605 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-14 03:20:31 +00:00
Argyrios Kyrtzidis be125444cf For index-test, if the ASTLocation points at a CallExpr, get a Decl out of it.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75599 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-14 03:19:30 +00:00