Douglas Gregor
27aa77ac08
Improve the test for unused-expression warnings slightly
...
llvm-svn: 93644
2010-01-16 18:17:21 +00:00
Douglas Gregor
e1ad8a105a
Partial fix for PR6022, where we were complaining when a friend
...
function template declared within a class template did not match a
function in another scope. We really need to rework how
friends-in-templates are semantically checked.
llvm-svn: 93642
2010-01-16 18:09:52 +00:00
Douglas Gregor
46d6614388
Give ObjCClassRef cursors a sane representation, which is encapsulated
...
in CXCursor.cpp. With this sane representation, fix the class
reference that is part of Objective-C category declarations so that
the cursor's location matches up with the reference, not the class
being referred to.
llvm-svn: 93640
2010-01-16 17:14:40 +00:00
Douglas Gregor
071676f422
Improve location information for Objective-C category declarations. We
...
previously only had a single location (the @ in @interface); now we
know where the @ is (for the start of the declaration), where the
class name is (that's the normal "location" now for diagnostics), and
where the category name is. Also, eliminated the redundant "end"
location, since ObjCContainerDecl already has better @end information.
The only XFAIL'd test is temporary; will un-XFAIL-it once I've taught
CIndex how to use the new locations.
llvm-svn: 93639
2010-01-16 16:38:58 +00:00
Douglas Gregor
ef6eb84da1
Use a sane encoding for CXCursor_ObjCProtocolRef, using the actual
...
source locations where the protocols were referenced rather than the
location of some random enclosing declaration.
llvm-svn: 93637
2010-01-16 15:44:18 +00:00
Douglas Gregor
002b671055
Keep track of the source locations for each protocol reference in
...
Objective-C classes, protocol definitions, forward protocol
declarations, and categories. This information isn't actually used
yet; that's coming next.
llvm-svn: 93636
2010-01-16 15:02:53 +00:00
Douglas Gregor
6c8959b71b
Give CXCursor_ObjCSuperClassRef a sane encoding, which is only known
...
to CXCursor.cpp.
llvm-svn: 93634
2010-01-16 14:00:32 +00:00
John McCall
982adb518c
Fix a use of uninitialized memory in overload diagnostics.
...
llvm-svn: 93629
2010-01-16 03:50:16 +00:00
Ted Kremenek
13751dc571
Add mapping from ObjCPropertDecl to CXCursorKind.
...
llvm-svn: 93623
2010-01-16 02:08:29 +00:00
Ted Kremenek
4ba5263441
Remove 'default' case in switch statement in clang_getCursorKindSpelling(). This identified a missing case (warned by the compiler) and identified that CXCursor_FirstDecl didn't actually correspond to the first decl.
...
llvm-svn: 93622
2010-01-16 02:02:09 +00:00
Ted Kremenek
9cec00019a
Remove TranslateKind and centralize Decl -> CXCursorKind in GetCursorKind(). This revealed a bunch of inconsistencies in how CXCursorKinds were being computed.
...
llvm-svn: 93618
2010-01-16 01:44:12 +00:00
Tanya Lattner
dbfd16014a
Add codgen for BI__builtin_llvm_memory_barrier.
...
llvm-svn: 93611
2010-01-16 01:21:14 +00:00
Tanya Lattner
68c7113944
The codegen for these builtins was removed long ago, but their definitions remained. Removing them totally.
...
llvm-svn: 93607
2010-01-16 01:10:51 +00:00
Eli Friedman
8fdc2cb46a
Fix crash generating debug info for constructor for anonymous struct.
...
llvm-svn: 93601
2010-01-16 00:43:13 +00:00
Ted Kremenek
c2aa0f1ecb
Migrate Decl* -> cursorkind logic into CXCursor.cpp, and drastically tighten TUVisitor.
...
llvm-svn: 93599
2010-01-16 00:36:30 +00:00
Eli Friedman
1fcf66b0dd
Make the AST explicitly represent the cast of the first operand of a
...
pointer-to-member operator.
llvm-svn: 93592
2010-01-16 00:00:48 +00:00
Ted Kremenek
10dd6e9ca5
Remove unused code.
...
llvm-svn: 93586
2010-01-15 23:35:12 +00:00
Ted Kremenek
6b1d550d4b
Refactor USR logic for EnumDecls and RecordDecls so that both handle 'anonymous' declarations in the same way.
...
llvm-svn: 93585
2010-01-15 23:34:31 +00:00
Mike Stump
ea409449aa
Generalize handling for unreachable code warnings to all binary operators.
...
llvm-svn: 93584
2010-01-15 23:33:51 +00:00
John McCall
3712d9e391
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.
llvm-svn: 93583
2010-01-15 23:32:50 +00:00
Mike Stump
d4d6fb3374
Refine location reporting for unreachable code warnings for comma expressions.
...
llvm-svn: 93574
2010-01-15 23:17:13 +00:00
Ted Kremenek
a7f7b17bc7
USR generation: look at the typedef of an anonymous struct (if any) when trying to generate a USR.
...
llvm-svn: 93572
2010-01-15 23:08:25 +00:00
Fariborz Jahanian
f0462ff691
define __weak to null in rewritten source for
...
-fms-extensions as well.
llvm-svn: 93569
2010-01-15 22:29:39 +00:00
Douglas Gregor
c58d05bcf9
Make CXCursor's data opaque.
...
llvm-svn: 93561
2010-01-15 21:56:13 +00:00
John McCall
7fe6e9c2f1
Make LookupResult::resolveKind() robust against NotFoundInCurrentInstantiation.
...
Fixes PR 6049.
llvm-svn: 93557
2010-01-15 21:27:01 +00:00
Ted Kremenek
87553c42c0
Add CXCursor.[h,cpp]. These files will centralize the logic for creating/probing CXCursors.
...
llvm-svn: 93547
2010-01-15 20:35:54 +00:00
Eli Friedman
cab014721b
Fix a couple bugs in copy assignment operator synthesis.
...
llvm-svn: 93546
2010-01-15 20:06:11 +00:00
Ted Kremenek
8433d1da5e
Add USR generation for enums.
...
llvm-svn: 93543
2010-01-15 20:04:31 +00:00
Douglas Gregor
082c3e69eb
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.
llvm-svn: 93537
2010-01-15 19:40:17 +00:00
John McCall
d377e04489
Preserve type source information for C++ named casts through template
...
instantiation.
llvm-svn: 93533
2010-01-15 19:13:16 +00:00
John McCall
ebe5474148
Don't lose type source information when rebuilding C-style cast expressions.
...
Also we don't need to recheck for altivec initializers, I think.
llvm-svn: 93529
2010-01-15 18:56:44 +00:00
John McCall
9751396d70
Preserve type source information in explicit cast expressions.
...
Patch by Enea Zaffanella.
llvm-svn: 93522
2010-01-15 18:39:57 +00:00
Ted Kremenek
63b15c3af7
getLocationFromCursor: If a cursor is a reference and has a referringDecl, using the referringDecl for the location.
...
llvm-svn: 93520
2010-01-15 18:24:18 +00:00
Fariborz Jahanian
5c26eeefdd
Do not do the block-specific rewrite when there is no block literals.
...
Fixes radar 7546096.
llvm-svn: 93519
2010-01-15 18:14:52 +00:00
Douglas Gregor
5fcb51c09c
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.
llvm-svn: 93514
2010-01-15 16:21:02 +00:00
Douglas Gregor
27b174f4c3
When determining whether the type is the current instantiation, strip
...
qualifiers. Fixes PR6021.
llvm-svn: 93513
2010-01-15 16:05:33 +00:00
Ken Dyck
02990837ad
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.
llvm-svn: 93512
2010-01-15 12:37:54 +00:00
John McCall
38836f0f39
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.
llvm-svn: 93510
2010-01-15 08:34:02 +00:00
Ted Kremenek
abf6ba1612
Don't suggest the developer use 'arc4random' instead of 'rand' when that function is not available. Fixes PR 6012.
...
llvm-svn: 93508
2010-01-15 08:20:31 +00:00
Ted Kremenek
d74cc397c8
Teach BugReporter to "escape" the occurance of '%' characters in diagnostic messages when emitted results to the standard Diagnostics output. Fixes PR 6033.
...
llvm-svn: 93507
2010-01-15 07:56:51 +00:00
Ted Kremenek
959990b840
Convert a few more uses of std::string& to llvm::StringRef.
...
llvm-svn: 93506
2010-01-15 07:43:59 +00:00
Mike Stump
dec5a39ea5
Add testcase for recent checkin.
...
llvm-svn: 93503
2010-01-15 03:15:36 +00:00
Mike Stump
6a11229dc8
Refine unreachable warnings. WIP.
...
llvm-svn: 93500
2010-01-15 02:06:42 +00:00
Douglas Gregor
d0d2ee0e4b
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.
llvm-svn: 93497
2010-01-15 01:44:47 +00:00
Mike Stump
fc4daba5e0
Fix Release-Asserts for the time being.
...
llvm-svn: 93493
2010-01-15 00:50:35 +00:00
Fariborz Jahanian
195ac2dfab
Patch to avoid duplicate declaration of byref structs
...
for __block variables of same name declared in multiple scopes.
Fixes radar 7540194
llvm-svn: 93474
2010-01-14 23:05:52 +00:00
Devang Patel
2d63010a9c
Emit linkage name even if it matches regular name. The code generator uses linkage name to find subprogram entry for the current function.
...
llvm-svn: 93461
2010-01-14 21:46:57 +00:00
Anton Korobeynikov
485810ec0a
Forgot to commit these
...
llvm-svn: 93458
2010-01-14 21:36:52 +00:00
Chris Lattner
0b534d5969
fix grammaro
...
llvm-svn: 93452
2010-01-14 21:00:58 +00:00
Anton Korobeynikov
6bedbf1039
long long is 64 bits on msp430
...
llvm-svn: 93451
2010-01-14 20:22:45 +00:00