]> granicus.if.org Git - clang/log
clang
14 years agoSwitch a few callers of MaybeAddResult over to AddResult, when the
Douglas Gregor [Thu, 14 Jan 2010 16:14:35 +0000 (16:14 +0000)]
Switch a few callers of MaybeAddResult over to AddResult, when the
declarations we're adding do not need any name-hiding checks.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93431 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSwitch code-completion's ivar lookup over to LookupVisibleDecls,
Douglas Gregor [Thu, 14 Jan 2010 16:08:12 +0000 (16:08 +0000)]
Switch code-completion's ivar lookup over to LookupVisibleDecls,
eliminating yet one more ResultBuilder::MaybeAddResult caller.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93430 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoStart migrating code-completion results from
Douglas Gregor [Thu, 14 Jan 2010 16:01:26 +0000 (16:01 +0000)]
Start migrating code-completion results from
ResultBuilder::MaybeAddResult over to ResultBuilder::AddResult.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93429 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSwitch the remaining code completions over to LookupVisibleDecls,
Douglas Gregor [Thu, 14 Jan 2010 15:47:35 +0000 (15:47 +0000)]
Switch the remaining code completions over to LookupVisibleDecls,
after adding the ability to determine whether our lookup is a
base-class lookup. Eliminate CollectMemberLookupResults, since it is
no longer used (yay).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93428 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMade ObjC method name mangling match GCC (which does it in a stupid and broken way...
David Chisnall [Thu, 14 Jan 2010 14:08:19 +0000 (14:08 +0000)]
Made ObjC method name mangling match GCC (which does it in a stupid and broken way that can give conflicts on method names containing underscores, but is needed for gdb to work because gdb does not know how to read ObjC class tables and relies on the mangling).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93427 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix pr6035.
Zhongxing Xu [Thu, 14 Jan 2010 03:45:06 +0000 (03:45 +0000)]
Fix pr6035.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93422 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMove code completion for qualified name lookup (foo::) to
Douglas Gregor [Thu, 14 Jan 2010 03:35:48 +0000 (03:35 +0000)]
Move code completion for qualified name lookup (foo::) to
LookupVisibleDecls. Also, a function does not hide another function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93421 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoImprove overload diagnostics some more by calling out qualifier mismatches
John McCall [Thu, 14 Jan 2010 03:28:57 +0000 (03:28 +0000)]
Improve overload diagnostics some more by calling out qualifier mismatches
for special diagnostics.  Unfortunately, the non-overload diagnostics are not
this good.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93420 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoEliminate the code-completion-specifier CollectLookupResults in favor
Douglas Gregor [Thu, 14 Jan 2010 03:27:13 +0000 (03:27 +0000)]
Eliminate the code-completion-specifier CollectLookupResults in favor
of the more general LookupVisibleDecls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93419 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSimplify the code-completion logic for nested-name-specifiers: rather
Douglas Gregor [Thu, 14 Jan 2010 03:21:49 +0000 (03:21 +0000)]
Simplify the code-completion logic for nested-name-specifiers: rather
than traversing visible declarations twice, only perform one traversal
and recognize nested-name-specifiers as special.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93418 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDon't assume a random access iterator, instead just use CFG::iterator.
Mike Stump [Thu, 14 Jan 2010 02:45:29 +0000 (02:45 +0000)]
Don't assume a random access iterator, instead just use CFG::iterator.
Thanks Ted.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93413 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoStore the address points for constructor vtables directly in the VTT builder, because...
Anders Carlsson [Thu, 14 Jan 2010 02:29:07 +0000 (02:29 +0000)]
Store the address points for constructor vtables directly in the VTT builder, because that's the only time they're needed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93412 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAvoid snowballing errors into additional warnings. To do better, we'd
Mike Stump [Thu, 14 Jan 2010 02:26:52 +0000 (02:26 +0000)]
Avoid snowballing errors into additional warnings.  To do better, we'd
need an error term for the CFG.  I suspect we'll always have to cope
with getCFG returning 0, though, I'd love to see even that possibility
removed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93411 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSwitch return site to use clang_getNullCursor().
Ted Kremenek [Thu, 14 Jan 2010 01:51:23 +0000 (01:51 +0000)]
Switch return site to use clang_getNullCursor().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93405 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFurther tweak USR generation by shorting names and distinguish between namespaces...
Ted Kremenek [Thu, 14 Jan 2010 01:50:21 +0000 (01:50 +0000)]
Further tweak USR generation by shorting names and distinguish between namespaces and functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93404 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd a DenseMapInfo specialization for BaseSubobject.
Anders Carlsson [Thu, 14 Jan 2010 01:39:42 +0000 (01:39 +0000)]
Add a DenseMapInfo specialization for BaseSubobject.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93399 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoWhen providing completions for a member access expression in C++,
Douglas Gregor [Thu, 14 Jan 2010 01:17:14 +0000 (01:17 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93398 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSwitch code-completion for ordinary names over to the new(ish)
Douglas Gregor [Thu, 14 Jan 2010 01:09:38 +0000 (01:09 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93397 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoImprove the diagnostic for bad conversions in overload resolution to talk
John McCall [Thu, 14 Jan 2010 00:56:20 +0000 (00:56 +0000)]
Improve the diagnostic for bad conversions in overload resolution to talk
about 'object argument' vs. 'nth argument'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93395 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd the %ordinal format modifier for turning '1' into '1st'. Hard-coded for
John McCall [Thu, 14 Jan 2010 00:50:32 +0000 (00:50 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93390 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoBecause CurLoc is the current source location as far as CGDebugInfo is concerned...
Devang Patel [Thu, 14 Jan 2010 00:48:09 +0000 (00:48 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93389 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMore refactoring of ResultBuilder::MaybeAddResult. No intended
Douglas Gregor [Thu, 14 Jan 2010 00:41:07 +0000 (00:41 +0000)]
More refactoring of ResultBuilder::MaybeAddResult. No intended
functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93386 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoEmit human readable names for c/c++ functions. Avoid emitting linkage name if it...
Devang Patel [Thu, 14 Jan 2010 00:36:21 +0000 (00:36 +0000)]
Emit human readable names for c/c++ functions. Avoid emitting linkage name if it matches regular name.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93383 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix a bug in rewrite whereby functions using blocks put extern "C" in wrong place.
Fariborz Jahanian [Thu, 14 Jan 2010 00:35:56 +0000 (00:35 +0000)]
Fix a bug in rewrite whereby functions using blocks put extern "C" in wrong place.
Fixes radar 7284618.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93382 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRefactor the "is this declaration interesting" logic in
Douglas Gregor [Thu, 14 Jan 2010 00:20:49 +0000 (00:20 +0000)]
Refactor the "is this declaration interesting" logic in
code-completion's ResultBuilder::MaybeAddResult for later reuse.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93379 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoLook through using declarations when determining whether one decl hides another
Douglas Gregor [Thu, 14 Jan 2010 00:06:47 +0000 (00:06 +0000)]
Look through using declarations when determining whether one decl hides another

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93378 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoPerform format-expansion on %select results.
John McCall [Wed, 13 Jan 2010 23:58:20 +0000 (23:58 +0000)]
Perform format-expansion on %select results.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93377 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoBanish the notion of a "rank" for code-completion results, since we
Douglas Gregor [Wed, 13 Jan 2010 23:51:12 +0000 (23:51 +0000)]
Banish the notion of a "rank" for code-completion results, since we
are no longer using it for anything. No intended functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93376 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoImprove the sorting of code-completion results. We now always sort by
Douglas Gregor [Wed, 13 Jan 2010 23:24:38 +0000 (23:24 +0000)]
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 :)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93370 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDon't report ambiguities in the user-defined conversion if we weren't supposed
John McCall [Wed, 13 Jan 2010 22:30:33 +0000 (22:30 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93365 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDon't a.k.a. through the primary typedef of an anonymous tag decl.
John McCall [Wed, 13 Jan 2010 22:07:44 +0000 (22:07 +0000)]
Don't a.k.a. through the primary typedef of an anonymous tag decl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93362 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoCode-completion for @public, @protected, @private, @package.
Douglas Gregor [Wed, 13 Jan 2010 21:54:15 +0000 (21:54 +0000)]
Code-completion for @public, @protected, @private, @package.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93361 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoReorganize CIndex.cpp into clearer sections of functions, and add a utility function...
Ted Kremenek [Wed, 13 Jan 2010 21:46:36 +0000 (21:46 +0000)]
Reorganize CIndex.cpp into clearer sections of functions, and add a utility function 'MakeCXCursor' to centralize the logic for creating CXCursor objects.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93359 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFixes a rewrite bug rewriting a block call argument which has a trvial
Fariborz Jahanian [Wed, 13 Jan 2010 21:41:11 +0000 (21:41 +0000)]
Fixes a rewrite bug rewriting a block call argument which has a trvial
constructor. Fixes radar 7537770.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93358 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoWhenever completing ordinary names for an Objective-C source, also
Douglas Gregor [Wed, 13 Jan 2010 21:24:21 +0000 (21:24 +0000)]
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).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93354 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix Release-Asserts.
Mike Stump [Wed, 13 Jan 2010 21:23:04 +0000 (21:23 +0000)]
Fix Release-Asserts.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93353 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix for Release-Assert.
Mike Stump [Wed, 13 Jan 2010 20:58:35 +0000 (20:58 +0000)]
Fix for Release-Assert.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93348 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix for Release-Asserts.
Mike Stump [Wed, 13 Jan 2010 20:57:29 +0000 (20:57 +0000)]
Fix for Release-Asserts.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93347 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix Release-Asserts.
Mike Stump [Wed, 13 Jan 2010 20:43:31 +0000 (20:43 +0000)]
Fix Release-Asserts.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93346 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd a BaseSubobject class to uniquely identify a base class subobject. Not yet used.
Anders Carlsson [Wed, 13 Jan 2010 20:11:15 +0000 (20:11 +0000)]
Add a BaseSubobject class to uniquely identify a base class subobject. Not yet used.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93345 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd type source information for both kinds of typeof types.
John McCall [Wed, 13 Jan 2010 20:03:27 +0000 (20:03 +0000)]
Add type source information for both kinds of typeof types.
Patch by Enea Zaffanella.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93344 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd 'referringDecl' field to CXCursor to prepare the way to better model declaration...
Ted Kremenek [Wed, 13 Jan 2010 19:59:20 +0000 (19:59 +0000)]
Add 'referringDecl' field to CXCursor to prepare the way to better model declaration references from other delcarations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93343 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix for Release-Asserts.
Mike Stump [Wed, 13 Jan 2010 19:40:37 +0000 (19:40 +0000)]
Fix for Release-Asserts.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93340 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoPredefine __weak attribute when doing objective-c
Fariborz Jahanian [Wed, 13 Jan 2010 18:51:17 +0000 (18:51 +0000)]
Predefine __weak attribute when doing objective-c
rewriting for any target. (refixes radar 7530235).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93331 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd extra null check in clang_disposeString().
Ted Kremenek [Wed, 13 Jan 2010 18:45:36 +0000 (18:45 +0000)]
Add extra null check in clang_disposeString().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93328 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoReimplement constructor declarator parsing to cope with template-ids
Douglas Gregor [Wed, 13 Jan 2010 17:31:36 +0000 (17:31 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93322 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix pasto in __has_feature(cxx_lambdas) docs
Douglas Gregor [Wed, 13 Jan 2010 16:27:49 +0000 (16:27 +0000)]
Fix pasto in __has_feature(cxx_lambdas) docs

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93320 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRecord some basic information about bad conversion sequences. Use that
John McCall [Wed, 13 Jan 2010 09:16:55 +0000 (09:16 +0000)]
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

14 years agoImplement semantic checking for C++ literal operators.
Sean Hunt [Wed, 13 Jan 2010 09:01:02 +0000 (09:01 +0000)]
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

14 years agoUpdate test function names so as not to use potential keywords.
Sean Hunt [Wed, 13 Jan 2010 08:58:42 +0000 (08:58 +0000)]
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

14 years agoAdd a bunch more feature-checking macros for C++0x features. Some of these are
Sean Hunt [Wed, 13 Jan 2010 08:31:49 +0000 (08:31 +0000)]
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

14 years agoInsert clang-flags into the clang command. Currently it needs to be a list;
John McCall [Wed, 13 Jan 2010 06:44:51 +0000 (06:44 +0000)]
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

14 years agodiagnose invalid values of -ftabstop, patch by Christian Adaker!
Chris Lattner [Wed, 13 Jan 2010 03:06:50 +0000 (03:06 +0000)]
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

14 years agoAdd an unreachable code checker.
Mike Stump [Wed, 13 Jan 2010 02:59:54 +0000 (02:59 +0000)]
Add an unreachable code checker.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93287 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agocc1: Factor out CompilerInstance::ExecuteAction which has the majority of the
Daniel Dunbar [Wed, 13 Jan 2010 00:48:06 +0000 (00:48 +0000)]
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

14 years agocc1: Lift creation of the FrontendAction higher.
Daniel Dunbar [Wed, 13 Jan 2010 00:47:51 +0000 (00:47 +0000)]
cc1: Lift creation of the FrontendAction higher.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93281 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoImprove the reporting of non-viable overload candidates by noting the reason
John McCall [Wed, 13 Jan 2010 00:25:19 +0000 (00:25 +0000)]
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

14 years agoMove definitions for visitor methods in CDeclVisitor out-of-line.
Ted Kremenek [Wed, 13 Jan 2010 00:22:49 +0000 (00:22 +0000)]
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

14 years agoMake method definitions in TUVisitor out-of-line, making it easy to tell what visitor...
Ted Kremenek [Wed, 13 Jan 2010 00:13:47 +0000 (00:13 +0000)]
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

14 years agoRemove broken fix-it when a default function argument has been
Douglas Gregor [Wed, 13 Jan 2010 00:12:48 +0000 (00:12 +0000)]
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

14 years agoWhen in objective-c methods, do the built-in name lookup after
Fariborz Jahanian [Tue, 12 Jan 2010 23:58:59 +0000 (23:58 +0000)]
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

14 years agoAdd USR printing modes to c-index-test.
Ted Kremenek [Tue, 12 Jan 2010 23:34:26 +0000 (23:34 +0000)]
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

14 years agoMake clang_getDeclUSR() visible.
Ted Kremenek [Tue, 12 Jan 2010 23:34:05 +0000 (23:34 +0000)]
Make clang_getDeclUSR() visible.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93268 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRename clang_getUSR() -> clang_getDeclUSR(). For now we take a CXDecl instead of...
Ted Kremenek [Tue, 12 Jan 2010 23:33:42 +0000 (23:33 +0000)]
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

14 years agoDon't emit string-comparison or self-comparison warnings in
Douglas Gregor [Tue, 12 Jan 2010 23:18:54 +0000 (23:18 +0000)]
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

14 years agoRemove unused code.
Mike Stump [Tue, 12 Jan 2010 22:20:00 +0000 (22:20 +0000)]
Remove unused code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93262 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agotestcase for -ftabstop, patch by Christian Adaker!
Chris Lattner [Tue, 12 Jan 2010 22:06:58 +0000 (22:06 +0000)]
testcase for -ftabstop, patch by Christian Adaker!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93260 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agouse DiagRuntimeBehavior to silence the div/rem by zero warning when
Chris Lattner [Tue, 12 Jan 2010 21:30:55 +0000 (21:30 +0000)]
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

14 years agoImprove recovery for template-ids whose template-name doesn't actually
Douglas Gregor [Tue, 12 Jan 2010 21:28:44 +0000 (21:28 +0000)]
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

14 years agoimplement PR6004, warning about divide and remainder by zero.
Chris Lattner [Tue, 12 Jan 2010 21:23:57 +0000 (21:23 +0000)]
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

14 years agoimplement PR6007, diagnosing invalid attribute((section))
Chris Lattner [Tue, 12 Jan 2010 20:58:53 +0000 (20:58 +0000)]
implement PR6007, diagnosing invalid attribute((section))

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93255 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoImprove covariance tester to randomize the return value more.
Mike Stump [Tue, 12 Jan 2010 20:55:39 +0000 (20:55 +0000)]
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

14 years agoFix the CodeGen half of PR5911 by changing reference initialization to
Chandler Carruth [Tue, 12 Jan 2010 20:32:25 +0000 (20:32 +0000)]
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

14 years agoFurther tweaking of USR generation. WIP.
Ted Kremenek [Tue, 12 Jan 2010 19:35:53 +0000 (19:35 +0000)]
Further tweaking of USR generation.  WIP.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93250 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMake 'CXTranslationUnitIterator' an argument to perform_test_load(),
Ted Kremenek [Tue, 12 Jan 2010 18:53:15 +0000 (18:53 +0000)]
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

14 years agoDefine __weak attribute for objective-c pointers in
Fariborz Jahanian [Tue, 12 Jan 2010 18:33:57 +0000 (18:33 +0000)]
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

14 years agoParse dependent template-ids in base clauses and member
Douglas Gregor [Tue, 12 Jan 2010 17:52:59 +0000 (17:52 +0000)]
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

14 years agoImprove on objective-c pointer recognition
Fariborz Jahanian [Tue, 12 Jan 2010 17:31:23 +0000 (17:31 +0000)]
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

14 years agoWhen determining whether a given name is a template in a dependent
Douglas Gregor [Tue, 12 Jan 2010 17:06:20 +0000 (17:06 +0000)]
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

14 years agoFix tests for r93231.
Benjamin Kramer [Tue, 12 Jan 2010 11:52:20 +0000 (11:52 +0000)]
Fix tests for r93231.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93238 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRemove trailing semicolons and silence MSVC warning about C linkage.
Benjamin Kramer [Tue, 12 Jan 2010 11:32:40 +0000 (11:32 +0000)]
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

14 years agoSo I was sitting around, trying vainly to think of something to commit, and then
John McCall [Tue, 12 Jan 2010 07:18:19 +0000 (07:18 +0000)]
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

14 years agoUse horizontal-space markers in code-completion results rather than
Douglas Gregor [Tue, 12 Jan 2010 06:38:28 +0000 (06:38 +0000)]
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

14 years agoAdd covariance tester.
Mike Stump [Tue, 12 Jan 2010 03:01:18 +0000 (03:01 +0000)]
Add covariance tester.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93226 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRemove duplicate class name, MSVC doesn't like this.
Daniel Dunbar [Tue, 12 Jan 2010 02:34:07 +0000 (02:34 +0000)]
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

14 years agoReorganize some of the code to note overload candidates. Improves the
John McCall [Tue, 12 Jan 2010 02:15:36 +0000 (02:15 +0000)]
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

14 years agoAdd a boilerplate implementation for clang_getUSR(). WIP.
Ted Kremenek [Tue, 12 Jan 2010 02:07:58 +0000 (02:07 +0000)]
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

14 years agoFix rewriting of MacOS sjlj based eh.
Fariborz Jahanian [Tue, 12 Jan 2010 01:22:23 +0000 (01:22 +0000)]
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

14 years agoName lookup should know better than to look into a class before it's defined
Douglas Gregor [Tue, 12 Jan 2010 01:17:50 +0000 (01:17 +0000)]
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

14 years agoChris thinks these diagnostics are better now. :)
John McCall [Tue, 12 Jan 2010 01:09:12 +0000 (01:09 +0000)]
Chris thinks these diagnostics are better now. :)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93216 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSort overload results by viability.
John McCall [Tue, 12 Jan 2010 00:48:53 +0000 (00:48 +0000)]
Sort overload results by viability.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93215 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoIntroduce a specific representation for the ambiguous implicit conversion
John McCall [Tue, 12 Jan 2010 00:44:57 +0000 (00:44 +0000)]
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

14 years agoChange clang_getUSR() to return a CXString instead of a 'const char *'.
Ted Kremenek [Tue, 12 Jan 2010 00:38:53 +0000 (00:38 +0000)]
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

14 years agoMake createCXString() a static member function of class CIndex.
Ted Kremenek [Tue, 12 Jan 2010 00:36:38 +0000 (00:36 +0000)]
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

14 years agoAllow N_FIELDS to be 0.
Mike Stump [Tue, 12 Jan 2010 00:28:59 +0000 (00:28 +0000)]
Allow N_FIELDS to be 0.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93211 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoCIndex:
Ted Kremenek [Mon, 11 Jan 2010 23:56:39 +0000 (23:56 +0000)]
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

14 years agoEliminate an embarrassing performance regression in C/ObjC, where we
Douglas Gregor [Mon, 11 Jan 2010 23:29:10 +0000 (23:29 +0000)]
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

14 years agoReverted r93198; done without reading relevant PR.
David Chisnall [Mon, 11 Jan 2010 23:08:08 +0000 (23:08 +0000)]
Reverted r93198; done without reading relevant PR.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93205 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix rewriting for forward class declaration.
Fariborz Jahanian [Mon, 11 Jan 2010 22:48:40 +0000 (22:48 +0000)]
Fix rewriting for forward class declaration.
(fixes radar 6969189).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93201 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoWhen performing name lookup into a scope, check that its entity is
Douglas Gregor [Mon, 11 Jan 2010 22:40:45 +0000 (22:40 +0000)]
When performing name lookup into a scope, check that its entity is
non-NULL before looking at the entity itself.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93199 91177308-0d34-0410-b5e6-96231b3b80d8