Commit Graph

19594 Commits

Author SHA1 Message Date
Anders Carlsson 2a4adbea96 Add a DenseMapInfo specialization for BaseSubobject.
llvm-svn: 93399
2010-01-14 01:39:42 +00:00
Douglas Gregor 69a8e083c5 When providing completions for a member access expression in C++,
provided nested-name-specifier results for base classes (only), rather
than everything that could possibly be a nested-name-specifier.

llvm-svn: 93398
2010-01-14 01:17:14 +00:00
Douglas Gregor c580c5205f Switch code-completion for ordinary names over to the new(ish)
LookupVisibleDecls, unifying the name lookup mechanisms used by code
completion and typo correction. Aside from the software-engineering
improvements, this makes code-completion see through using directives
and see ivars when performing unqualified name lookup in an
Objective-C instance method.

llvm-svn: 93397
2010-01-14 01:09:38 +00:00
John McCall a1709fd822 Improve the diagnostic for bad conversions in overload resolution to talk
about 'object argument' vs. 'nth argument'.

llvm-svn: 93395
2010-01-14 00:56:20 +00:00
John McCall 9015cde4dc Add the %ordinal format modifier for turning '1' into '1st'. Hard-coded for
English right now;  would not be impossible to grab a special format string
from the diagnostic pool and localize that way.

llvm-svn: 93390
2010-01-14 00:50:32 +00:00
Devang Patel 4274a326be Because CurLoc is the current source location as far as CGDebugInfo is concerned. It is expected that this is set (usually left bracket location of function body compound statement) before EmitfunctionStart() is used.
llvm-svn: 93389
2010-01-14 00:48:09 +00:00
Douglas Gregor e0717ab39c More refactoring of ResultBuilder::MaybeAddResult. No intended
functionality change.

llvm-svn: 93386
2010-01-14 00:41:07 +00:00
Devang Patel 934661ed73 Emit human readable names for c/c++ functions. Avoid emitting linkage name if it matches regular name.
llvm-svn: 93383
2010-01-14 00:36:21 +00:00
Fariborz Jahanian e2dd5428e6 Fix a bug in rewrite whereby functions using blocks put extern "C" in wrong place.
Fixes radar 7284618.

llvm-svn: 93382
2010-01-14 00:35:56 +00:00
Douglas Gregor 7c208616b4 Refactor the "is this declaration interesting" logic in
code-completion's ResultBuilder::MaybeAddResult for later reuse.

llvm-svn: 93379
2010-01-14 00:20:49 +00:00
Douglas Gregor 0235c4243f Look through using declarations when determining whether one decl hides another
llvm-svn: 93378
2010-01-14 00:06:47 +00:00
John McCall e4d5432136 Perform format-expansion on %select results.
llvm-svn: 93377
2010-01-13 23:58:20 +00:00
Douglas Gregor f98e6a28e4 Banish the notion of a "rank" for code-completion results, since we
are no longer using it for anything. No intended functionality change.

llvm-svn: 93376
2010-01-13 23:51:12 +00:00
Douglas Gregor 52ce62f069 Improve the sorting of code-completion results. We now always sort by
the "typed" text, first, then take into account
nested-name-specifiers, name hiding, etc. This means that the
resulting sort is actually alphabetical :)

llvm-svn: 93370
2010-01-13 23:24:38 +00:00
John McCall e8c8cd2a58 Don't report ambiguities in the user-defined conversion if we weren't supposed
to be considering user-defined conversions in the first place.

Doug, please review;  I'm not sure what we should be doing if we see a real
ambiguity in selecting a copy constructor when otherwise suppressing
user-defined conversions.

Fixes PR6014.

llvm-svn: 93365
2010-01-13 22:30:33 +00:00
John McCall 02bc54d11c Don't a.k.a. through the primary typedef of an anonymous tag decl.
llvm-svn: 93362
2010-01-13 22:07:44 +00:00
Douglas Gregor 48d462573d Code-completion for @public, @protected, @private, @package.
llvm-svn: 93361
2010-01-13 21:54:15 +00:00
Ted Kremenek d5c6eafe09 Reorganize CIndex.cpp into clearer sections of functions, and add a utility function 'MakeCXCursor' to centralize the logic for creating CXCursor objects.
llvm-svn: 93359
2010-01-13 21:46:36 +00:00
Fariborz Jahanian d0bbf66895 Fixes a rewrite bug rewriting a block call argument which has a trvial
constructor. Fixes radar 7537770.

llvm-svn: 93358
2010-01-13 21:41:11 +00:00
Douglas Gregor f193416359 Whenever completing ordinary names for an Objective-C source, also
provide completions for @ keywords. Previously, we only provided
@-completions after an @ was actually typed, which is useful but
probably not the common case.

Also, make sure a few Objective-C 2.0 completions only show up when
Objective-C 2.0 support is enabled (the default).

