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

15277 Коммитов

Автор SHA1 Сообщение Дата
Fariborz Jahanian f8c3ad7653 enumerator value of 0 is not a null pointer constant for
deciding const of null pointer conversion. Fixes PR5086.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83217 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-01 22:10:15 +00:00
Douglas Gregor 4513272f44 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83212 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-01 20:44:19 +00:00
Fariborz Jahanian 249ceade49 Patch to implement static casting which requires one
user-defined type conversion. Fixes PR5040.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83211 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-01 20:39:51 +00:00
Fariborz Jahanian 85caf03ee4 Set __EXCEPTIONS by checking on darwin's triple.
Patch by Rafael Espindola.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83209 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-01 20:30:46 +00:00
Ted Kremenek bb206fdd9d Fix bad grammar in static analyzer diagnostic. Reported by Robert Purves!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83204 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-01 17:31:50 +00:00
Rafael Espindola f759df06d9 Move the "needs exception support" logic to clang. This also fixes
-fno-exceptions in C++ code. We used to always define __EXCEPTIONS in
C++.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83199 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-01 13:33:33 +00:00
Douglas Gregor d69dd78086 Fix a lame regression in IR gen for C++ delete expressions. PR5102
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83195 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-01 05:49:51 +00:00
Steve Naroff 85e2db7213 Add support for class and protocol references.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83186 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-01 00:31:07 +00:00
Mike Stump de8c5c77e2 A couple of refinements for laying out debug information for
BlockDeclRefDecls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83185 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-01 00:27:30 +00:00
John McCall 9aeed32282 Anonymous namespaces, sema + codegen. A lot of semantics are still broken,
apparently because using directives aren't quite working correctly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83184 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-01 00:25:31 +00:00
Douglas Gregor 4a5c15f75f 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83177 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-30 22:13:51 +00:00
Douglas Gregor 3307475eb0 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83175 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-30 21:46:01 +00:00
Douglas Gregor 60a90cc99a Tweak CHECK lines to eliminate a failure on i686-apple-darwin10
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83173 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-30 21:39:51 +00:00
Fariborz Jahanian 893f955321 Issue good diagnostics when initializing a refernce type with
a bad initializer. Fixes pr4274.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83169 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-30 21:23:30 +00:00
Tanya Lattner 27a84d0161 Add an error for function parameters that have a qualified address space since this is not allowed by the embedded c extension spec.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83165 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-30 20:47:43 +00:00
Chris Lattner 871dc3e225 fix line #'s
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83162 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-30 20:20:06 +00:00
Chris Lattner 0e3b44b0f4 add some more popular examples, color code warning: and error: like the command line.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83161 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-30 20:19:10 +00:00
Chris Lattner a67810e1c1 Convert from nonportable grep to filecheck, patch by John Thompson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83158 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-30 19:55:07 +00:00
Douglas Gregor 30a46b54f1 Update C++ status page
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83157 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-30 18:32:57 +00:00
Fariborz Jahanian 7a8233a691 Note location of operators caused the circularity.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83153 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-30 17:46:20 +00:00
Fariborz Jahanian 75b08f169f <rdar://problem/7263113> Make clang produce gcc's objc_assign_StrongCast as a result of type-cast of an ivar in assignment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83150 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-30 17:10:29 +00:00
Chris Lattner 76a69ad089 update copyright.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83149 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-30 15:59:45 +00:00
Mike Stump b1a6e68796 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83138 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-30 02:43:10 +00:00
John McCall 432887fadd Spare the processors of those poor wretches who have no choice but to write
unbounded chains of operator-> delegations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83134 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-30 01:30:54 +00:00
John McCall c4e8321deb Detect operator-> chains of arbitrary length. Use a terrible data structure
to strike fear into the hearts of CPUs everywhere.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83133 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-30 01:01:30 +00:00
Fariborz Jahanian 4a4e345a8b self-referecing operator '->' member function was causing
infinit recursion. This patch fixes it. [13.3.1.2]-p2



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83124 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-30 00:19:41 +00:00
Douglas Gregor 5d64e5b6bc Find operators new/delete in base classes. FIXME -= 2;
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83119 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-30 00:03:47 +00:00
John McCall bf1cc05907 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.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83116 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-29 23:03:30 +00:00
Douglas Gregor 1070c9f7ac The C++ delete expression strips cv-qualifiers from the pointed-to type. My previous fix eliminated this behavior, so bring it back again.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83113 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-29 21:38:53 +00:00
Argyrios Kyrtzidis 0c411806d5 Pull TypeLocVisitor into its own header file.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83112 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-29 21:27:32 +00:00
Argyrios Kyrtzidis b11688485a Keep track of type references in DeclReferenceMap.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83111 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-29 21:26:53 +00:00
Argyrios Kyrtzidis 09d8a957d3 In ASTVisitor, call the correct base methods.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83110 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-29 21:26:35 +00:00
Argyrios Kyrtzidis fbc85e5652 Fix Decl class hierarchy.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83109 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-29 21:26:14 +00:00
Fariborz Jahanian 7605618e3b 13.1-p3 Overloadable declarations
Parameter declarations that differ only in the presence or absence of const and/or volatile are equivalent.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83104 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-29 20:28:06 +00:00
Argyrios Kyrtzidis 5a70ea6c75 Resolve a source location inside the return type of a functon.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83101 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-29 19:58:16 +00:00
Argyrios Kyrtzidis 05a7651c7a When pointing at a type decl reference, ASTLocation is a NamedDeclRef.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83099 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-29 19:45:58 +00:00
Argyrios Kyrtzidis ef6cd6712c Resolve a source location that is inside a type declarator.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83098 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-29 19:45:41 +00:00
Argyrios Kyrtzidis eb66759e9a Introduce ObjCInterfaceLoc which provides type source information for ObjC interfaces.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83097 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-29 19:45:22 +00:00
Argyrios Kyrtzidis 9036d5e369 Introduce TypedefLoc::getTypedefDecl().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83096 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-29 19:44:47 +00:00
Argyrios Kyrtzidis f4526e3fd4 Modify ASTLocation and apart from being a Decl or Stmt, allow it to also be:
-A NamedDecl reference
-A TypeLoc

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83095 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-29 19:44:27 +00:00
Argyrios Kyrtzidis f352bddf01 Introduce ObjCProtocolListLoc for keeping source location information for protocol references.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83094 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-29 19:43:35 +00:00
Argyrios Kyrtzidis 24fab41057 Introduce ObjCProtocolListType type subclass.
This is used only for keeping detailed type source information for protocol references,
it should not participate in the semantics of the type system.

