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

604 Коммитов

Автор SHA1 Сообщение Дата
Argyrios Kyrtzidis e6825d39e8 [libclang] Fix crash when a #pragma diagnostic is included in the preamble.
A PCH file keeps track of #pragma diagnostics state; when loading the preamble, they conflicted
with the #pragma diagnostic state already present in the DiagnosticsEngine object due to
parsing the preamble.

Fix this by clearing the state of the DiagnosticsEngine object.
Fixes rdar://10363572 && http://llvm.org/PR11254.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143644 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-03 20:28:19 +00:00
Douglas Gregor 2c628646b8 Force test to use the non-fragile ABI
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143642 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-03 19:58:50 +00:00
Argyrios Kyrtzidis ea0e4e8466 [libclang] Make sure pointing inside the #include of the fields will return the struct.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143638 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-03 19:02:30 +00:00
Argyrios Kyrtzidis dc35aacba2 [libclang] Add a test for "targeting" a field inside an #include that only
contains fields.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143636 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-03 19:01:07 +00:00
Douglas Gregor f3c02869a7 Extend IsSimplyAccessible to check for Objective-C instance variable
accessibility. Fixes <rdar://problem/3727335>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143635 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-03 19:00:24 +00:00
Argyrios Kyrtzidis dfb332d008 [libclang] Add infrastructure to be able to only deserialize decls in a file region and
use it for clang_getCursor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143605 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-03 02:20:32 +00:00
Douglas Gregor 25270b6e6a Add a printing policy flag to suppress printing "<anonymous>::" prior
to types. Enable this flag for code completion, where knowing whether
something is in an anonymous or inline namespace is actually not
useful, since you don't have to type it anyway. Fixes
<rdar://problem/10208818>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143599 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-03 00:16:13 +00:00
Douglas Gregor 3dd0f76fd7 Test code completion for constructor initializers within the class
definition. This already worked; <rdar://problem/10208871>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143595 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-02 23:39:56 +00:00
Argyrios Kyrtzidis d4e7e22a91 [libclang] Fix non-darwin buildbots.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143477 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-01 19:47:41 +00:00
Argyrios Kyrtzidis 87ec9c257c [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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143464 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-01 17:14:12 +00:00
Ted Kremenek 2ce634dbb2 Mark these tests as requiring use of the shell.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143150 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-27 21:50:13 +00:00
Ted Kremenek 1872b3153a Move ASTUnit's handling of temporary files and the preamble file into a lazily-created static DenseMap. This DenseMap is cleared (and the files erased) via an atexit routine in the case an ASTUnit is not destroyed. Fixes <rdar://problem/10293367>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143115 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-27 17:55:18 +00:00
Douglas Gregor 1b8fc01f16 Disalbe more Microsoft-specific stuff.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143077 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-26 23:19:04 +00:00
Douglas Gregor 29e627ad96 Try to appease the Windows builders
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143048 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-26 20:33:43 +00:00
Douglas Gregor d488b3a046 Eliminate a hang while loading a sequence of redeclarable entities. In
essence, the redeclaration chain for a class could end up in an
inconsistent state while deserializing multiple declarations in that
chain, where the circular linked list was not, in fact,
circular. Since only two redeclarations of the same entity will get
loaded when we're in this state, restore circularity when both have
been loaded. Fixes <rdar://problem/10324940> / PR11195.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143037 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-26 17:53:41 +00:00
Douglas Gregor fd08009cba Turn off delayed template parsing for this test
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142951 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-25 20:12:15 +00:00
Douglas Gregor ba0513de93 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".


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142901 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-25 01:33:02 +00:00
Douglas Gregor ab795d6523 Tweak this test to test more directly what we want, and hopefully work around the brokenness of code completion under -fdelayed-template-parsing
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142472 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-19 04:17:22 +00:00
Douglas Gregor fa43c97297 Minor tweak to test
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142427 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-18 21:43:22 +00:00
Douglas Gregor 8ca7208d0f Provide result types for code completions that describe built-in
expressions (this, sizeof, etc.).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142424 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-18 21:20:17 +00:00
Argyrios Kyrtzidis 46d1ea40d7 [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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142361 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-18 16:50:06 +00:00
Douglas Gregor a50216cdd5 Add code completions for C++0x expressions
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142357 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-18 16:29:03 +00:00
Douglas Gregor ee1c68a0d9 Don't format the code completion for parameters of block literal
arguments as block literal arguments; the block literal argument code
completion should only go one level deep. Fixes <rdar://problem/10291294>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142335 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-18 04:23:19 +00:00
Erik Verbruggen c35cba4a54 Fixed merge-mistake where ActOnAccessSpecifier was called twice for every access specifier. The testcase has been changed to catch this too.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142186 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-17 09:54:52 +00:00
Erik Verbruggen 6164ea1d75 Added clang_getCompletionAnnotation and clang_getCompletionNumAnnotations to
retrieve annotations from completion string.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141953 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-14 15:31:08 +00:00
Richard Smith 762bb9d0ad Update all tests other than Driver/std.cpp to use -std=c++11 rather than
-std=c++0x. Patch by Ahmed Charles!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141900 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-13 22:29:44 +00:00
Erik Verbruggen 5f1c822def Allow for annotate attributes after access specifiers. When such
attributes are found, propagate them to subsequent declarations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141861 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-13 09:41:32 +00:00
Douglas Gregor b008012426 Don't crash in Sema::IsSimplyAccessible if the declaration is not a C++ class member. Fixes PR11108.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141600 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-10 23:44:35 +00:00
Erik Verbruggen d12059673d Added CXAvailability_NotAccessible to indicate that a declaration is available, but not accessible from the current code completion context.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141278 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-06 07:27:49 +00:00
Argyrios Kyrtzidis aed123ec3c [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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141277 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-06 07:00:54 +00:00
Douglas Gregor 42b2984771 Expose more statement, expression, and declaration kinds in libclang,
from Manuel Holtgrewe!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141200 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-05 19:00:14 +00:00
Argyrios Kyrtzidis 1711fc91ef 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 '@'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141061 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-04 04:48:02 +00:00
Rafael Espindola f87cced71a Propagate __attribute__((returns_twice)) from C to IL.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141002 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-03 14:59:42 +00:00
John McCall 80d2355df4 Sorry, I misunderstood the interaction here; the GNU runtime does
support both a fragile and non-fragile ABI, and it can be selected at
runtime.  That driver option also works on Darwin (although obviously
the code is not necessarily usable if the system runtime is fragile)
so just do that.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140973 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-02 20:27:18 +00:00
John McCall 591dbc7b0c Use -fgnu-runtime to force the use of the non-fragile ABI;
otherwise these tests would fail on hosts that happen to default
to that, since that affects whether default synthesis can happen.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140970 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-02 11:28:21 +00:00
Chandler Carruth 4768b9c771 Temporarily XFAIL this test until John or someone else who works on ObjC
can look at it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140968 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-02 09:52:36 +00:00
John McCall d1e40d5389 Make -fobjc-nonfragile-abi the -cc1 default, since it's the
increasingly prevailing case to the point that new features
like ARC don't even support the fragile ABI anymore.

This required a little bit of reshuffling with exceptions
because a check was assuming that ObjCNonFragileABI was
only being set in ObjC mode, and that's actually a bit
obnoxious to do.

Most, though, it involved a perl script to translate a ton
of test cases.

Mostly no functionality change for driver users, although
there are corner cases with disabling language-specific
exceptions that we should handle more correctly now.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140957 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-02 01:16:38 +00:00
Argyrios Kyrtzidis 2dfdb948be [libclang] Introduce CXCursor_CXXAccessSpecifier for C++'s public:/private:/protected: specifiers.
Patch by Paolo Capriotti!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140864 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-30 17:58:23 +00:00
Ted Kremenek 2f041d0b12 Like IBOutletCollection, it only makes sense to apply the IBOutlet annotation to Objective-C object types. Fixes <rdar://problem/10142685>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140778 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-29 07:02:25 +00:00
Ted Kremenek d2ee809f9e Include prefix with default synthesized ivars.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140657 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-27 23:39:40 +00:00
Douglas Gregor 30c4240420 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>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140650 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-27 22:38:19 +00:00
Argyrios Kyrtzidis 5f0bfc5222 [libclang] Expose array size and element type, patch by Vinay Sajip!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140614 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-27 17:44:34 +00:00
Argyrios Kyrtzidis 65ab90736e [libclang] Report implicit objc methods for properties when indexing.
Related to rdar://10087069.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140551 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-26 19:05:37 +00:00
Argyrios Kyrtzidis ee0f84fc84 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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140519 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-26 08:01:41 +00:00
Argyrios Kyrtzidis 2502efd261 [libclang] When pointing at a macro expansion inside a macro argument,
return a cursor for the inner macro.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140207 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-20 23:27:33 +00:00
Argyrios Kyrtzidis 50402470f0 For SourceManager::isBeforeInTranslationUnit, a location pointing
inside a macro argument should be regarded as coming before
the location of the expanded tokens.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140053 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-19 20:39:57 +00:00
Argyrios Kyrtzidis e24692b30a [PCH] Overhaul how preprocessed entities are [de]serialized.
-Use an array of offsets for all preprocessed entities
-Get rid of the separate array of offsets for just macro definitions;
 for references to macro definitions use an index inside the preprocessed
 entities array.
-Deserialize each preprocessed entity lazily, at first request; not in bulk.

Paves the way for binary searching of preprocessed entities that will offer
efficiency and will simplify things on the libclang side a lot.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139809 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-15 18:02:56 +00:00
Argyrios Kyrtzidis 221d5a5005 [libclang] Correct annotation and taking of cursor for objc class references
inside the IBOutletCollection attribute.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139621 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-13 18:49:56 +00:00
Argyrios Kyrtzidis 6639e92554 [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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139609 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-13 17:39:31 +00:00
Argyrios Kyrtzidis c2954616fb [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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139547 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-12 22:17:26 +00:00