]> granicus.if.org Git - clang/log
clang
14 years agoRemove unused code.
Ted Kremenek [Fri, 15 Jan 2010 23:35:12 +0000 (23:35 +0000)]
Remove unused code.

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

14 years agoRefactor USR logic for EnumDecls and RecordDecls so that both handle 'anonymous'...
Ted Kremenek [Fri, 15 Jan 2010 23:34:31 +0000 (23:34 +0000)]
Refactor USR logic for EnumDecls and RecordDecls so that both handle 'anonymous' declarations in the same way.

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

14 years agoGeneralize handling for unreachable code warnings to all binary operators.
Mike Stump [Fri, 15 Jan 2010 23:33:51 +0000 (23:33 +0000)]
Generalize handling for unreachable code warnings to all binary operators.

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

14 years agoCandidates with arity mismatches are extra-special non-viable and need to
John McCall [Fri, 15 Jan 2010 23:32:50 +0000 (23:32 +0000)]
Candidates with arity mismatches are extra-special non-viable and need to
stand at the back of the line.

Thanks to Oliver Hunt for reminding me to do this.

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

14 years agoRefine location reporting for unreachable code warnings for comma expressions.
Mike Stump [Fri, 15 Jan 2010 23:17:13 +0000 (23:17 +0000)]
Refine location reporting for unreachable code warnings for comma expressions.

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

14 years agoUSR generation: look at the typedef of an anonymous struct (if any) when trying to...
Ted Kremenek [Fri, 15 Jan 2010 23:08:25 +0000 (23:08 +0000)]
USR generation: look at the typedef of an anonymous struct (if any) when trying to generate a USR.

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

14 years agodefine __weak to null in rewritten source for
Fariborz Jahanian [Fri, 15 Jan 2010 22:29:39 +0000 (22:29 +0000)]
define __weak to null in rewritten source for
-fms-extensions as well.

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

14 years agoMake CXCursor's data opaque.
Douglas Gregor [Fri, 15 Jan 2010 21:56:13 +0000 (21:56 +0000)]
Make CXCursor's data opaque.

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

14 years agoMake LookupResult::resolveKind() robust against NotFoundInCurrentInstantiation.
John McCall [Fri, 15 Jan 2010 21:27:01 +0000 (21:27 +0000)]
Make LookupResult::resolveKind() robust against NotFoundInCurrentInstantiation.
Fixes PR 6049.

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

14 years agoAdd CXCursor.[h,cpp]. These files will centralize the logic for creating/probing...
Ted Kremenek [Fri, 15 Jan 2010 20:35:54 +0000 (20:35 +0000)]
Add CXCursor.[h,cpp].  These files will centralize the logic for creating/probing CXCursors.

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

14 years agoFix a couple bugs in copy assignment operator synthesis.
Eli Friedman [Fri, 15 Jan 2010 20:06:11 +0000 (20:06 +0000)]
Fix a couple bugs in copy assignment operator synthesis.

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

14 years agoAdd USR generation for enums.
Ted Kremenek [Fri, 15 Jan 2010 20:04:31 +0000 (20:04 +0000)]
Add USR generation for enums.

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

14 years agoAdd -cursor-at=file:line:column command line option to c-index-test,
Douglas Gregor [Fri, 15 Jan 2010 19:40:17 +0000 (19:40 +0000)]
Add -cursor-at=file:line:column command line option to c-index-test,
to directly check the results of clang_getCursor(). Also, start
migrating some index-test tests over to c-index test [*] and some
grep-using tests over to FileCheck.

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

14 years agoPreserve type source information for C++ named casts through template
John McCall [Fri, 15 Jan 2010 19:13:16 +0000 (19:13 +0000)]
Preserve type source information for C++ named casts through template
instantiation.

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

14 years agoDon't lose type source information when rebuilding C-style cast expressions.
John McCall [Fri, 15 Jan 2010 18:56:44 +0000 (18:56 +0000)]
Don't lose type source information when rebuilding C-style cast expressions.
Also we don't need to recheck for altivec initializers, I think.

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

14 years agoPreserve type source information in explicit cast expressions.
John McCall [Fri, 15 Jan 2010 18:39:57 +0000 (18:39 +0000)]
Preserve type source information in explicit cast expressions.
Patch by Enea Zaffanella.

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

14 years agogetLocationFromCursor: If a cursor is a reference and has a referringDecl, using...
Ted Kremenek [Fri, 15 Jan 2010 18:24:18 +0000 (18:24 +0000)]
getLocationFromCursor: If a cursor is a reference and has a referringDecl, using the referringDecl for the location.

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

14 years agoDo not do the block-specific rewrite when there is no block literals.
Fariborz Jahanian [Fri, 15 Jan 2010 18:14:52 +0000 (18:14 +0000)]
Do not do the block-specific rewrite when there is no block literals.
Fixes radar 7546096.

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

14 years agoWhen determining whether a DeclRefExpr is value-dependent when it
Douglas Gregor [Fri, 15 Jan 2010 16:21:02 +0000 (16:21 +0000)]
When determining whether a DeclRefExpr is value-dependent when it
references a const variable of integral type, the initializer may be
in a different declaration than the one that name-lookup saw. Find the
initializer anyway. Fixes PR6045.

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

14 years agoWhen determining whether the type is the current instantiation, strip
Douglas Gregor [Fri, 15 Jan 2010 16:05:33 +0000 (16:05 +0000)]
When determining whether the type is the current instantiation, strip
qualifiers. Fixes PR6021.

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

14 years agoConvert the type of the LValue offset variable in APValue to CharUnits, moving
Ken Dyck [Fri, 15 Jan 2010 12:37:54 +0000 (12:37 +0000)]
Convert the type of the LValue offset variable in APValue to CharUnits, moving
the LValue-related methods of APValue out of line to avoid header file leaching.

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

