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

18406 Коммитов

Автор SHA1 Сообщение Дата
John McCall adbb8f8aa4 Record some basic information about bad conversion sequences. Use that
information to feed diagnostics instead of regenerating it.  Much room for
improvement here, but fixes some unfortunate problems reporting on method calls.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93316 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 09:16:55 +00:00
Sean Hunt a6c058dd75 Implement semantic checking for C++ literal operators.
This now rejects literal operators that don't meet the requirements.
Templates are not yet checked for.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93315 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 09:01:02 +00:00
Sean Hunt 1248451dcb Update test function names so as not to use potential keywords.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93314 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 08:58:42 +00:00
Sean Hunt 4ef4c6b232 Add a bunch more feature-checking macros for C++0x features. Some of these are
disabled with the intent that users can start with them now and not have to change
a thing to have them work when we implement the features.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93312 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 08:31:49 +00:00
John McCall 7ae4373bde Insert clang-flags into the clang command. Currently it needs to be a list;
future work should permit strings (by splitting them into a list o' strings).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93299 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 06:44:51 +00:00
Chris Lattner 52388f9aef diagnose invalid values of -ftabstop, patch by Christian Adaker!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93288 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 03:06:50 +00:00
Mike Stump fa6ef180c0 Add an unreachable code checker.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93287 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 02:59:54 +00:00
Daniel Dunbar 0397af277e cc1: Factor out CompilerInstance::ExecuteAction which has the majority of the
clang -cc1 logic for running an action against a set of options.
 - This should make it easier to build tools that have a clang -cc1 like
   interface, but aren't actually part of clang -cc1.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93282 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 00:48:06 +00:00
Daniel Dunbar a817b77bbb cc1: Lift creation of the FrontendAction higher.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93281 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 00:47:51 +00:00
John McCall 220ccbf2c9 Improve the reporting of non-viable overload candidates by noting the reason
why the candidate is non-viable.  There's a lot we can do to improve this, but
it's a good start.  Further improvements should probably be integrated with the
bad-initialization reporting routines.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93277 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 00:25:19 +00:00
Ted Kremenek dd6bcc5f79 Move definitions for visitor methods in CDeclVisitor out-of-line.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93276 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 00:22:49 +00:00
Ted Kremenek f128618615 Make method definitions in TUVisitor out-of-line, making it easy to tell what visitor methods are defined.
Generalize TUVisitor to take a general "root" and "iterator" callback; this is prep. work to merging TUVisitor and CDeclVisitor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93275 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 00:13:47 +00:00
Douglas Gregor 4f123ffe49 Remove broken fix-it when a default function argument has been
redefined. There's a FIXME with an apology about why we don't try to
do better here. Fixes <rdar://problem/7513023>.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93274 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 00:12:48 +00:00
Fariborz Jahanian 48c2d562fb When in objective-c methods, do the built-in name lookup after
ivar name lookup. Fixes pr5986.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93271 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-12 23:58:59 +00:00
Ted Kremenek 7d40562f83 Add USR printing modes to c-index-test.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93269 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-12 23:34:26 +00:00
Ted Kremenek 4a884fda19 Make clang_getDeclUSR() visible.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93268 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-12 23:34:05 +00:00
Ted Kremenek c50277f748 Rename clang_getUSR() -> clang_getDeclUSR(). For now we take a CXDecl instead of a CXEntity.
Enhance USR generation a bit with support for records.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93267 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-12 23:33:42 +00:00
Douglas Gregor d1e4d9bfd5 Don't emit string-comparison or self-comparison warnings in
unevaluated contexts, because they only matter for code that will
actually be evaluated at runtime.

As part of this, I had to extend PartialDiagnostic to support fix-it
hints.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93266 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-12 23:18:54 +00:00
Mike Stump 58002f9683 Remove unused code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93262 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-12 22:20:00 +00:00
Chris Lattner c165f12f48 testcase for -ftabstop, patch by Christian Adaker!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93260 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-12 22:06:58 +00:00
Chris Lattner cb329c506d use DiagRuntimeBehavior to silence the div/rem by zero warning when
not in an evaluated context.  This removes some bogus warnings.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93258 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-12 21:30:55 +00:00
Douglas Gregor 84d0a19828 Improve recovery for template-ids whose template-name doesn't actually
name a template, when they occur in a base-specifier. This is one of
the (few) places where we know for sure that an identifier followed by
a '<' must be a template name, so we can diagnose and recover well:

test/SemaTemplate/dependent-base-classes.cpp:9:16: error: missing
'template'
      keyword prior to dependent template name 'T::apply'
struct X1 : T::apply<U> { }; // expected-error{{missing 'template' ...
               ^
               template 
test/SemaTemplate/dependent-base-classes.cpp:12:13: error: unknown
template name
      'vector'
struct X2 : vector<T> { }; // expected-error{{unknown template name
'vector'}}
            ^
