Anders Carlsson
6ad01742d5
Rewrite member function pointer test not to rely on -O2.
...
llvm-svn: 83262
2009-10-03 14:39:13 +00:00
Benjamin Kramer
d8e06611eb
Fix typo.
...
llvm-svn: 83246
2009-10-02 12:19:16 +00:00
Benjamin Kramer
80401b96c2
FileCheckize test case.
...
llvm-svn: 83244
2009-10-02 10:32:51 +00:00
Anders Carlsson
8a744ad8a6
Don't update the struct alignment when adding fields to a packed struct. Fixes PR5118.
...
llvm-svn: 83235
2009-10-02 04:52:12 +00:00
Mike Stump
581b9ad124
More magic pixie dust.
...
llvm-svn: 83232
2009-10-02 02:30:50 +00:00
Mike Stump
440af3d903
Fix up debug information for block pointers a bit more.
...
llvm-svn: 83231
2009-10-02 02:23:37 +00:00
Anders Carlsson
39e3eb12ae
When building constant structs, check if the resulting LLVM struct will be bigger than the record layout size and use a packed struct if that's the case. Fixes PR5108.
...
llvm-svn: 83230
2009-10-02 02:15:20 +00:00
Douglas Gregor
f343fd8929
Make sure to free the explicit template arguments provided for an
...
explicit instantiation. Also, tighten up reference-count checking to
help catch these issues earlier. Fixes PR5069.
llvm-svn: 83225
2009-10-01 23:51:25 +00:00
Steve Naroff
bb69c94798
- Remove Sema::FindMethodInNestedImplementations().
...
- Add ObjCInterfaceDecl::lookupPrivateInstanceMethod().
- Convert clients.
No functionality change - One less method in Sema:-)
llvm-svn: 83224
2009-10-01 23:46:04 +00:00
Douglas Gregor
78b691a458
When the return type of a function is dependent, don't perform any
...
of the flow-control checks for falling off the end of a function,
since the return type may instantiate to void. Similarly, if a
return statement has an expression and the return type of the function
is void, don't complain if the expression is type-dependent, since
that type could instantiate to void.
Fixes PR5071.
llvm-svn: 83222
2009-10-01 23:25:31 +00:00
Mike Stump
017460ab6c
Implement a FIXME. This improves codegen just a tad.
...
llvm-svn: 83221
2009-10-01 22:29:41 +00:00
Fariborz Jahanian
a0f91ad59c
enumerator value of 0 is not a null pointer constant for
...
deciding const of null pointer conversion. Fixes PR5086.
llvm-svn: 83217
2009-10-01 22:10:15 +00:00
Douglas Gregor
369acf9304
CodeGen may see out-of-line declarations of the various special member
...
functions when they are explicitly declared, e.g., via a function
template specialization or explicit template instantiation
declaration. Don't try to synthesize bodies for the special member
functions in this case; rather, check whether we have an implicit
declaration and, if so, synthesize the appropriate function
body. Fixes PR5084.
llvm-svn: 83212
2009-10-01 20:44:19 +00:00
Fariborz Jahanian
b3c44f9ee9
Patch to implement static casting which requires one
...
user-defined type conversion. Fixes PR5040.
llvm-svn: 83211
2009-10-01 20:39:51 +00:00
Fariborz Jahanian
e4b21aba44
Set __EXCEPTIONS by checking on darwin's triple.
...
Patch by Rafael Espindola.
llvm-svn: 83209
2009-10-01 20:30:46 +00:00
Ted Kremenek
5c22e110a1
Fix bad grammar in static analyzer diagnostic. Reported by Robert Purves!
...
llvm-svn: 83204
2009-10-01 17:31:50 +00:00
Rafael Espindola
00a665751d
Move the "needs exception support" logic to clang. This also fixes
...
-fno-exceptions in C++ code. We used to always define __EXCEPTIONS in
C++.
llvm-svn: 83199
2009-10-01 13:33:33 +00:00
Douglas Gregor
e364e7bc2b
Fix a lame regression in IR gen for C++ delete expressions. PR5102
...
llvm-svn: 83195
2009-10-01 05:49:51 +00:00
Steve Naroff
a6c56bb849
Add support for class and protocol references.
...
llvm-svn: 83186
2009-10-01 00:31:07 +00:00
Mike Stump
7d69911a1f
A couple of refinements for laying out debug information for
...
BlockDeclRefDecls.
llvm-svn: 83185
2009-10-01 00:27:30 +00:00
John McCall
4fa5342758
Anonymous namespaces, sema + codegen. A lot of semantics are still broken,
...
apparently because using directives aren't quite working correctly.
llvm-svn: 83184
2009-10-01 00:25:31 +00:00
Douglas Gregor
42909754f6
Improve template argument deduction in the case where the parameter
...
type is a template-id (e.g., basic_ostream<CharT, Traits>) and the
argument type is a class that has a derived class matching the
parameter type. Previously, we were giving up on template argument
deduction too early.
llvm-svn: 83177
2009-09-30 22:13:51 +00:00
Douglas Gregor
66950a32d9
When overload resolution fails for an overloaded operator, show the
...
overload candidates (but not the built-in ones). We still rely on the
underlying built-in semantic analysis to produce the initial
diagnostic, then print the candidates following that diagnostic.
One side advantage of this approach is that we can perform more validation
of C++'s operator overloading with built-in candidates vs. the
semantic analysis for those built-in operators: when there are no
viable candidates, we know to expect an error from the built-in
operator handling code. Otherwise, we are not modeling the built-in
semantics properly within operator overloading. This is checked as:
assert(Result.isInvalid() &&
"C++ binary operator overloading is missing
candidates!");
if (Result.isInvalid())
PrintOverloadCandidates(CandidateSet, /*OnlyViable=*/false);
The assert() catches cases where we're wrong in a +Asserts build. The
"if" makes sure that, if this happens in a production clang
(-Asserts), we still build the proper built-in operator and continue
on our merry way. This is effectively what happened before this
change, but we've added the assert() to catch more flies.
llvm-svn: 83175
2009-09-30 21:46:01 +00:00
Douglas Gregor
3dc959f88b
Tweak CHECK lines to eliminate a failure on i686-apple-darwin10
...
llvm-svn: 83173
2009-09-30 21:39:51 +00:00
Fariborz Jahanian
db82308633
Issue good diagnostics when initializing a refernce type with
...
a bad initializer. Fixes pr4274.
llvm-svn: 83169
2009-09-30 21:23:30 +00:00
Tanya Lattner
fd2dcba7f3
Add an error for function parameters that have a qualified address space since this is not allowed by the embedded c extension spec.
...
llvm-svn: 83165
2009-09-30 20:47:43 +00:00
Chris Lattner
b355495660
fix line #'s
...
llvm-svn: 83162
2009-09-30 20:20:06 +00:00
Chris Lattner
859f1b5b86
add some more popular examples, color code warning: and error: like the command line.
...
llvm-svn: 83161
2009-09-30 20:19:10 +00:00
Chris Lattner
24440102aa
Convert from nonportable grep to filecheck, patch by John Thompson
...
llvm-svn: 83158
2009-09-30 19:55:07 +00:00
Douglas Gregor
49663d2a23
Update C++ status page
...
llvm-svn: 83157
2009-09-30 18:32:57 +00:00
Fariborz Jahanian
ac3005cecc
Note location of operators caused the circularity.
...
llvm-svn: 83153
2009-09-30 17:46:20 +00:00
Fariborz Jahanian
e01e434aef
<rdar://problem/7263113> Make clang produce gcc's objc_assign_StrongCast as a result of type-cast of an ivar in assignment.
...
llvm-svn: 83150
2009-09-30 17:10:29 +00:00
Chris Lattner
e0527b2de1
update copyright.
...
llvm-svn: 83149
2009-09-30 15:59:45 +00:00
Mike Stump
2e722b915c
Improve debugging information for BlockDeclRefExpr. WIP. Given this
...
scheme, we can switch the previous scheme over to using this code
path. There's a bit of simplifications yet to do as well.
llvm-svn: 83138
2009-09-30 02:43:10 +00:00
John McCall
bd0465bbd2
Spare the processors of those poor wretches who have no choice but to write
...
unbounded chains of operator-> delegations.
llvm-svn: 83134
2009-09-30 01:30:54 +00:00
John McCall
c1538c08d7
Detect operator-> chains of arbitrary length. Use a terrible data structure
...
to strike fear into the hearts of CPUs everywhere.
llvm-svn: 83133
2009-09-30 01:01:30 +00:00
Fariborz Jahanian
10ce958550
self-referecing operator '->' member function was causing
...
infinit recursion. This patch fixes it. [13.3.1.2]-p2
llvm-svn: 83124
2009-09-30 00:19:41 +00:00
Douglas Gregor
80a6cc5800
Find operators new/delete in base classes. FIXME -= 2;
...
llvm-svn: 83119
2009-09-30 00:03:47 +00:00
John McCall
a192536ebe
Desugaring optimizations. Add single-step desugaring methods to all
...
concrete types. Use unqualified desugaring for getAs<> and sundry.
Fix a few users to either not desugar or use qualified desugar, as seemed
appropriate. Removed Type's qualified desugar method, as it was easy
to accidentally use instead of QualType's.
llvm-svn: 83116
2009-09-29 23:03:30 +00:00
Douglas Gregor
98496dc3eb
The C++ delete expression strips cv-qualifiers from the pointed-to type. My previous fix eliminated this behavior, so bring it back again.
...
llvm-svn: 83113
2009-09-29 21:38:53 +00:00
Argyrios Kyrtzidis
8da9ce6328
Pull TypeLocVisitor into its own header file.
...
llvm-svn: 83112
2009-09-29 21:27:32 +00:00
Argyrios Kyrtzidis
4361bc1b43
Keep track of type references in DeclReferenceMap.
...
llvm-svn: 83111
2009-09-29 21:26:53 +00:00
Argyrios Kyrtzidis
9c28a3d13c
In ASTVisitor, call the correct base methods.
...
llvm-svn: 83110
2009-09-29 21:26:35 +00:00
Argyrios Kyrtzidis
edd1129c36
Fix Decl class hierarchy.
...
llvm-svn: 83109
2009-09-29 21:26:14 +00:00
Fariborz Jahanian
3a36ab08b7
13.1-p3 Overloadable declarations
...
Parameter declarations that differ only in the presence or absence of const and/or volatile are equivalent.
llvm-svn: 83104
2009-09-29 20:28:06 +00:00
Argyrios Kyrtzidis
f881301d3a
Resolve a source location inside the return type of a functon.
...
llvm-svn: 83101
2009-09-29 19:58:16 +00:00
Argyrios Kyrtzidis
419e38bbe2
When pointing at a type decl reference, ASTLocation is a NamedDeclRef.
...
llvm-svn: 83099
2009-09-29 19:45:58 +00:00
Argyrios Kyrtzidis
05677cae08
Resolve a source location that is inside a type declarator.
...
llvm-svn: 83098
2009-09-29 19:45:41 +00:00
Argyrios Kyrtzidis
0643e333a3
Introduce ObjCInterfaceLoc which provides type source information for ObjC interfaces.
...
llvm-svn: 83097
2009-09-29 19:45:22 +00:00
Argyrios Kyrtzidis
d4bcfaf351
Introduce TypedefLoc::getTypedefDecl().
...
llvm-svn: 83096
2009-09-29 19:44:47 +00:00