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

18482 Коммитов

Автор SHA1 Сообщение Дата
Douglas Gregor f2c87bd036 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
2010-01-15 19:40:17 +00:00
John McCall c89724cc6d 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
2010-01-15 19:13:16 +00:00
John McCall b042fdfc94 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
2010-01-15 18:56:44 +00:00
John McCall 9d125033a9 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
2010-01-15 18:39:57 +00:00
Ted Kremenek 8b456e841e 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
2010-01-15 18:24:18 +00:00
Fariborz Jahanian bf07012cf9 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
2010-01-15 18:14:52 +00:00
Douglas Gregor 501edb6a54 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
2010-01-15 16:21:02 +00:00
Douglas Gregor 1cfb7da1f3 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
2010-01-15 16:05:33 +00:00
Ken Dyck a730583241 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
2010-01-15 12:37:54 +00:00
John McCall c2233c5c46 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
2010-01-15 08:34:02 +00:00
Ted Kremenek 88c8bc8380 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
2010-01-15 08:20:31 +00:00
Ted Kremenek c213b48206 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
2010-01-15 07:56:51 +00:00
Ted Kremenek 8b9317186f 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
2010-01-15 07:43:59 +00:00
Mike Stump 9a24dc1409 Add testcase for recent checkin.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93503 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 03:15:36 +00:00
Mike Stump a609f56ab5 Refine unreachable warnings. WIP.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93500 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 02:06:42 +00:00
Douglas Gregor 7d3f576dc9 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
2010-01-15 01:44:47 +00:00
Mike Stump 69456f12c5 Fix Release-Asserts for the time being.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93493 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 00:50:35 +00:00
Fariborz Jahanian a73165e47a 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
2010-01-14 23:05:52 +00:00
Devang Patel aa97d7051e 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
2010-01-14 21:46:57 +00:00
Anton Korobeynikov 79bff4350e Forgot to commit these
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93458 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-14 21:36:52 +00:00
Chris Lattner 8a3da0fb0a fix grammaro
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93452 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-14 21:00:58 +00:00
Anton Korobeynikov 26d18c1e18 long long is 64 bits on msp430
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93451 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-14 20:22:45 +00:00
John McCall 909c182f6a 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
2010-01-14 20:11:39 +00:00
Ted Kremenek 33ec2f8bc5 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
2010-01-14 19:47:50 +00:00
Ted Kremenek 74618dec96 Associate test case with Bugzilla PR.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93440 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-14 19:38:41 +00:00
John McCall 3a47e23471 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
2010-01-14 19:12:17 +00:00
Douglas Gregor c781f9cd85 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
2010-01-14 18:13:22 +00:00
Devang Patel 98a200bfe1 Add comment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93434 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-14 18:06:13 +00:00
Douglas Gregor 9edad9b618 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
2010-01-14 17:47:39 +00:00
Douglas Gregor 608300be19 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
2010-01-14 16:14:35 +00:00
Douglas Gregor 80f4f4ce5a 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
2010-01-14 16:08:12 +00:00
Douglas Gregor a4477810e4 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
2010-01-14 16:01:26 +00:00
Douglas Gregor 0cc8404f8c 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
2010-01-14 15:47:35 +00:00
David Chisnall d346736dfe 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
2010-01-14 14:08:19 +00:00
Zhongxing Xu 7b81e8fe6f Fix pr6035.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93422 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-14 03:45:06 +00:00
Douglas Gregor def9107059 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
2010-01-14 03:35:48 +00:00
John McCall 651f3eec13 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
2010-01-14 03:28:57 +00:00
Douglas Gregor 5d2fc405c7 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
2010-01-14 03:27:13 +00:00
Douglas Gregor 45bcd43e34 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
2010-01-14 03:21:49 +00:00
Mike Stump b64cc58087 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
2010-01-14 02:45:29 +00:00
Anders Carlsson 1bb6099031 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
2010-01-14 02:29:07 +00:00
Mike Stump cb4a4fb781 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
2010-01-14 02:26:52 +00:00
Ted Kremenek f462989fe8 Switch return site to use clang_getNullCursor().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93405 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-14 01:51:23 +00:00
Ted Kremenek 2fee4e6446 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
2010-01-14 01:50:21 +00:00
Anders Carlsson 7e37a6981b Add a DenseMapInfo specialization for BaseSubobject.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93399 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-14 01:39:42 +00:00
Douglas Gregor e3eef64ae7 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
2010-01-14 01:17:14 +00:00
Douglas Gregor 1ca6ae865c 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
2010-01-14 01:09:38 +00:00
John McCall e81e15ed0c 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
2010-01-14 00:56:20 +00:00
John McCall 3be16b7d9d 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
2010-01-14 00:50:32 +00:00
Devang Patel bca10069a9 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
2010-01-14 00:48:09 +00:00