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

21553 Коммитов

Автор SHA1 Сообщение Дата
Fariborz Jahanian b3ebe946d3 Objective-C++ Code gen. Handle code gen. for property
reference dot-syntax notation in a varierty of cases.
Fixes radar 7964490.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103440 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-10 22:57:35 +00:00
Ted Kremenek 45d9c2d2b1 Allocate most of DeclarationNamesTable using ASTContext's allcocator. The only things that
aren't allocated this way are the internal FoldingSets.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103429 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-10 20:56:10 +00:00
Ted Kremenek ac9590effa Start converting pieces of DeclarationNameTable to be allocated using ASTContext's allocator.
While DeclarationNameTable doesn't leak, it uses 'malloc' too often.  Start with having
'CXXLiteralOperatorNames' allocated using ASTContext's allocator and add a 'DoDestroy()' method
to DeclarationNameTable that is called by ~ASTContext.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103426 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-10 20:40:08 +00:00
Ted Kremenek d04ed416be Convert CXXTempory[] in CXXExprWithTemporaries to be allocated using ASTContext's allocator. Fixes <rdar://problem/7961605>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103421 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-10 20:06:30 +00:00
Douglas Gregor 4bd98e8860 Improved -ast-print-xml for C++, from Sebastien Binet!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103412 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-10 17:43:18 +00:00
Douglas Gregor c896ea80bb Alternative workaround for MSVC compilation failure, from Dimitry Andric
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103409 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-10 17:28:19 +00:00
Devang Patel 258cf27668 If variable location is invalid then use current location.
This fixes radar 7959934.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103408 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-10 17:24:58 +00:00
Daniel Dunbar 90556d43dc Fix refacto in r103387, noticed by Christopher Jefferson.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103406 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-10 15:59:37 +00:00
Anders Carlsson ecafebe28f Add an UpdateVBases parameter to UpdateEmptyClassOffsets. Not used just yet.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103403 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-10 15:28:59 +00:00
Anders Carlsson 3159ffeb23 More work on handling empty classes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103402 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-10 15:26:14 +00:00
Chris Lattner 5921863d8f pch'ify CXXNewExpr and CXXZeroInitValueExpr
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103390 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-10 01:22:27 +00:00
Chandler Carruth ddfe960d25 Doxygen-ify a comment and add an example of when this AST node is required.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103389 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-10 00:56:18 +00:00
Chris Lattner aff32cb549 fix refactor-o
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103388 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-10 00:45:12 +00:00
Chris Lattner d259836887 pchify CXXTemporary, CXXBindTemporaryExpr, and
CXXExprWithTemporaries.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103387 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-10 00:25:06 +00:00
Chandler Carruth 5ce6677706 Fix typo.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103378 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-09 12:16:11 +00:00
Chris Lattner 030854b95f pch'ify default argument definitions and uses.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103376 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-09 06:40:08 +00:00
Chris Lattner 2fbdfcdf3b pch'ify 'this' and 'throw'
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103375 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-09 06:15:05 +00:00
Chris Lattner 14ab24f01e pch'ify typeid.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103374 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-09 06:03:39 +00:00
Chris Lattner 1817bd483b pchify CXXMemberCallExpr correctly. Before it would serialize
and deserialize as a CallExpr which is close, but ends up
deserializing with the wrong stmt class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103371 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-09 05:36:05 +00:00
Anders Carlsson ddae877b5d Cleanup.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103370 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-09 05:03:38 +00:00
Douglas Gregor fe52c91dcd Be more careful about picking a template parameter when we fail to substitute explicit template arguments into a function template
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103369 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-09 01:26:06 +00:00
David Chisnall 22b8827d34 Tweaked selector mangling again (GNU runtime).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103368 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-09 01:01:43 +00:00
Douglas Gregor afa0fefb57 Fix a silly bootstrap-breaking thinko, where we were trying to convert
non-existent condition expressions to boolean values during template
instantiation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103364 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-08 23:34:38 +00:00
Anders Carlsson 836fc14e6c Actually compute the empty subobject sizes. No functionality change yet.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103363 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-08 23:06:26 +00:00
Douglas Gregor 5764f613e6 Improve our handling of the -Wunused-variable warning in templates. In
particular, don't complain about unused variables that have dependent
type until instantiation time, so that we can look at the type of the
variable. Moreover, only complain about unused variables that have
neither a user-declared constructor nor a non-trivial destructor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103362 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-08 23:05:03 +00:00
Douglas Gregor c6dfe194f6 Don't complain about an __builtin_va_arg expression's result being
unused, since the operation has side effects.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103360 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-08 22:41:50 +00:00
Anders Carlsson c3fddeb438 Add a SizeOfLargestEmptySubobject member to ASTRecordLayout. For C++ classes this will hold the largest empty subobject or 0 if the class doesn't have any empty subobjects.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103359 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-08 22:35:05 +00:00
Douglas Gregor 1f10962edd Attempted workaround for MSVC compile error
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103358 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-08 22:24:24 +00:00
Douglas Gregor eaa18e449b When instantiating statements that involve conditions (if, while, do,
for, and switch), be careful to construct the full expressions as soon
as we perform template instantation, so we don't either forget to call
temporary destructors or destroy temporaries at the wrong time. This
is the template-instantiation analogue to r103187, during which I
hadn't realized that the issue would affect the handling of these
constructs differently inside and outside of templates.

