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

566 Коммитов

Автор SHA1 Сообщение Дата
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