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

8765 Коммитов

Автор SHA1 Сообщение Дата
Fariborz Jahanian 339798eae1 Patch to implement Protocols on class extensions.
<rdar://problem/7269631> Protocols on class extensions don't work



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83322 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-05 20:41:32 +00:00
Douglas Gregor b8d1191fde Provide a common set of routines in Version.h that return Subversion
branch/revision information. Use that information in the driver,
rather than one-off branch/revision computation. 



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83321 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-05 20:33:49 +00:00
Douglas Gregor 60b5d8ed59 Pre-commit commit to get URL keyword expansion for Clang version information
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83319 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-05 18:52:24 +00:00
Benjamin Kramer ffbb15e54a Use new predicates for some type equality tests.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83303 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-05 13:47:21 +00:00
Anders Carlsson 719aa44de4 Pass the canonical method decl to GetVtableIndex. Fixes PR5120.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83272 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-03 19:56:56 +00:00
Anders Carlsson 375c31c467 Implement code generation of member function pointer calls. Fixes PR5121.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83271 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-03 19:43:08 +00:00
Anders Carlsson 83ccfc3cf0 Create CXXMemberCallExpr for pointer-to-member calls.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83268 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-03 17:40:22 +00:00
Anders Carlsson 26bc220377 Ignore No-op casts when evaluating lvalue expressions. Fixes PR5122.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83267 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-03 16:30:22 +00:00
Anders Carlsson a024d17048 Teach AggExprEmitter about pointers to member functions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83266 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-03 15:43:24 +00:00
Anders Carlsson 2c51f092e4 Handle base-to-derived casts of member function pointers in CGExprConstant.cpp
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83265 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-03 15:13:22 +00:00
Anders Carlsson f57b4e44d0 Handle members to function pointers in CGExprConstant.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83264 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-03 15:02:02 +00:00
Anders Carlsson 2b3583573b Move some functions from CodeGenFunctions to CodeGenModule so they can be used by CGExprConstant.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83263 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-03 14:56:57 +00:00
Anders Carlsson 2df96e7019 Don't update the struct alignment when adding fields to a packed struct. Fixes PR5118.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83235 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-02 04:52:12 +00:00
Mike Stump 3d363c596d More magic pixie dust.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83232 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-02 02:30:50 +00:00
Mike Stump 944e705766 Fix up debug information for block pointers a bit more.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83231 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-02 02:23:37 +00:00
Anders Carlsson 31f2f9ced8 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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83230 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-02 02:15:20 +00:00
Douglas Gregor b2f81cf7f8 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83225 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-01 23:51:25 +00:00
Steve Naroff d789d3d985 - Remove Sema::FindMethodInNestedImplementations().
- Add ObjCInterfaceDecl::lookupPrivateInstanceMethod().
- Convert clients.

No functionality change - One less method in Sema:-)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83224 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-01 23:46:04 +00:00
Douglas Gregor 1be8aee874 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83222 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-01 23:25:31 +00:00
Mike Stump b289b3f324 Implement a FIXME. This improves codegen just a tad.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83221 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-01 22:29:41 +00:00
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
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
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
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
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
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 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 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