Fixes a regression in Boost.Function.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103357 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-08 22:20:28 +00:00
David Chisnall 20fba8ad3f Fixed linkage problem from last commit (GNU runtime).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103355 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-08 21:55:04 +00:00
David Chisnall 87935a8d5c Tweaked selector generation (GNU runtime). Removed the use of GlobalAliases in the generated bitcode.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103353 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-08 20:58:05 +00:00
Douglas Gregor aaa045dbe7 Don't destroy the data associated with an overload resolution candidate; it's ASTContext-allocated now
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103350 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-08 20:20:05 +00:00
Douglas Gregor ff5adac099 Record template argument deduction failures for member function
templates and conversion function templates. 


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103349 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-08 20:18:54 +00:00
Douglas Gregor ec20f46740 When printing an overload candidate that failed due to SFINAE, print a
specific message that includes the template arguments, e.g.,

test/SemaTemplate/overload-candidates.cpp:27:20: note: candidate template
      ignored: substitution failure [with T = int *]
  typename T::type get_type(const T&); // expected-note{{candidate ...
                   ^



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103348 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-08 20:07:26 +00:00
Douglas Gregor f1a8445036 Improve overload-candidate diagnostic for a function template that
failed because the explicitly-specified template arguments did not
match its template parameters, e.g.,

test/SemaTemplate/overload-candidates.cpp:18:8: note: candidate
template
      ignored: invalid explicitly-specified argument for template
      parameter 'I'
  void get(const T&);
       ^
test/SemaTemplate/overload-candidates.cpp:20:8: note: candidate
template
      ignored: invalid explicitly-specified argument for 1st template
      parameter
  void get(const T&);
       ^



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103344 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-08 19:15:54 +00:00
Douglas Gregor a95342c9d4 A leak is better than a double-free while I figure out how to address
this issue.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103343 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-08 18:32:25 +00:00
Douglas Gregor 0ca4c58cba Minor cleanup, and ban copying of OverloadCandidateSets. No
functionality change. 


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103342 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-08 18:20:53 +00:00
Douglas Gregor a18592ec62 When template argument deduction fails because the call had too
many/too few arguments, use the same diagnostic we use for arity
mismatches in non-templates (but note that it's a function template).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103341 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-08 18:13:28 +00:00
Douglas Gregor a933319ebf When printing a non-viable overload candidate that failed due to
conflicting deduced template argument values, give a more specific
reason along with those values, e.g.,

test/SemaTemplate/overload-candidates.cpp:4:10: note: candidate template
      ignored: deduced conflicting types for parameter 'T' ('int' vs. 'long')
const T& min(const T&, const T&); 
         ^




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103339 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-08 17:41:32 +00:00
Douglas Gregor 40e629920b Fix test for Release-Asserts build
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103337 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-08 16:04:01 +00:00
Daniel Dunbar 0506af32ac Update latest checker build to a local link.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103332 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-08 02:03:49 +00:00
Douglas Gregor b4eeaff159 When we encounter a non-dependent type during template instantiation,
mark any declarations we see inside of that type as
"referenced". Fixes PR7079.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103323 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-07 23:12:07 +00:00
Devang Patel f4e54a2ddf If there is not any debug info for type then do not emit debug info for this variable.
A recent change to tightly verify debug info prepared by FE caught this.
This fixes unittest build.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103320 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-07 23:05:55 +00:00
Douglas Gregor d30bf2eb6d Introduce a recursive AST visitor that makes it trivial to recursively
walk an entire AST, including all of the types, declarations,
statements, and expressions, and allowing one to easily override the
behavior of the walk at any particular node kind.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103308 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-07 22:11:34 +00:00
John McCall abd3a857ac The FP constant evaluator was missing a few cases of unary operators that return floats
but whose operand isn't a float:  specifically, __real__ and __imag__.  Instead
of filtering these out, just implement them.

Fixes <rdar://problem/7958272>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103307 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-07 22:08:54 +00:00
Chris Lattner 6ad9ac0979 add PCH support for a bunch of C++ Decls, patch by
Andrew Sutton!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103301 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-07 21:43:38 +00:00
John McCall 3554283157 Make that null-dereference fix a little clearer by rearranging some code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103298 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-07 21:34:32 +00:00
John McCall ce87e6d501 Fix a potential null dereference in the pointer-to-bool evaluator; caught by
Eli Friedman.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103297 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-07 21:01:17 +00:00
John McCall efdb83e26f Change the pointer / lvalue constant evaluators to build into a target reference
and return a bool.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103296 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-07 21:00:08 +00:00
Chris Lattner fde75965ce add more types to -ast-print-xml, PR5006
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103294 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-07 20:45:29 +00:00