Commit Graph

2064 Commits

Author SHA1 Message Date
Argyrios Kyrtzidis 3e429e7cc4 [libclang] Further simplify the indexing API.
That stuff can be added later on if we need them.
Also add some const goodness.

llvm-svn: 144446
2011-11-12 02:16:30 +00:00
Ted Kremenek 70394cf76c Tweak CXLoadedDiagnosticSetImpl::makeString() to include an extra null character, and change the creation of the FixIT's string to again just rely on this string (instead of duplicating it when calling createCXString).
llvm-svn: 144389
2011-11-11 15:19:48 +00:00
Benjamin Kramer b9af5f6eff Silence compiler warning.
llvm-svn: 144386
2011-11-11 14:13:03 +00:00
NAKAMURA Takumi e89c3bd004 libclang/CXLoadedDiagnostic.cpp: Work around not to miss the string terminator on fixit.
FixIts might be exposed as C string via clang_getCString(), though the zero terminator is not allocated in CXLoadedDiagnosticSetImpl::makeString.

llvm-svn: 144379
2011-11-11 07:27:33 +00:00
Ted Kremenek a0e32fc8b6 [serialized diagnostics]: add test cases for serialized diagnostics, including a test case for no issues, multiple issues, and
a single issue.  Along the way, tweak c-index-test -read-diagnostics output so it is easier to tell what diagnostics are
child diagnostics.

llvm-svn: 144349
2011-11-11 00:46:43 +00:00
Argyrios Kyrtzidis 7519c5e440 [libclang] Simplify the indexing API.
Cut down the number of callbacks to more generic ones. Clients can check
an enum to find out what kind of declaration it is and they can call functions
to get more specific information than the generic provided info.

llvm-svn: 144343
2011-11-11 00:23:36 +00:00
NAKAMURA Takumi 27dd3964ac c-index-test.c: Fix a comment style. /* It is C source. */
llvm-svn: 144274
2011-11-10 10:07:57 +00:00
NAKAMURA Takumi 77d9739249 c-index-test.c: Fix syntax. It is C source.
llvm-svn: 144272
2011-11-10 09:30:15 +00:00
Ted Kremenek d010ba4729 serialized diagnostics: implement full deserialization of clang diagnostics via the libclang API.
I've tested it on simple cases and it works.  Test cases to follow as well as a few tweaks.