14 years agoDon't repeat lookup when instantiating resolved member expressions.
John McCall [Fri, 15 Jan 2010 08:34:02 +0000 (08:34 +0000)]
Don't repeat lookup when instantiating resolved member expressions.
Adjust BuildMemberReferenceExpr to perform the inheritance check on implicit
member accesses, which can arise from unqualified lookups and therefore may
reference decls from enclosing class scopes.

Fixes PR 5838.

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

14 years agoDon't suggest the developer use 'arc4random' instead of 'rand' when that function...
Ted Kremenek [Fri, 15 Jan 2010 08:20:31 +0000 (08:20 +0000)]
Don't suggest the developer use 'arc4random' instead of 'rand' when that function is not available.  Fixes PR 6012.

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

14 years agoTeach BugReporter to "escape" the occurance of '%' characters in diagnostic messages...
Ted Kremenek [Fri, 15 Jan 2010 07:56:51 +0000 (07:56 +0000)]
Teach BugReporter to "escape" the occurance of '%' characters in diagnostic messages when emitted results to the standard Diagnostics output.  Fixes PR 6033.

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

14 years agoConvert a few more uses of std::string& to llvm::StringRef.
Ted Kremenek [Fri, 15 Jan 2010 07:43:59 +0000 (07:43 +0000)]
Convert a few more uses of std::string& to llvm::StringRef.

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

14 years agoAdd testcase for recent checkin.
Mike Stump [Fri, 15 Jan 2010 03:15:36 +0000 (03:15 +0000)]
Add testcase for recent checkin.

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

14 years agoRefine unreachable warnings. WIP.
Mike Stump [Fri, 15 Jan 2010 02:06:42 +0000 (02:06 +0000)]
Refine unreachable warnings.  WIP.

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

14 years agoWhen performing qualified name lookup into the current instantiation,
Douglas Gregor [Fri, 15 Jan 2010 01:44:47 +0000 (01:44 +0000)]
When performing qualified name lookup into the current instantiation,
do not look into base classes if there are any dependent base
classes. Instead, note in the lookup result that we couldn't look into
any dependent bases. Use that new result kind to detect when this case
occurs, so that we can fall back to treating the type/value/etc. as a
member of an unknown specialization.

Fixes an issue where we were resolving lookup at template definition
time and then missing an ambiguity at template instantiation time.

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

14 years agoFix Release-Asserts for the time being.
Mike Stump [Fri, 15 Jan 2010 00:50:35 +0000 (00:50 +0000)]
Fix Release-Asserts for the time being.

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

14 years agoPatch to avoid duplicate declaration of byref structs
Fariborz Jahanian [Thu, 14 Jan 2010 23:05:52 +0000 (23:05 +0000)]
Patch to avoid duplicate declaration of byref structs
for __block variables of same name declared in multiple scopes.
Fixes radar 7540194

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

14 years agoEmit linkage name even if it matches regular name. The code generator uses linkage...
Devang Patel [Thu, 14 Jan 2010 21:46:57 +0000 (21:46 +0000)]
Emit linkage name even if it matches regular name. The code generator uses linkage name to find subprogram entry for the current function.

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

14 years agoForgot to commit these
Anton Korobeynikov [Thu, 14 Jan 2010 21:36:52 +0000 (21:36 +0000)]
Forgot to commit these

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

14 years agofix grammaro
Chris Lattner [Thu, 14 Jan 2010 21:00:58 +0000 (21:00 +0000)]
fix grammaro

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

14 years agolong long is 64 bits on msp430
Anton Korobeynikov [Thu, 14 Jan 2010 20:22:45 +0000 (20:22 +0000)]
long long is 64 bits on msp430

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

14 years agoPre-emptive bugfixes in the diagnostics code: allow arbitrary punctuation
John McCall [Thu, 14 Jan 2010 20:11:39 +0000 (20:11 +0000)]
Pre-emptive bugfixes in the diagnostics code:  allow arbitrary punctuation
characters to be escaped and implement a scan-forward function which
properly respects brace nesting.

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

14 years agoSimplify test case. This test case also applies to PR 6013.
Ted Kremenek [Thu, 14 Jan 2010 19:47:50 +0000 (19:47 +0000)]
Simplify test case.  This test case also applies to PR 6013.

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

14 years agoAssociate test case with Bugzilla PR.
Ted Kremenek [Thu, 14 Jan 2010 19:38:41 +0000 (19:38 +0000)]
Associate test case with Bugzilla PR.

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

14 years agoDocument the extensions I made to the diagnostics-formatting system yesterday.
John McCall [Thu, 14 Jan 2010 19:12:17 +0000 (19:12 +0000)]
Document the extensions I made to the diagnostics-formatting system yesterday.

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

14 years agoAfter dyn_cast'ing, it generally makes sense to check the *output* of
Douglas Gregor [Thu, 14 Jan 2010 18:13:22 +0000 (18:13 +0000)]
After dyn_cast'ing, it generally makes sense to check the *output* of
the dyn_cast against NULL rather than the *input*. Fixes PR6025.

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

14 years agoAdd comment.
Devang Patel [Thu, 14 Jan 2010 18:06:13 +0000 (18:06 +0000)]
Add comment.

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

14 years agoWhen qualified lookup into the current instantiation fails (because it
Douglas Gregor [Thu, 14 Jan 2010 17:47:39 +0000 (17:47 +0000)]
When qualified lookup into the current instantiation fails (because it
finds nothing), and the current instantiation has dependent base
classes, treat the qualified lookup as if it referred to an unknown
specialization. Fixes PR6031.

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

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