2 diagnostics generated.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93257 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-12 21:28:44 +00:00
Chris Lattner 7ef655a788 implement PR6004, warning about divide and remainder by zero.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93256 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-12 21:23:57 +00:00
Chris Lattner a1e1dc77e9 implement PR6007, diagnosing invalid attribute((section))
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93255 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-12 20:58:53 +00:00
Mike Stump cffd516070 Improve covariance tester to randomize the return value more.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93254 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-12 20:55:39 +00:00
Chandler Carruth 5535c38a2f Fix the CodeGen half of PR5911 by changing reference initialization to
correctly look through arrays to see cv-qualifiers. Also enhances the routine
for doing this to preserve more type sugaring for diagnostics.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93252 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-12 20:32:25 +00:00
Ted Kremenek e9cde116a9 Further tweaking of USR generation. WIP.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93250 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-12 19:35:53 +00:00
Ted Kremenek 98271567b6 Make 'CXTranslationUnitIterator' an argument to perform_test_load(),
perform_test_load_tu(), and perform_test_load_source().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93248 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-12 18:53:15 +00:00
Fariborz Jahanian 453c1349a5 Define __weak attribute for objective-c pointers in
win32 targets. Fixes radar 7530235. Daniel please review.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93246 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-12 18:33:57 +00:00
Douglas Gregor d9b600c1a5 Parse dependent template-ids in base clauses and member
initializers. This isn't actually in the C++ grammar (in any version),
but that's clearly an oversight: both GCC and EDG support this syntax,
and it's used within Boost code. I'll file a core issue proposing
precisely the change made here. Fixes PR6008.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93243 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-12 17:52:59 +00:00
Fariborz Jahanian 26337b2f6d Improve on objective-c pointer recognition
during rewrite. No functionality chang.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93241 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-12 17:31:23 +00:00
Douglas Gregor 2e9338824f When determining whether a given name is a template in a dependent
context, do not attempt typo correction. This harms performance (as
Abramo noted) and can cause some amusing errors, as in this new
testcase.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93240 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-12 17:06:20 +00:00
Benjamin Kramer 148299f5eb Fix tests for r93231.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93238 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-12 11:52:20 +00:00
Benjamin Kramer 9895c6ab2a Remove trailing semicolons and silence MSVC warning about C linkage.
warning C4190: 'GetEntity' has C-linkage specified, but returns UDT
'clang::idx::Entity' which is incompatible with C


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93237 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-12 11:32:40 +00:00
John McCall cbce60633c So I was sitting around, trying vainly to think of something to commit, and then
I said to myself, self, why don't you go add a couple of parameters to a method
and then fail to use them, and I thought that sounded like a pretty good idea,
so I did it.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93233 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-12 07:18:19 +00:00
Douglas Gregor 834389b874 Use horizontal-space markers in code-completion results rather than
embedding single space characters. <rdar://problem/7485503>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93231 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-12 06:38:28 +00:00
Mike Stump 72e933e998 Add covariance tester.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93226 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-12 03:01:18 +00:00
Daniel Dunbar 140fce2e7f Remove duplicate class name, MSVC doesn't like this.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93225 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-12 02:34:07 +00:00
John McCall 3c80f573df Reorganize some of the code to note overload candidates. Improves the
fidelity with which we note them as functions/constructors and templates
thereof.  Also will be helpful when reporting bad conversions (next).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93224 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-12 02:15:36 +00:00
Ted Kremenek 8776382f7e Add a boilerplate implementation for clang_getUSR(). WIP.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93223 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-12 02:07:58 +00:00
Fariborz Jahanian 66867c526c Fix rewriting of MacOS sjlj based eh.
Fixes radar 7522880.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93219 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-12 01:22:23 +00:00
Douglas Gregor 3f477a1a80 Name lookup should know better than to look into a class before it's defined
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93217 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-12 01:17:50 +00:00
John McCall 4248491ce4 Chris thinks these diagnostics are better now. :)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93216 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-12 01:09:12 +00:00
John McCall bf65c0bb57 Sort overload results by viability.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93215 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-12 00:48:53 +00:00
John McCall 1d31833450 Introduce a specific representation for the ambiguous implicit conversion
sequence.  Lots of small relevant changes.  Fixes some serious problems with
ambiguous conversions;  also possibly improves associated diagnostics.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93214 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-12 00:44:57 +00:00
Ted Kremenek 1fc00e6e49 Change clang_getUSR() to return a CXString instead of a 'const char *'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93213 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-12 00:38:53 +00:00
Ted Kremenek 4b333d2215 Make createCXString() a static member function of class CIndex.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93212 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-12 00:36:38 +00:00
Mike Stump 66d29ec664 Allow N_FIELDS to be 0.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93211 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-12 00:28:59 +00:00
Ted Kremenek 3172383341 CIndex:
- Remove unused (and unimplemented) clang_getDeclarationName().
- Remove unused (and unimplemented) clang_getEntity().
- Add clang_getEntityFromDecl(): maps from a CXDecl to a CXEntity)
- Add clang_getDeclaration(): maps from a (CXEntity, CXTranslationUnit) to a CXDecl).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93209 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-11 23:56:39 +00:00
Douglas Gregor b862b8f934 Eliminate an embarrassing performance regression in C/ObjC, where we
were performing name lookup for template names in C/ObjC and always
finding nothing. Turn off such lookup unless we're in C++ mode, along
with the check that determines whether the given identifier is a
"current class name", and assert that we don't make this mistake
again.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93207 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-11 23:29:10 +00:00