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