Its protocol list is not canonicalized.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83093 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-29 19:42:55 +00:00
Argyrios Kyrtzidis e3a535bb6b Move DeclSpec::setProtocolQualifiers() out of line.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83092 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-29 19:42:11 +00:00
Argyrios Kyrtzidis 71b0addffb Keep protocol source locations when parsing protocol references.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83091 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-29 19:41:44 +00:00
Argyrios Kyrtzidis cd01f17358 Introduce Type::getTypeClassName() that returns the string associated with the TypeClass enum.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83090 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-29 19:41:13 +00:00
Argyrios Kyrtzidis 68006af18f Introduce TypeLoc::getSourceRange().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83089 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-29 19:40:46 +00:00
Argyrios Kyrtzidis b735471f38 -Introduce TypeLoc::getOpaqueData()
-Make TypeLoc's constructor public.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83088 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-29 19:40:20 +00:00
Argyrios Kyrtzidis 1ebd7405be Add more const-goodness to ASTLocation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83087 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-29 19:39:53 +00:00
Daniel Dunbar a92ba278fd Fix truck sized thinko where Darwin/ARM toolchain didn't look for programs in
libexec, *blush*.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83086 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-29 18:52:10 +00:00
Daniel Dunbar a22b640329 Add a test case demonstrating a situation where we get protocol type checking
right for multiple anonymous categories.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83085 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-29 18:51:43 +00:00