llvm-svn: 93354
2010-01-13 21:24:21 +00:00
Mike Stump 6f0bf82622 Fix Release-Asserts.
llvm-svn: 93353
2010-01-13 21:23:04 +00:00
Mike Stump 8521f06ced Fix for Release-Assert.
llvm-svn: 93348
2010-01-13 20:58:35 +00:00
Mike Stump 2f7b246a47 Fix for Release-Asserts.
llvm-svn: 93347
2010-01-13 20:57:29 +00:00
Mike Stump 5c1e7259f1 Fix Release-Asserts.
llvm-svn: 93346
2010-01-13 20:43:31 +00:00
Anders Carlsson 20871481d2 Add a BaseSubobject class to uniquely identify a base class subobject. Not yet used.
llvm-svn: 93345
2010-01-13 20:11:15 +00:00
John McCall e8595036c4 Add type source information for both kinds of typeof types.
Patch by Enea Zaffanella.

llvm-svn: 93344
2010-01-13 20:03:27 +00:00
Ted Kremenek e14e372b67 Add 'referringDecl' field to CXCursor to prepare the way to better model declaration references from other delcarations.
llvm-svn: 93343
2010-01-13 19:59:20 +00:00
Mike Stump 92d487712e Fix for Release-Asserts.
llvm-svn: 93340
2010-01-13 19:40:37 +00:00
Fariborz Jahanian 3f7b8b274d Predefine __weak attribute when doing objective-c
rewriting for any target. (refixes radar 7530235).

llvm-svn: 93331
2010-01-13 18:51:17 +00:00
Ted Kremenek 95ae5e16b9 Add extra null check in clang_disposeString().
llvm-svn: 93328
2010-01-13 18:45:36 +00:00
Douglas Gregor 9de54ea41b Reimplement constructor declarator parsing to cope with template-ids
that name constructors, the endless joys of out-of-line constructor
definitions, and various other corner cases that the previous hack
never imagined. Fixes PR5688 and tightens up semantic analysis for
constructor names.

Additionally, fixed a problem where we wouldn't properly enter the
declarator scope of a parenthesized declarator. We were entering the
scope, then leaving it when we saw the ")"; now, we re-enter the
declarator scope before parsing the parameter list.

Note that we are forced to perform some tentative parsing within a
class (call it C) to tell the difference between

  C(int); // constructor

and

  C (f)(int); // member function

which is rather unfortunate. And, although it isn't necessary for
correctness, we use the same tentative-parsing mechanism for
out-of-line constructors to improve diagnostics in icky cases like:

  C::C C::f(int); // error: C::C refers to the constructor name, but
                  // we complain nicely and recover by treating it as
                  // a type.

llvm-svn: 93322
2010-01-13 17:31:36 +00:00
Douglas Gregor b89b99f1f2 Fix pasto in __has_feature(cxx_lambdas) docs
llvm-svn: 93320
2010-01-13 16:27:49 +00:00
John McCall 6a61b5203d 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.

llvm-svn: 93316
2010-01-13 09:16:55 +00:00
Alexis Hunt c88db06565 Implement semantic checking for C++ literal operators.
This now rejects literal operators that don't meet the requirements.
Templates are not yet checked for.

llvm-svn: 93315
2010-01-13 09:01:02 +00:00
Alexis Hunt 10e2f7264e Update test function names so as not to use potential keywords.
llvm-svn: 93314
2010-01-13 08:58:42 +00:00
Alexis Hunt af4e28d897 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.

llvm-svn: 93312
2010-01-13 08:31:49 +00:00
John McCall 6d11e07b16 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).

llvm-svn: 93299
2010-01-13 06:44:51 +00:00
Chris Lattner 3d756f1a9e diagnose invalid values of -ftabstop, patch by Christian Adaker!
llvm-svn: 93288
2010-01-13 03:06:50 +00:00
Mike Stump 1bacb81d6f Add an unreachable code checker.
llvm-svn: 93287
2010-01-13 02:59:54 +00:00
Daniel Dunbar 4f2bc55d4e 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.

llvm-svn: 93282
2010-01-13 00:48:06 +00:00
Daniel Dunbar 7d38d4da61 cc1: Lift creation of the FrontendAction higher.
llvm-svn: 93281
2010-01-13 00:47:51 +00:00
John McCall e1ac8d1742 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.

llvm-svn: 93277
2010-01-13 00:25:19 +00:00
Ted Kremenek 78668fdcfb Move definitions for visitor methods in CDeclVisitor out-of-line.
llvm-svn: 93276
2010-01-13 00:22:49 +00:00
Ted Kremenek 1351b09b04 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.

llvm-svn: 93275
2010-01-13 00:13:47 +00:00
Douglas Gregor 08dc584c3f 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>.

llvm-svn: 93274
2010-01-13 00:12:48 +00:00
Fariborz Jahanian 6fada5be91 When in objective-c methods, do the built-in name lookup after
ivar name lookup. Fixes pr5986.

llvm-svn: 93271
2010-01-12 23:58:59 +00:00
Ted Kremenek 58a6a8ec62 Add USR printing modes to c-index-test.
llvm-svn: 93269
2010-01-12 23:34:26 +00:00
Ted Kremenek a188cbbf29 Make clang_getDeclUSR() visible.
llvm-svn: 93268
2010-01-12 23:34:05 +00:00
Ted Kremenek cb674f9492 Rename clang_getUSR() -> clang_getDeclUSR(). For now we take a CXDecl instead of a CXEntity.
Enhance USR generation a bit with support for records.

llvm-svn: 93267
2010-01-12 23:33:42 +00:00
Douglas Gregor 49862b8285 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.

llvm-svn: 93266
2010-01-12 23:18:54 +00:00