llvm-svn: 144269
2011-11-10 08:43:12 +00:00
Ted Kremenek da3cfc9fef Sort contents of exports file. No functionality change.
llvm-svn: 144116
2011-11-08 20:42:13 +00:00
Anna Zaks 9fed084503 [analyzer] Make sure scan-build catches all clang failures.
scan-build ignores clang failures in some cases, which might lead to
silent failure suppression. For example, if clang command line
argument is wrong. (Addresses radar://10406598)

llvm-svn: 144029
2011-11-07 22:38:10 +00:00
John McCall fe96e0b6be Change the AST representation of operations on Objective-C
property references to use a new PseudoObjectExpr
expression which pairs a syntactic form of the expression
with a set of semantic expressions implementing it.
This should significantly reduce the complexity required
elsewhere in the compiler to deal with these kinds of
expressions (e.g. IR generation's special l-value kind,
the static analyzer's Message abstraction), at the lower
cost of specifically dealing with the odd AST structure
of these expressions.  It should also greatly simplify
efforts to implement similar language features in the
future, most notably Managed C++'s properties and indexed
properties.

Most of the effort here is in dealing with the various
clients of the AST.  I've gone ahead and simplified the
ObjC rewriter's use of properties;  other clients, like
IR-gen and the static analyzer, have all the old
complexity *and* all the new complexity, at least
temporarily.  Many thanks to Ted for writing and advising
on the necessary changes to the static analyzer.

I've xfailed a small diagnostics regression in the static
analyzer at Ted's request.

llvm-svn: 143867
2011-11-06 09:01:30 +00:00
Argyrios Kyrtzidis 8c25804ce1 [libclang] For "c-index-test -index-file", print out the names of the callbacks.
llvm-svn: 143779
2011-11-05 04:03:35 +00:00
Argyrios Kyrtzidis d208ef95aa [arcmt] In GC, transform NSMakeCollectable to CFBridgingRelease.
llvm-svn: 143698
2011-11-04 15:58:08 +00:00
Argyrios Kyrtzidis 52d87a6f82 [libclang] Move CursorVisitor to its own header.
llvm-svn: 143639
2011-11-03 19:02:34 +00:00
Argyrios Kyrtzidis 3cefc9d742 [libclang] Use CursorVisitor::Visit instead of invoking the visitor directly.
llvm-svn: 143637
2011-11-03 19:02:28 +00:00
Argyrios Kyrtzidis 7ca77357ce [libclang] Add missing return in clang_getExpansionLocation that resulted in that function
always returning a null file/line/column.

Also add at least one use of clang_getExpansionLocation inside c-index-test that would have
made the tests to catch that.

llvm-svn: 143606
2011-11-03 02:20:36 +00:00
Argyrios Kyrtzidis e968152564 [libclang] Add infrastructure to be able to only deserialize decls in a file region and
use it for clang_getCursor.

llvm-svn: 143605
2011-11-03 02:20:32 +00:00
Argyrios Kyrtzidis cb373e3f31 [libclang] For c-index-test disable caching of code completion results if
the CINDEXTEST_COMPLETION_NO_CACHING environment variable is present.

llvm-svn: 143604
2011-11-03 02:20:25 +00:00
Eli Friedman 61108f2378 Add missing export. Spotted by Leandro Melo.
llvm-svn: 143508
2011-11-01 22:25:07 +00:00
Sebastian Pop 8188c8a1f3 rename getHostTriple into getDefaultTargetTriple in clang
llvm-svn: 143503
2011-11-01 21:33:06 +00:00
Argyrios Kyrtzidis b9689bb46f [libclang] For a class extension, give it a unique USR but for any property or ivar
it contains give it a USR based on its semantic context, which is the interface.

This follows what we already did for objc methods. rdar://10371669

llvm-svn: 143464
2011-11-01 17:14:12 +00:00
Tobias Grosser 1a5307c7cc Add LinkAllPasses to clang
This patch ensures that no passes are deleted from clang, such that the loading
of plugins does not fail because of passes being unavailable.  This increases
the size of the clang binary from 43029853 to 43915291 bytes (around 2%).

llvm-svn: 143414
2011-11-01 01:34:59 +00:00
Douglas Gregor d73f3ddb44 Rework the AST for the initializer of a delegating constructor, so
that it retains source location information for the type. Aside from
general goodness (being able to walk the types described in that
information), we now have a proper representation for dependent
delegating constructors. Fixes PR10457 (for real).

llvm-svn: 143410
2011-11-01 01:16:03 +00:00
Ted Kremenek ce6a5718ce [libclang] Tweak internals of CXSourceLocation to allow an alternate implementation if the lowest bit of ptr_data[0] is not 0. This
is prep for work on serialized diagnostics.

llvm-svn: 143373
2011-10-31 22:23:51 +00:00
Ted Kremenek 4c4f08d555 [libclang] Move implementation of functions for manipulation CXSourceLocations and CXSourceRanges into a separate file.
llvm-svn: 143370
2011-10-31 22:05:42 +00:00
Ted Kremenek bb2c7101b5 [libclang] Add CXDiagnosticImpl to represent a super class for the implementation backing a CXDiagnostic. This allows CXStoredDiagnostic
to be just one possible implementation of a CXDiagnostic.

llvm-svn: 143368
2011-10-31 21:40:19 +00:00
Argyrios Kyrtzidis f3068a73f7 [libclang] Rename VisitIncludedPreprocessingEntries -> VisitIncludedEntities
llvm-svn: 143337
2011-10-31 07:19:54 +00:00
Peter Collingbourne f1d76db466 Add support for lazily linking bitcode files (using a new
-mlink-bitcode-file flag), and more generally llvm::Modules, before
running optimisations.

llvm-svn: 143314
2011-10-30 17:30:44 +00:00
Argyrios Kyrtzidis 9780553ef0 Use LIBCLANG_NOTHREADS instead of CINDEXTEST_NOTHREADS inside libclang,
so the c-index-test one can be enabled without affecting libclang.

llvm-svn: 143288
2011-10-29 19:32:39 +00:00
Argyrios Kyrtzidis a109e00bba [libclang] Introduce use of CINDEXTEST_FAILONERROR environment variable which, if set,
will cause c-index-test to return as failed if a compiler error occurred.

llvm-svn: 143243
2011-10-28 22:54:36 +00:00
Argyrios Kyrtzidis d92ced00b1 [libclang] Check for environment variable CINDEXTEST_NOTHREADS in clang_reparseTranslationUnit.
llvm-svn: 143242
2011-10-28 22:54:33 +00:00
Benjamin Kramer f1b4e0052f Use const_cast to make it obvious that it's just removing constness (and silence warnings).
llvm-svn: 143193
2011-10-28 13:37:11 +00:00
Douglas Gregor deb4a2be67 Implement support for dependent Microsoft __if_exists/__if_not_exists
statements. As noted in the documentation for the AST node, the
semantics of __if_exists/__if_not_exists are somewhat different from
the way Visual C++ implements them, because our parsed-template
representation can't accommodate VC++ semantics without serious
contortions. Hopefully this implementation is "good enough".

llvm-svn: 142901
2011-10-25 01:33:02 +00:00
Argyrios Kyrtzidis 429ec024f8 [PCH] When visiting preprocessed entities, make it possible to avoid deserializing
preprocessed entities that are #included in the range that we are interested.

This is useful when we are interested in preprocessed entities of a specific file, e.g
when we are annotating tokens. There is also an optimization where we cache the last
result of PreprocessingRecord::getPreprocessedEntitiesInRange and we re-use it if
there is a call with the same range as before.

rdar://10313365

llvm-svn: 142887
2011-10-25 00:29:50 +00:00
Benjamin Kramer 42d0cbd76e Reduce dependencies.
llvm-svn: 142742
2011-10-23 08:38:37 +00:00
Argyrios Kyrtzidis 9006807dcd [libclang] Don't use C++-style comments in c-index-test.c.
llvm-svn: 142590
2011-10-20 17:21:46 +00:00
John McCall 59207978e6 More metaprogramming with builtin types.
llvm-svn: 142433
2011-10-18 22:28:37 +00:00
Argyrios Kyrtzidis 72a3cf0a4a [libclang] Make sure we do a correct invalid check in clang_getExpansionLocation.
llvm-svn: 142430
2011-10-18 21:59:54 +00:00
John McCall e314e27c58 Macro metaprogramming for builtin types.
llvm-svn: 142420
2011-10-18 21:02:43 +00:00
Argyrios Kyrtzidis 098c4eabd2 [libclang] Since an objc extension semantically continues the interface of the class
don't use unique USRs for them, otherwise we fail to associate @implementation methods
with the methods in extensions.

llvm-svn: 142361
2011-10-18 16:50:06 +00:00
Argyrios Kyrtzidis 0c7735e525 [libclang] Index implicit property references.
llvm-svn: 142355
2011-10-18 15:50:50 +00:00
Argyrios Kyrtzidis 1c7dcd04b8 [libclang] When printing the diagnostic print it with a new line.
llvm-svn: 142354
2011-10-18 15:13:14 +00:00
Argyrios Kyrtzidis 321e30216a [libclang] Index method references.
llvm-svn: 142353
2011-10-18 15:13:11 +00:00
Nick Lewycky 1d617acef9 Wire up support for the controlling the extended dwarf .file directive. With
r142300 but not this patch, clang -S may emit .s files that assemblers other
than llvm-mc can't parse.

llvm-svn: 142301
2011-10-17 23:05:52 +00:00
Matt Beaumont-Gay cb6e5c16ef Silence a -Wc++0x-narrowing warning
llvm-svn: 142292
2011-10-17 22:19:09 +00:00
Argyrios Kyrtzidis 317ebfe18e Try fixing MSVC compiler errors.
llvm-svn: 142289
2011-10-17 22:12:24 +00:00
Argyrios Kyrtzidis dc199a3152 [libclang] Introduce a new high level API for indexing clients that assumes
more of the work involved in indexing a translation unit and simplifies client
implementations.

Only C/ObjC for now, C++ (and comments) to come.

llvm-svn: 142233
2011-10-17 19:48:19 +00:00
John McCall 8a6b59ad97 Add a new placeholder type to represent "unbridged"
casts in ARC.

No semantic analysis yet.

llvm-svn: 142208
2011-10-17 18:09:15 +00:00
Anton Korobeynikov f0c267e6e0 Provide half floating point support as a storage only type.
Lack of half FP was a regression compared to llvm-gcc.

llvm-svn: 142016
2011-10-14 23:23:15 +00:00
Benjamin Kramer b89514a9b8 Change operator<< for raw_ostream and NamedDecl to take a reference instead of a pointer.
Passing a pointer was a bad idea as it collides with the overload for void*.

llvm-svn: 141971
2011-10-14 18:45:37 +00:00
Erik Verbruggen 98ea7f6737 Added clang_getCompletionAnnotation and clang_getCompletionNumAnnotations to
retrieve annotations from completion string.

llvm-svn: 141953
2011-10-14 15:31:08 +00:00
Erik Verbruggen ca98f2a63f Allow for annotate attributes after access specifiers. When such
attributes are found, propagate them to subsequent declarations.

llvm-svn: 141861
2011-10-13 09:41:32 +00:00
Argyrios Kyrtzidis e454986617 [libclang] Allow using getDeclCursorUSR function with a Decl* and not a cursor.
llvm-svn: 141770
2011-10-12 07:07:36 +00:00
Argyrios Kyrtzidis 769c7bcd9a [libclang] Make MakeCXTranslationUnit usable outside CIndex.cpp.
llvm-svn: 141769
2011-10-12 07:07:33 +00:00
Eli Friedman df14b3a837 Initial implementation of __atomic_* (everything except __atomic_is_lock_free).
llvm-svn: 141632
2011-10-11 02:20:01 +00:00
Douglas Gregor e442fe3db9 Make sure we initialize the "extra" data within the libclang code
completion context, in case we end up having no code-completion
callback. Individual instances of this problem are always bugs that
need to be fixed, but it's better to make sure we have initialized
data here.

llvm-svn: 141598
2011-10-10 23:37:54 +00:00
Argyrios Kyrtzidis ffd530f2c0 [libclang] Do ConcurrencyCheck for clang_getLocation as well.
llvm-svn: 141583
2011-10-10 21:57:15 +00:00
John McCall f937c023bf Rename TagDecl::isDefinition -> isCompleteDefinition
for better self-documenting code, since the semantics
are subtly different from getDefinition().

llvm-svn: 141355
2011-10-07 06:10:15 +00:00
Eli Friedman 0dfb889575 Support for C1x _Atomic specifier (see testcase). This is primarily being committed at the moment to help support C++0x <atomic>, but it should be a solid base for implementing the full specification of C1x _Atomic.
Thanks to Jeffrey Yasskin for the thorough review!

llvm-svn: 141330
2011-10-06 23:00:33 +00:00
Erik Verbruggen 338b55cc73 Fixed GCC (C90) and Clang warnings.
llvm-svn: 141281
2011-10-06 11:38:08 +00:00
Erik Verbruggen 2e657ffd8e Added CXAvailability_NotAccessible to indicate that a declaration is available, but not accessible from the current code completion context.
llvm-svn: 141278
2011-10-06 07:27:49 +00:00
Argyrios Kyrtzidis cddafd3969 [libclang] Introduce clang_findReferencesInFile which accepts a cursor, a file,
and a callback and finds all identifier references of the cursor in the file.

rdar://7948304

llvm-svn: 141277
2011-10-06 07:00:54 +00:00
Argyrios Kyrtzidis 3b947f72da [libclang] Move the bulk of clang_getOverriddenCursors into
a cxcursor::getOverriddenCursors C++ function, because SmallVectors
are groovier that malloc'ing buffers.

llvm-svn: 141276
2011-10-06 07:00:46 +00:00
Douglas Gregor 4c362d5310 Expose more statement, expression, and declaration kinds in libclang,
from Manuel Holtgrewe!

llvm-svn: 141200
2011-10-05 19:00:14 +00:00
Bob Wilson 05de0298d2 Rip out flags for controlling C++ "production mode" separately.
This is old leftover cruft from the days when C++ was not yet ready
for prime time.

llvm-svn: 141063
2011-10-04 05:34:14 +00:00
Argyrios Kyrtzidis 52f53fb303 Improve location fidelity of objc decls.
-Add the location of the class name to all objc container decls, not just ObjCInterfaceDecl.
-Make objc decls consistent with the rest of the NamedDecls and have getLocation() point to the
 class name, not the location of '@'.

llvm-svn: 141061
2011-10-04 04:48:02 +00:00
Argyrios Kyrtzidis 12afd70370 [libclang] Introduce CXCursor_CXXAccessSpecifier for C++'s public:/private:/protected: specifiers.
Patch by Paolo Capriotti!

llvm-svn: 140864
2011-09-30 17:58:23 +00:00
Argyrios Kyrtzidis e7e4291448 [libclang] Introduce clang_Range_isNull.
llvm-svn: 140706
2011-09-28 18:14:21 +00:00
NAKAMURA Takumi 37a4674fdc Install c-index-test also on CMake build, following up r140681.
llvm-svn: 140694
2011-09-28 10:50:23 +00:00
Ted Kremenek 7f01c7b5f1 Install c-index-test as part of install-clang-c Makefile rule.
llvm-svn: 140681
2011-09-28 04:39:41 +00:00
Douglas Gregor c0b07286cf When 'bool' is not a built-in type but is defined as a macro, print
'bool' rather than '_Bool' within types, to make things a bit more
readable. Fixes <rdar://problem/10063263>.

llvm-svn: 140650
2011-09-27 22:38:19 +00:00
Argyrios Kyrtzidis 2b0cf60df3 [libclang] Expose array size and element type, patch by Vinay Sajip!
llvm-svn: 140614
2011-09-27 17:44:34 +00:00
Argyrios Kyrtzidis a1bcb6adb5 MSVC is stuck in the 80s.
llvm-svn: 140597
2011-09-27 04:14:36 +00:00
Argyrios Kyrtzidis fd51520d5f [libclang] Refactor the important stuff in clang_getCursor into a cxcursor::getCursor(CXTranslationUnit, SourceLocation) function.
llvm-svn: 140588
2011-09-27 00:30:33 +00:00
Argyrios Kyrtzidis d6e9fa55eb [libclang] Introduce clang_Cursor_isNull and clang_Cursor_getTranslationUnit functions.
llvm-svn: 140587
2011-09-27 00:30:30 +00:00
Argyrios Kyrtzidis a4fa0d8be7 [libclang] Report implicit objc methods for properties when indexing.
Related to rdar://10087069.

llvm-svn: 140551
2011-09-26 19:05:37 +00:00
Argyrios Kyrtzidis 4cdfcae75d Don't map a file:line:col triplet that is inside the preamble range to
a "loaded" location of the precompiled preamble.

Instead, handle specially locations of preprocessed entities:
-When looking up for preprocessed entities, map main file locations inside the
 preamble range to a preamble loaded location.
-When getting the source range of a preprocessing cursor, map preamble loaded
 locations back to main file locations.

Fixes rdar://10175093 & http://llvm.org/PR10999

llvm-svn: 140519
2011-09-26 08:01:41 +00:00
David Blaikie 69609dcead Rename VerifyDiagnosticsClient to VerifyDiagnosticConsumer as per issue 5397
llvm-svn: 140489
2011-09-26 00:38:03 +00:00
David Blaikie e2eefaecc8 Rename DiagnosticClient to DiagnosticConsumer as per issue 5397
llvm-svn: 140479
2011-09-25 23:39:51 +00:00
David Blaikie 9c902b5502 Rename Diagnostic to DiagnosticsEngine as per issue 5397
llvm-svn: 140478
2011-09-25 23:23:43 +00:00
David Blaikie aa347f9392 Removing a bunch of dead returns/breaks after llvm_unreachables.
llvm-svn: 140407
2011-09-23 20:26:49 +00:00
David Blaikie 83d382b1ca Switch assert(0/false) llvm_unreachable.
llvm-svn: 140367
2011-09-23 05:06:16 +00:00
Argyrios Kyrtzidis de6aa08013 Rename ExplicitTemplateArgumentList -> ASTTemplateArgumentListInfo, no functionality change.
llvm-svn: 140330
2011-09-22 20:07:03 +00:00
Argyrios Kyrtzidis 45e8cf5732 [libclang] When pointing at a macro expansion inside a macro argument,
return a cursor for the inner macro.

llvm-svn: 140207
2011-09-20 23:27:33 +00:00
Ted Kremenek 057b986d9d Sort exports list.
llvm-svn: 140171
2011-09-20 19:02:45 +00:00
Argyrios Kyrtzidis 5733271925 In libclang, when visiting preprocessed entities in a source range, use
PreprocessingRecord's getPreprocessedEntitiesInRange.

Also remove all the stuff that were added in ASTUnit that are unnecessary now
that we do a binary search for preprocessed entities and deserialize only
what is necessary.

llvm-svn: 140063
2011-09-19 20:40:48 +00:00
Argyrios Kyrtzidis 7c06d8666b [libclang] When getting a source location from a file:line:col triplet
check whether the requested location points inside the precompiled preamble,
in which case the returned source location will be a "loaded" one.

llvm-svn: 140060
2011-09-19 20:40:35 +00:00
Argyrios Kyrtzidis e6e67deeed Rename SourceLocation::getFileLocWithOffset -> getLocWithOffset.
It already works (and is useful with) macro locs as well.

llvm-svn: 140057
2011-09-19 20:40:19 +00:00
Erik Verbruggen 852725b615 First test commit.
llvm-svn: 140016
2011-09-19 15:03:11 +00:00
Argyrios Kyrtzidis 303e513544 [libclang] Remove libclang.darwin.exports, it's not used anymore.
llvm-svn: 139661
2011-09-13 23:12:36 +00:00
Argyrios Kyrtzidis 91672b3c03 [libclang] Introduce clang_getPresumedLocation which works like clang_getExpansionLocation
but takes into account #line directives coming from preprocessed files.

Patch by Vinay Sajip!

llvm-svn: 139647
2011-09-13 21:49:08 +00:00
Argyrios Kyrtzidis 4c2131a775 [libclang] Correct annotation and taking of cursor for objc class references
inside the IBOutletCollection attribute.

llvm-svn: 139621
2011-09-13 18:49:56 +00:00
Argyrios Kyrtzidis c179111536 Rename InterFace -> Interface, no functionality change.
llvm-svn: 139620
2011-09-13 18:49:52 +00:00
Argyrios Kyrtzidis 2cb4e3c554 [libclang]
-Allow cursor visitation of an attribute using its source range
-Add C++ 'final' and 'override' attributes as cursor kinds
-Simplify the logic that marks 'final' and 'override' attributes as tokens.

llvm-svn: 139609
2011-09-13 17:39:31 +00:00
Douglas Gregor 2b9b464290 When compiling a module on-demand, re-use the diagnostics client
already provided. This required a little bit of clean-up in the way
that VerifyDiagnosticsClient managed ownership of its underlying
"primary" client, because now it will no longer always take ownership.

llvm-svn: 139570
2011-09-13 01:26:44 +00:00
Argyrios Kyrtzidis 01e3c590ae [libclang] For getDeclFromExpr in CIndex.cpp, associate the decl of
a DeclRefExpr, MemberExpr, etc. with a CastExpr if it is ImplicitCast,
since the implicit cast is the one that is invisible in source code.

llvm-svn: 139547
2011-09-12 22:17:26 +00:00
Argyrios Kyrtzidis 3405baa3f0 [libclang] Make c-index-test check CINDEXTEST_REMAP_AFTER_TRIAL environment variable,
which when set it determines the trial number after which the remapping of files should
take effect.

llvm-svn: 139511
2011-09-12 18:09:31 +00:00
Douglas Gregor 98c05b286c Kill of the Decl::PCHLevel field entirely. We now only need to know
whether a Decl was deserialized from an AST file (any AST file).

llvm-svn: 139438
2011-09-10 00:09:20 +00:00
Douglas Gregor 1bbf030b8e The translation unit is never deserialized
llvm-svn: 139436
2011-09-09 23:34:14 +00:00
Anna Zaks 45ce1bf091 [analyzer] When running scan-build with -plist on ./configure, delete the plist files.
(scan-build does not set the $HtmlDir when running against configure. Previously, this implied that the plist files would appear in the current directory, with this patch they will get deleted.)

llvm-svn: 139382
2011-09-09 18:43:53 +00:00
James Molloy 98f3e18f25 Fix up MCInstPrinter creation to take the new SubtargetInfo parameter (see LLVM r139237)
llvm-svn: 139238
2011-09-07 17:25:30 +00:00
Anna Zaks 5efad63f57 [analyzer] Revert a regression introduced in r133104(The ARC Migration Tool..) due to a merge error.
llvm-svn: 138919
2011-08-31 23:53:24 +00:00
Chandler Carruth 4aa01ef19c Update libclang to have APIs corresponding to the new 'expansion' naming
system for macro-backed source locations. The old APIs are preserved for
legacy users.

This was intended to land with the main work of instantiation ->
expansion, but despite running it by Doug over a month ago, I forgot to
commit it. Very sorry for that...

llvm-svn: 138860
2011-08-31 16:53:37 +00:00
Argyrios Kyrtzidis 6b0cf7e5fc [libclang] Rename some functions and make sure we don't iterate past the tokens array.
llvm-svn: 138813
2011-08-30 19:43:19 +00:00
Matt Beaumont-Gay d6238f4717 Fix type mismatch in initialization (caught by -Wliteral-conversion)
llvm-svn: 138736
2011-08-29 16:37:29 +00:00
Nico Weber 5d8f912f50 [analyzer] update bug report url
llvm-svn: 138721
2011-08-28 11:50:56 +00:00
Fariborz Jahanian 3a039e339f objective-c: Treat top-level objective-c declarations
, such as list of forward @class decls, in a DeclGroup
node. Deal with its consequence throught clang. This
is in preparation for more Sema work ahead. // rdar://8843851.
Feel free to reverse if it breaks something important
and I am unavailable.

llvm-svn: 138709
2011-08-27 20:50:59 +00:00
Douglas Gregor 2ed0ee1ace Eliminate the -chained-pch flag and all of the frontend and libclang options associated with it. Chained PCH is the only way to build a PCH file that includes another PCH file
llvm-svn: 138597
2011-08-25 22:54:01 +00:00
Douglas Gregor 69f74f80db Introduce a -cc1 option "-emit-module", that creates a binary module
from the given source. -emit-module behaves similarly to -emit-pch,
except that Sema is somewhat more strict about the contents of
-emit-module. In the future, there are likely to be more interesting
differences.

llvm-svn: 138595
2011-08-25 22:30:56 +00:00
Argyrios Kyrtzidis 440f954d6f [libclang] Fix getting a cursor that points inside tag definition that is part
of a type specifier.

e.g. for:

typedef struct _MyS {
  int foo;
} MyS;

pointing at field 'foo' would give a cursor for the typedef declaration 'MyS'
instead of the field.

llvm-svn: 138593
2011-08-25 22:24:47 +00:00
Evan Cheng 494eb062b5 Match LLVM change: TargetRegistry and TargetSelect have been moved to Support.
llvm-svn: 138451
2011-08-24 18:09:14 +00:00
Ted Kremenek 288d31d62a [libclang] Remove NestedNameSpecifierVisit, as Clang says that this code is dead.
llvm-svn: 137999
2011-08-18 22:25:21 +00:00
Argyrios Kyrtzidis 035674d33c [libclang] Annotate correctly macro argument tokens.
llvm-svn: 137961
2011-08-18 18:03:34 +00:00
Ted Kremenek 5b8ad40664 [libclang] Workaround potential race condition with code completion AllocatedResults being freed after a CXTranslationUnit.
The Container USR's CXString had its underlying data owned by the CXTranslationUnit's string pool.  This
would result in trying to access freed memory.

llvm-svn: 137887
2011-08-17 22:19:53 +00:00
Argyrios Kyrtzidis d8b87a8b2e [libclang] Implicit objc methods are skipped, no need to check isSynthesized.
Plus, isSynthesized returning true does not mean that there is not a user-declared method declaration.

llvm-svn: 137858
2011-08-17 20:15:55 +00:00
Argyrios Kyrtzidis 004df6e053 Mark objc methods that are implicitly declared for properties (not user-declared) as implicit.
This results in libclang ignoring such methods.

llvm-svn: 137852
2011-08-17 19:25:08 +00:00
Argyrios Kyrtzidis 6f5bd2f630 [libclang] Make clang_getCursor able to handle locations that point inside macro arguments.
e.g. for:

\define INVOKE(METHOD, CLASS) [CLASS METHOD]

void test2() {
  INVOKE(meth, MyClass);
}

Pointing at 'meth' will give a CXCursor_ObjCMessageExpr and pointing at 'MyClass'
will give a CXCursor_ObjCClassRef.

llvm-svn: 137796
2011-08-17 00:31:25 +00:00
Jim Grosbach acb07b599c Update createMCAsmParser() to match r137735.
llvm-svn: 137736
2011-08-16 18:33:55 +00:00
Argyrios Kyrtzidis 2c7f4f133f [libclang] Require explicit cursor visitation for all TypeLocs (compilation will
fail if a TypeLoc kind is not handled) and handle DecltypeTypeLoc and InjectedClassNameTypeLoc.

llvm-svn: 137670
2011-08-15 22:40:24 +00:00
Argyrios Kyrtzidis 48ff9a0bd5 [libclang] Handle AttributedTypeLoc for cursor visitation. Fixes rdar://9535717.
llvm-svn: 137634
2011-08-15 18:44:43 +00:00
Francois Pichet 00c7e6ceb1 Implement function template specialization at class scope extension in Microsoft mode. A new AST node is introduced: ClassScopeFunctionSpecialization. This node holds a FunctionDecl that is not yet specialized; then during the class template instantiation the ClassScopeFunctionSpecialization will spawn the actual function specialization.
Example:
template <class T>
class A {
public:
  template <class U> void f(U p) {  }
  template <> void f(int p) {  } // <== class scope specialization
};

This extension is necessary to parse MSVC standard C++ headers, MFC and ATL code.
BTW, with this feature in, clang can parse (-fsyntax-only) all the MSVC 2010 standard header files without any error.

llvm-svn: 137573
2011-08-14 03:52:19 +00:00
Nick Lewycky 1c5f3fa197 The diagtool registration system tries to use a global variable from a method
called on another global variable. Use ManagedStatic to ensure that the global
we register with actually exists when we need it.

llvm-svn: 137406
2011-08-12 01:14:22 +00:00
Douglas Gregor dab42432d7 In the serialized AST format, make the translation unit a "predefined"
declaration that never actually gets serialized. Instead, serialize
the various kinds of update records (lexical decls, visible decls, the
addition of an anonymous namespace) for the translation unit, even if
we're not chaining. This way, we won't have to deal with multiple
loaded translation unit declarations.

llvm-svn: 137395
2011-08-12 00:15:20 +00:00
Ted Kremenek d33c4d39a0 scan-build: enable C++ support by default.
llvm-svn: 137382
2011-08-11 22:47:20 +00:00
Argyrios Kyrtzidis 5431380dd4 [libclang] When pointing at an objc property don't return a cursor that points at the
synthesized method for the property. rdar://9771715

llvm-svn: 137248
2011-08-10 21:12:04 +00:00
Douglas Gregor 349c403b46 Switch a C-style cast over to a const_cast. No functionality change
llvm-svn: 137218
2011-08-10 16:34:38 +00:00
Ted Kremenek 1b46951f9f Place back previous order of add_subdirectory()'s to reflect build depedencies.
llvm-svn: 137117
2011-08-09 14:55:12 +00:00
Ted Kremenek 5c8daf1ee1 Add libsupport to list of libraries to link into diagtool
llvm-svn: 137110
2011-08-09 03:41:03 +00:00
Ted Kremenek f88d335ca7 Add 'diagtool' to the 'tools/' directory. diagtool is a new tool (WIP) for analyzing and working with clang diagnostics.
Some interesting stats from 'diagtool list-warnings' on the current version of clang:

  Percentage of warnings with flags: 48.79%
  Number of unique flags: 148
  Average number of diagnostics per flag: 2.041

llvm-svn: 137109
2011-08-09 03:39:19 +00:00
Ted Kremenek 454651adb5 Sort CMakeLists.txt.
llvm-svn: 137107
2011-08-09 03:39:10 +00:00
Douglas Gregor 3f35bb2d15 Add a new libclang API to return a CXCompletionString for an arbitrary
cursor, from Connor Wakamo! Addresses <rdar://problem/9087798>.

llvm-svn: 136911
2011-08-04 20:04:59 +00:00
Chad Rosier be10f9853c When the compiler crashes, the compiler driver now produces diagnostic
information including the fully preprocessed source file(s) and command line 
arguments.  The developer is asked to attach this diagnostic information to a 
bug report.
rdar://9575623

llvm-svn: 136702
2011-08-02 17:58:04 +00:00
Douglas Gregor 2c595adf2e When performing code completion after at @interface, allow both
already-defined and forward-declared results. Already-defined results
are fine because they could be the start of a category. Fixes
<rdar://problem/9811691>.

llvm-svn: 136559
2011-07-30 06:55:39 +00:00
Ted Kremenek fbcce6fba3 clang_getCXTUResourceUsage: report memory used by HeaderSearch.
This required converting the StringMaps to use a BumpPtrAllocator.  I measured the
compile time and saw no observable regression.

llvm-svn: 136190
2011-07-26 23:46:11 +00:00
Ted Kremenek 120992ad81 clang_getCXTUResourceUsage: Report memory used by data structures in SourceManager.
llvm-svn: 136189
2011-07-26 23:46:06 +00:00
Benjamin Kramer 632500cb85 Eliminate a bunch of temporary strings.
llvm-svn: 136092
2011-07-26 16:59:25 +00:00
Douglas Gregor ea777403f9 Add new libclang API, clang_codeCompleteGetObjCSelector(), which
provides the partial Objective-C selector used in a code
completion. From Connor Wakamo!

llvm-svn: 136084
2011-07-26 15:24:30 +00:00
Evan Cheng 5a7a4ea505 Assembler really doesn't need to create TargetMachine anymore.
llvm-svn: 136045
2011-07-26 01:49:26 +00:00
Evan Cheng 9568f27950 Rename createCodeEmitter to createMCCodeEmitter; createObjectStreamer to createMCObjectStreamer.
llvm-svn: 136032
2011-07-26 00:42:40 +00:00
Evan Cheng 939f809ce9 Rename createAsmParser to createMCAsmParser.
llvm-svn: 136029
2011-07-26 00:24:45 +00:00
Evan Cheng 4b89983662 Rename TargetAsmBackend to MCAsmBackend; rename createAsmBackend to createMCAsmBackend.
llvm-svn: 136011
2011-07-25 23:25:09 +00:00
Francois Pichet ece689f336 Fix the MSVC build. 2 problems:
- buildPieces was return a C++ object from inside an extern "C". (MSVC didn't like that)
   - clang_getCursorReferenceNameRange was missing a CINDEX_LINKAGE causing a link error.

llvm-svn: 135983
2011-07-25 22:00:44 +00:00
Chandler Carruth d48db2115a Rename getInstantiationLineNumber to getExpansionLineNumber in both
SourceManager and FullSourceLoc.

llvm-svn: 135969
2011-07-25 21:09:52 +00:00
Chandler Carruth 42f35f9cd2 Rename getInstantiationColumnNumber to getExpansionColumnNumber in both
SourceManager and FullSourceLoc.

llvm-svn: 135965
2011-07-25 20:57:57 +00:00
Evan Cheng c2d8c6be92 Assembler doesn't need to initialize TargetMachine's anymore.
llvm-svn: 135964
2011-07-25 20:53:26 +00:00
Chandler Carruth c7ca5218b6 Rename getDecomposedInstantiationLoc to getDecomposedExpansionLoc.
llvm-svn: 135962
2011-07-25 20:52:32 +00:00
Douglas Gregor c1679ecf3b Added clang_getCursorReferenceNameRange to libclang to to retrieve parts of
a cursor reference, from Erik Verbruggen!

llvm-svn: 135920
2011-07-25 17:48:11 +00:00
Chandler Carruth 6d28d7f2a3 Rename SourceManager::getInstantiationRange to getExpansionRange.
llvm-svn: 135915
2011-07-25 16:56:02 +00:00
Chandler Carruth 35f5320d8e Mechanically rename SourceManager::getInstantiationLoc and
FullSourceLoc::getInstantiationLoc to ...::getExpansionLoc. This is part
of the API and documentation update from 'instantiation' as the term for
macros to 'expansion'.

llvm-svn: 135914
2011-07-25 16:49:02 +00:00
Douglas Gregor 757e38b47e Extend libclang with clang_equalRanges, from Erik Verbruggen!
llvm-svn: 135860
2011-07-23 19:35:14 +00:00
Chris Lattner 54b1677d23 Move ArrayRef to LLVM.h and eliminate now-redundant qualifiers, patch by Jon Mulder!
llvm-svn: 135855
2011-07-23 17:14:25 +00:00
Chris Lattner 0e62c1cc0b remove unneeded llvm:: namespace qualifiers on some core types now that LLVM.h imports
them into the clang namespace.

llvm-svn: 135852
2011-07-23 10:55:15 +00:00
Evan Cheng 06e70d33fc Move TargetAsmParser.h TargetAsmBackend.h and TargetAsmLexer.h to MC where they belong.
llvm-svn: 135834
2011-07-23 00:45:53 +00:00
Evan Cheng c391a58b2b Match LLVM API change.
llvm-svn: 135813
2011-07-22 21:59:11 +00:00
Douglas Gregor 63745d5935 New libclang API to expose container type for code completion, from
Connor Wakamo!

llvm-svn: 135651
2011-07-21 01:05:26 +00:00
Douglas Gregor 4a9c39a2f6 Rework the detailed preprocessing record to separate preprocessing
entities generated directly by the preprocessor from those loaded from
the external source (e.g., the ASTReader). By separating these two
sets of entities into different vectors, we allow both to grow
independently, and eliminate the need for preallocating all of the
loaded preprocessing entities. This is similar to the way the recent
SourceManager refactoring treats FileIDs and the source location
address space.

As part of this, switch over to building a continuous range map to
track preprocessing entities.

llvm-svn: 135646
2011-07-21 00:47:40 +00:00
Chad Rosier 1988642124 Temporarily revert r135614 while I fix the cmake build.
llvm-svn: 135621
2011-07-20 21:16:17 +00:00
Chad Rosier e3805fc118 When the compiler crashes, the compiler driver now produces diagnostic information
including the fully preprocessed source file(s) and command line arguments.  The 
developer is asked to attach this diagnostic information to a bug report.

llvm-svn: 135614
2011-07-20 20:26:32 +00:00
Evan Cheng b5517a4d8c Match MCContext change.
llvm-svn: 135612
2011-07-20 19:53:19 +00:00
Chris Lattner 01cf8db38b now that we have a centralized place to do so, add some using declarations for
some common llvm types: stringref and smallvector.  This cleans up the codebase
quite a bit.

llvm-svn: 135576
2011-07-20 06:58:45 +00:00
Evan Cheng 347033fd8b Match LLVM API change.
llvm-svn: 135570
2011-07-20 06:22:27 +00:00
Douglas Gregor 925296b4c2 Revamp the SourceManager to separate the representation of parsed
source locations from source locations loaded from an AST/PCH file.

Previously, loading an AST/PCH file involved carefully pre-allocating
space at the beginning of the source manager for the source locations
and FileIDs that correspond to the prefix, and then appending the
source locations/FileIDs used for parsing the remaining translation
unit. This design forced us into loading PCH files early, as a prefix,
whic has become a rather significant limitation.

This patch splits the SourceManager space into two parts: for source
location "addresses", the lower values (growing upward) are used to
describe parsed code, while upper values (growing downward) are used
for source locations loaded from AST/PCH files. Similarly, positive
FileIDs are used to describe parsed code while negative FileIDs are
used to file/macro locations loaded from AST/PCH files. As a result,
we can load PCH/AST files even during parsing, making various
improvemnts in the future possible, e.g., teaching #include <foo.h> to
look for and load <foo.h.gch> if it happens to be already available.

This patch was originally written by Sebastian Redl, then brought
forward to the modern age by Jonathan Turner, and finally
polished/finished by me to be committed.

llvm-svn: 135484
2011-07-19 16:10:42 +00:00
Evan Cheng 3f37dd065b Match createTargetMachine API change.
llvm-svn: 135469
2011-07-19 06:37:41 +00:00
Evan Cheng b505ace101 MCContext now takes MCRegisterInfo.
llvm-svn: 135425
2011-07-18 20:57:51 +00:00
Argyrios Kyrtzidis e6cd072517 [libclang] Map canonical decl of a category implementation to the category decl.
llvm-svn: 135316
2011-07-15 22:37:58 +00:00
Argyrios Kyrtzidis 238ea53793 Revert r135304 and apply fix in clang_getCanonicalCursor per Doug's, Fariborz's comments.
llvm-svn: 135314
2011-07-15 22:27:18 +00:00
John McCall 7c454bb8ce Create a new expression node, SubstNonTypeTemplateParmExpr,
to represent a fully-substituted non-type template parameter.
This should improve source fidelity, as well as being generically
useful for diagnostics and such.

llvm-svn: 135243
2011-07-15 05:09:51 +00:00
Evan Cheng 6d188f5f1c Match llvm API change.
llvm-svn: 135220
2011-07-14 23:50:56 +00:00
Chandler Carruth 65c9c9bd69 Clean up two lingering comments that mention 'instantiation' w.r.t.
macros in libclang.

llvm-svn: 135148
2011-07-14 16:07:57 +00:00
Chandler Carruth de81fc8557 NestedMacroInstantiations -> NestedMacroExpansions
This is switches all the interfaces points (and most of the commenst
/ local variables I saw on my way through) regarding the
NestedMacroInstantiations bit.

The libclang enums corresponding to this state were renamed, but
a legacy enum was added with the old name, and the same value to keep
existing clients working. I've added a documentation blurb for it, but
let me know if there is a canonical way to document legacy elemenst of
the libclang interface.

No functionality changed here, even in tests.

llvm-svn: 135141
2011-07-14 09:02:10 +00:00
Chandler Carruth 9e4704ab07 Update all of the libclang code corresponding to the preprocessor
MacroInstantiation -> MacroExpansion rename. Internally, everything is
switched.

Introduce a new cursor kind enum with the new name, but retain the old
name as an alias so that we don't break backwards compatibility.

Also update the debug printing routine to use 'macro expansions' as its
explicitly not guaranteed to be stable, and mechanically switch the test
cases over to that.

llvm-svn: 135140
2011-07-14 08:41:15 +00:00
Chandler Carruth a88a221855 Move the rest of the preprocessor terminology from 'instantiate' and
variants to 'expand'. This changed a couple of public APIs, including
one public type "MacroInstantiation" which is now "MacroExpansion". The
rest of the codebase was updated to reflect this, especially the
libclang code. Two of the C++ (and thus easily changed) libclang APIs
were updated as well because they pertained directly to the old
MacroInstantiation class.

No functionality changed.

llvm-svn: 135139
2011-07-14 08:20:46 +00:00
Argyrios Kyrtzidis a59dbea017 Fix CMake.
llvm-svn: 134918
2011-07-11 20:28:59 +00:00
Argyrios Kyrtzidis f89cc69eac [arcmt] Move the remapping functions to clang-c/Index.h and change 'arcmt_' prefix to 'clang_'.
llvm-svn: 134916
2011-07-11 20:15:00 +00:00
Evan Cheng 279f2907ed Match createCodeEmitter change.
llvm-svn: 134885
2011-07-11 04:24:19 +00:00
Francois Pichet 9a22177c3e Fix ARCMT/migrate.m on MSVC.
Solution is to set output stdout to binary mode to prevent newline conversion (\n => \r\n).

llvm-svn: 134879
2011-07-10 19:48:34 +00:00
Joerg Sonnenberger e3531fcf88 Unbreak -cc1as mode after MC subtarget changes
llvm-svn: 134877
2011-07-10 19:16:25 +00:00
NAKAMURA Takumi e65e4778f2 tools/c-arcmt-test/Makefile: Add clangARCMigrate.a clangRewrite.a to USEDLIBS to satisfy linking on cygming.
FIXME: tools/c-*.exe should be linked to clang.dll on cygming. llvm/Makefile.rules is not aware of bin/clang.dll.
llvm-svn: 134871
2011-07-10 15:50:19 +00:00
NAKAMURA Takumi 3310effb24 c-arcmt-test.c: MSVCRT does not have setenv. Use putenv instead.
llvm-svn: 134859
2011-07-10 03:10:43 +00:00
Argyrios Kyrtzidis dd76300464 Fix linker problem in buildbot.
llvm-svn: 134849
2011-07-09 22:35:06 +00:00
Argyrios Kyrtzidis 347bf910b9 Ugh, fix CMake.
llvm-svn: 134848
2011-07-09 22:05:50 +00:00
Argyrios Kyrtzidis 27019be903 [libclang] Fix linker error in buildbots.
llvm-svn: 134847
2011-07-09 21:35:58 +00:00
Argyrios Kyrtzidis 7fbd97f641 [arcmt] Introduce new '-ccc-arcmt-migrate <path>' ARC migration driver option.
This is a new mode of migration, where we avoid modifying the original files but
we emit temporary files instead.

<path> will be used to keep migration process metadata. Currently the temporary files
that are produced are put in the system's temp directory but we can put them
in the <path> if is necessary.

Also introduce new ARC migration functions in libclang whose only purpose,
currently, is to accept <path> and provide pairs of original file/transformed file
to map from the originals to the files after transformations are applied.

Finally introduce the c-arcmt-test utility that exercises the new libclang functions,
update arcmt-test, and add tests for the whole process.

rdar://9735086.

llvm-svn: 134844
2011-07-09 20:00:58 +00:00
Evan Cheng 7b15d1885f cc1 must initialize MC subtarget infos for inline asm parsing. Re-enable asm-errors.c
llvm-svn: 134811
2011-07-09 07:32:07 +00:00
Evan Cheng dec3187e7f createAsmParser API change.
llvm-svn: 134797
2011-07-09 06:04:17 +00:00
Chandler Carruth 961995dc9a Update the creation of the TargetAsmParser based on API change in r134678.
llvm-svn: 134680
2011-07-08 03:15:48 +00:00
Joerg Sonnenberger 39ec119132 Slightly improve the code to derive target from program name to not
fault if no arguments are given.

llvm-svn: 134618
2011-07-07 16:57:26 +00:00
Douglas Gregor 2132584d36 Introduce a new libclang aPI function,
clang_codeCompleteGetContexts(), that provides the client with
information about the context in which code completion has occurred
and what kinds of entities make sense as completions at that
point. Patch by Connor Wakamo!

llvm-svn: 134615
2011-07-07 16:03:39 +00:00
Francois Pichet abcfbecf39 MSVC doesn't like mixing declarations and statements in a C file.
llvm-svn: 134550
2011-07-06 22:09:44 +00:00
Evan Cheng 299b36fa72 createMCInstPrinter doesn't need TargetMachine anymore.
llvm-svn: 134526
2011-07-06 19:45:57 +00:00
Douglas Gregor 30c80fa3eb libclang: Allow callers of clang_saveTranslationUnit() to distinguish
between different classes of errors. Addresses most of
<rdar://problem/9660328>.

llvm-svn: 134495
2011-07-06 16:43:36 +00:00
Douglas Gregor a98034a25e Improve the Python bindings for libclang in a few ways, from Eli
Bendersky. Specifically: 

* Implemented a new function in libclang: clang_isAttribute

* Fixing TranslationUnit.get_includes to only go through the argument
* buffer when it contains something. This fixed a crash on Windows 

* clang_getFileName returns CXString, not char*. Made appropriate
* fixes in cindex.py - now the relevant tests pass and we can see the
* full locations correctly again (previously there was garbage in
* place of the file name) 
* Exposed clang_getCursorDisplayName to the python bindings

llvm-svn: 134460
2011-07-06 03:00:34 +00:00
John McCall d9dfe3a1f8 Preserve that a TemplateName was arrived at by substituting
for a template template parameter.

Uses to follow.

I've also made the uniquing of SubstTemplateTemplateParmPacks
use a ContextualFoldingSet as a minor space efficiency.

llvm-svn: 134137
2011-06-30 08:33:18 +00:00
Evan Cheng adc7959851 createTargetMachine now takes a CPU string.
llvm-svn: 134128
2011-06-30 02:06:32 +00:00
Argyrios Kyrtzidis 8bb2ecf32d [libclang] Introduce cxcursor::getCursorParentDecl(CXCursor Cursor) and use it at the appropriate place in CIndex.cpp
No functionality change.

llvm-svn: 134104
2011-06-29 22:20:07 +00:00
Argyrios Kyrtzidis e379ee31c0 Introduce Preprocessor::getTotalMemory() and use it in CIndex.cpp, no functionality change.
llvm-svn: 134103
2011-06-29 22:20:04 +00:00
Eli Friedman 03aff72eff Revert unintentional commit.
llvm-svn: 133971
2011-06-28 00:03:31 +00:00
Eli Friedman 5f3ab2248c Merge some calls to FoldingSetNodeID::AddInteger; assuming my measurements aren't completely off, roughly a 1% speedup on SingleSource/UnitTests/ObjC/trivial-interface.m .
llvm-svn: 133968
2011-06-27 23:58:21 +00:00
Argyrios Kyrtzidis d289104e29 [libclang] Avoid having the cursor of an expression replace the declaration cursor
when the expression source range overlaps the declaration range.

This can happen for C++ constructor expressions whose range generally
include the variable declaration, e.g.:

  MyCXXClass foo; // Make sure pointing at 'foo' returns a VarDecl cursor.

rdar://9124499.

llvm-svn: 133930
2011-06-27 19:42:23 +00:00