]> granicus.if.org Git - clang/log
clang
14 years agoRefactor the constant-evaluator so that it only supports a single form
John McCall [Mon, 10 May 2010 23:27:23 +0000 (23:27 +0000)]
Refactor the constant-evaluator so that it only supports a single form
of constant-evaluation.  Formerly you could control whether it accepted
local l-values or not;  now it always evaluates local l-values in the core
routines, but filters them out where consumed by the top-level routines.
This will make it much easier to cache evaluability.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103444 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoObjective-C++ Code gen. Handle code gen. for property
Fariborz Jahanian [Mon, 10 May 2010 22:57:35 +0000 (22:57 +0000)]
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

14 years agoAllocate most of DeclarationNamesTable using ASTContext's allcocator. The only thing...
Ted Kremenek [Mon, 10 May 2010 20:56:10 +0000 (20:56 +0000)]
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

14 years agoStart converting pieces of DeclarationNameTable to be allocated using ASTContext...
Ted Kremenek [Mon, 10 May 2010 20:40:08 +0000 (20:40 +0000)]
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

14 years agoConvert CXXTempory[] in CXXExprWithTemporaries to be allocated using ASTContext's...
Ted Kremenek [Mon, 10 May 2010 20:06:30 +0000 (20:06 +0000)]
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

14 years agoImproved -ast-print-xml for C++, from Sebastien Binet!
Douglas Gregor [Mon, 10 May 2010 17:43:18 +0000 (17:43 +0000)]
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

14 years agoAlternative workaround for MSVC compilation failure, from Dimitry Andric
Douglas Gregor [Mon, 10 May 2010 17:28:19 +0000 (17:28 +0000)]
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

14 years agoIf variable location is invalid then use current location.
Devang Patel [Mon, 10 May 2010 17:24:58 +0000 (17:24 +0000)]
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

14 years agoFix refacto in r103387, noticed by Christopher Jefferson.
Daniel Dunbar [Mon, 10 May 2010 15:59:37 +0000 (15:59 +0000)]
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

14 years agoAdd an UpdateVBases parameter to UpdateEmptyClassOffsets. Not used just yet.
Anders Carlsson [Mon, 10 May 2010 15:28:59 +0000 (15:28 +0000)]
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

14 years agoMore work on handling empty classes.
Anders Carlsson [Mon, 10 May 2010 15:26:14 +0000 (15:26 +0000)]
More work on handling empty classes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103402 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agopch'ify CXXNewExpr and CXXZeroInitValueExpr
Chris Lattner [Mon, 10 May 2010 01:22:27 +0000 (01:22 +0000)]
pch'ify CXXNewExpr and CXXZeroInitValueExpr

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103390 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDoxygen-ify a comment and add an example of when this AST node is required.
Chandler Carruth [Mon, 10 May 2010 00:56:18 +0000 (00:56 +0000)]
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

14 years agofix refactor-o
Chris Lattner [Mon, 10 May 2010 00:45:12 +0000 (00:45 +0000)]
fix refactor-o

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103388 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agopchify CXXTemporary, CXXBindTemporaryExpr, and
Chris Lattner [Mon, 10 May 2010 00:25:06 +0000 (00:25 +0000)]
pchify CXXTemporary, CXXBindTemporaryExpr, and
CXXExprWithTemporaries.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103387 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix typo.
Chandler Carruth [Sun, 9 May 2010 12:16:11 +0000 (12:16 +0000)]
Fix typo.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103378 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agopch'ify default argument definitions and uses.
Chris Lattner [Sun, 9 May 2010 06:40:08 +0000 (06:40 +0000)]
pch'ify default argument definitions and uses.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103376 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agopch'ify 'this' and 'throw'
Chris Lattner [Sun, 9 May 2010 06:15:05 +0000 (06:15 +0000)]
pch'ify 'this' and 'throw'

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103375 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agopch'ify typeid.
Chris Lattner [Sun, 9 May 2010 06:03:39 +0000 (06:03 +0000)]
pch'ify typeid.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103374 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agopchify CXXMemberCallExpr correctly. Before it would serialize
Chris Lattner [Sun, 9 May 2010 05:36:05 +0000 (05:36 +0000)]
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

14 years agoCleanup.
Anders Carlsson [Sun, 9 May 2010 05:03:38 +0000 (05:03 +0000)]
Cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103370 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoBe more careful about picking a template parameter when we fail to substitute explici...
Douglas Gregor [Sun, 9 May 2010 01:26:06 +0000 (01:26 +0000)]
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

14 years agoTweaked selector mangling again (GNU runtime).
David Chisnall [Sun, 9 May 2010 01:01:43 +0000 (01:01 +0000)]
Tweaked selector mangling again (GNU runtime).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103368 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix a silly bootstrap-breaking thinko, where we were trying to convert
Douglas Gregor [Sat, 8 May 2010 23:34:38 +0000 (23:34 +0000)]
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

14 years agoActually compute the empty subobject sizes. No functionality change yet.
Anders Carlsson [Sat, 8 May 2010 23:06:26 +0000 (23:06 +0000)]
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

14 years agoImprove our handling of the -Wunused-variable warning in templates. In
Douglas Gregor [Sat, 8 May 2010 23:05:03 +0000 (23:05 +0000)]
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

14 years agoDon't complain about an __builtin_va_arg expression's result being
Douglas Gregor [Sat, 8 May 2010 22:41:50 +0000 (22:41 +0000)]
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

14 years agoAdd a SizeOfLargestEmptySubobject member to ASTRecordLayout. For C++ classes this...
Anders Carlsson [Sat, 8 May 2010 22:35:05 +0000 (22:35 +0000)]
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

14 years agoAttempted workaround for MSVC compile error
Douglas Gregor [Sat, 8 May 2010 22:24:24 +0000 (22:24 +0000)]
Attempted workaround for MSVC compile error

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103358 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoWhen instantiating statements that involve conditions (if, while, do,
Douglas Gregor [Sat, 8 May 2010 22:20:28 +0000 (22:20 +0000)]
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

14 years agoFixed linkage problem from last commit (GNU runtime).
David Chisnall [Sat, 8 May 2010 21:55:04 +0000 (21:55 +0000)]
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

14 years agoTweaked selector generation (GNU runtime). Removed the use of GlobalAliases in the...
David Chisnall [Sat, 8 May 2010 20:58:05 +0000 (20:58 +0000)]
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

14 years agoDon't destroy the data associated with an overload resolution candidate; it's ASTCont...
Douglas Gregor [Sat, 8 May 2010 20:20:05 +0000 (20:20 +0000)]
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

14 years agoRecord template argument deduction failures for member function
Douglas Gregor [Sat, 8 May 2010 20:18:54 +0000 (20:18 +0000)]
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

14 years agoWhen printing an overload candidate that failed due to SFINAE, print a
Douglas Gregor [Sat, 8 May 2010 20:07:26 +0000 (20:07 +0000)]
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

14 years agoImprove overload-candidate diagnostic for a function template that
Douglas Gregor [Sat, 8 May 2010 19:15:54 +0000 (19:15 +0000)]
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

14 years agoA leak is better than a double-free while I figure out how to address
Douglas Gregor [Sat, 8 May 2010 18:32:25 +0000 (18:32 +0000)]
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

14 years agoMinor cleanup, and ban copying of OverloadCandidateSets. No
Douglas Gregor [Sat, 8 May 2010 18:20:53 +0000 (18:20 +0000)]
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

14 years agoWhen template argument deduction fails because the call had too
Douglas Gregor [Sat, 8 May 2010 18:13:28 +0000 (18:13 +0000)]
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

14 years agoWhen printing a non-viable overload candidate that failed due to
Douglas Gregor [Sat, 8 May 2010 17:41:32 +0000 (17:41 +0000)]
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

14 years agoFix test for Release-Asserts build
Douglas Gregor [Sat, 8 May 2010 16:04:01 +0000 (16:04 +0000)]
Fix test for Release-Asserts build

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103337 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoUpdate latest checker build to a local link.
Daniel Dunbar [Sat, 8 May 2010 02:03:49 +0000 (02:03 +0000)]
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

14 years agoWhen we encounter a non-dependent type during template instantiation,
Douglas Gregor [Fri, 7 May 2010 23:12:07 +0000 (23:12 +0000)]
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

14 years agoIf there is not any debug info for type then do not emit debug info for this variable.
Devang Patel [Fri, 7 May 2010 23:05:55 +0000 (23:05 +0000)]
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

14 years agoIntroduce a recursive AST visitor that makes it trivial to recursively
Douglas Gregor [Fri, 7 May 2010 22:11:34 +0000 (22:11 +0000)]
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

14 years agoThe FP constant evaluator was missing a few cases of unary operators that return...
John McCall [Fri, 7 May 2010 22:08:54 +0000 (22:08 +0000)]
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

14 years agoadd PCH support for a bunch of C++ Decls, patch by
Chris Lattner [Fri, 7 May 2010 21:43:38 +0000 (21:43 +0000)]
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

14 years agoMake that null-dereference fix a little clearer by rearranging some code.
John McCall [Fri, 7 May 2010 21:34:32 +0000 (21:34 +0000)]
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

14 years agoFix a potential null dereference in the pointer-to-bool evaluator; caught by
John McCall [Fri, 7 May 2010 21:01:17 +0000 (21:01 +0000)]
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

14 years agoChange the pointer / lvalue constant evaluators to build into a target reference
John McCall [Fri, 7 May 2010 21:00:08 +0000 (21:00 +0000)]
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

14 years agoadd more types to -ast-print-xml, PR5006
Chris Lattner [Fri, 7 May 2010 20:45:29 +0000 (20:45 +0000)]
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

14 years agoExtend C++ usrs to include type mangling for tag decl arguments, indicating whether...
Ted Kremenek [Fri, 7 May 2010 20:39:40 +0000 (20:39 +0000)]
Extend C++ usrs to include type mangling for tag decl arguments, indicating whether a method
is static, and mangling in the qualifers of the method.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103289 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoclean up isBeforeInTranslationUnit by factoring out some common
Chris Lattner [Fri, 7 May 2010 20:35:24 +0000 (20:35 +0000)]
clean up isBeforeInTranslationUnit by factoring out some common
code into a MoveUpIncludeHierarchy helper, and use the helper to
fix a case involving macros which regressed from my recent patch.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103288 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSwitch USR generation over from NamedDecl::getNameAsString() to NamedDecl::printName().
Ted Kremenek [Fri, 7 May 2010 20:07:23 +0000 (20:07 +0000)]
Switch USR generation over from NamedDecl::getNameAsString() to NamedDecl::printName().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103285 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd NamedDecl::printName() for clients that to use getNameAsString() but are already...
Ted Kremenek [Fri, 7 May 2010 20:07:19 +0000 (20:07 +0000)]
Add NamedDecl::printName() for clients that to use getNameAsString() but are already using a raw_ostream.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103284 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoReapply the reference-binding patch applied below, along with a fix to
Douglas Gregor [Fri, 7 May 2010 19:42:26 +0000 (19:42 +0000)]
Reapply the reference-binding patch applied below, along with a fix to
ensure that we complete the type when we need to look at constructors
during reference binding.

When determining whether the two types involved in reference binding
are reference-compatible, reference-related, etc., do not complete the
type of the reference itself because it is not necessary to determine
well-formedness of the program. Complete the type that we are binding
to, since that can affect whether we know about a derived-to-base
conversion.

Re-fixes PR7080.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103283 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMinor mod. to my last patch.
Fariborz Jahanian [Fri, 7 May 2010 18:59:54 +0000 (18:59 +0000)]
Minor mod. to my last patch.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103280 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFixes a Code gen crash trying to use a dot-syntax for
Fariborz Jahanian [Fri, 7 May 2010 18:56:13 +0000 (18:56 +0000)]
Fixes a Code gen crash trying to use a dot-syntax for
a property of a c++ class object (radar 7957369).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103279 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAvoid use of DIDescriptor::getNode(). Use overloaded operators instead.
Devang Patel [Fri, 7 May 2010 18:12:35 +0000 (18:12 +0000)]
Avoid use of DIDescriptor::getNode(). Use overloaded operators instead.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103273 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoChange the complex constant evaluator to return a bool instead of an APValue.
John McCall [Fri, 7 May 2010 17:22:02 +0000 (17:22 +0000)]
Change the complex constant evaluator to return a bool instead of an APValue.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103268 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd missing #include
Douglas Gregor [Fri, 7 May 2010 15:59:09 +0000 (15:59 +0000)]
Add missing #include

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103260 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRevert r103220. It seems to be breaking self-host
Douglas Gregor [Fri, 7 May 2010 15:55:52 +0000 (15:55 +0000)]
Revert r103220. It seems to be breaking self-host

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103259 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd a stub frontend action for BoostCon, for next week's workshop.
Douglas Gregor [Fri, 7 May 2010 15:41:56 +0000 (15:41 +0000)]
Add a stub frontend action for BoostCon, for next week's workshop.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103258 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix PR4386 by implementing gcc's old behaviour (4.2) when initializing
Rafael Espindola [Fri, 7 May 2010 15:18:43 +0000 (15:18 +0000)]
Fix PR4386 by implementing gcc's old behaviour (4.2) when initializing
variables with a comparison of a function pointer with 0.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103253 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoTest case for my last fix.
Sebastian Redl [Fri, 7 May 2010 11:15:33 +0000 (11:15 +0000)]
Test case for my last fix.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103252 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoA correct fix for bug 6466.
Sebastian Redl [Fri, 7 May 2010 09:25:11 +0000 (09:25 +0000)]
A correct fix for bug 6466.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103250 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAnd finally, revert the accidental check-in part of the previous reversion. I'm on...
Sebastian Redl [Fri, 7 May 2010 09:11:09 +0000 (09:11 +0000)]
And finally, revert the accidental check-in part of the previous reversion. I'm on a roll.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103249 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRevert 103247, it causes lots of test failures.
Sebastian Redl [Fri, 7 May 2010 09:09:23 +0000 (09:09 +0000)]
Revert 103247, it causes lots of test failures.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103248 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoPass the correct type to BuildMemberReferenceExpr. Fixes bug 6466.
Sebastian Redl [Fri, 7 May 2010 09:06:26 +0000 (09:06 +0000)]
Pass the correct type to BuildMemberReferenceExpr. Fixes bug 6466.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103247 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoreimplement the guts of SourceManager::isBeforeInTranslationUnit
Chris Lattner [Fri, 7 May 2010 05:51:13 +0000 (05:51 +0000)]
reimplement the guts of SourceManager::isBeforeInTranslationUnit
to be algorithmically faster and avoid an std::map.  This routine
basically boils down to finding the nearest common ancestor in a
tree, and we (implicitly) have information about nesting depth,
use it!

This wraps up rdar://7948633 - SourceManager::isBeforeInTranslationUnit has poor performance

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103239 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoChange Evaluate* in the constant evaluator to enforce being given an argument of
John McCall [Fri, 7 May 2010 05:46:35 +0000 (05:46 +0000)]
Change Evaluate* in the constant evaluator to enforce being given an argument of
the right type.  It turns out that the code was already doing this.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103238 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMove CheckICE and isIntegerConstantExpr to ExprConstant.cpp because it seemed
John McCall [Fri, 7 May 2010 05:32:02 +0000 (05:32 +0000)]
Move CheckICE and isIntegerConstantExpr to ExprConstant.cpp because it seemed
like a good idea at the time.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103237 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agostart using the caching now that it appears to work!
Chris Lattner [Fri, 7 May 2010 05:10:46 +0000 (05:10 +0000)]
start using the caching now that it appears to work!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103236 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoreimplement the caching in the SourceManager::isBeforeInTranslationUnit()
Chris Lattner [Fri, 7 May 2010 01:17:07 +0000 (01:17 +0000)]
reimplement the caching in the SourceManager::isBeforeInTranslationUnit()
method to be correct.  Right now it correctly computes the cache, then
goes ahead and computes the result the hard way, then asserts that they
match.  Next I'll actually turn it on.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103231 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd initial USR support for mangling in the types of C++ functions and methods.
Ted Kremenek [Fri, 7 May 2010 01:04:32 +0000 (01:04 +0000)]
Add initial USR support for mangling in the types of C++ functions and methods.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103225 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd CXCursor support for LinkageSpecDecl (e.g., 'extern "C"').
Ted Kremenek [Fri, 7 May 2010 01:04:29 +0000 (01:04 +0000)]
Add CXCursor support for LinkageSpecDecl (e.g., 'extern "C"').

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103224 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd USR test case for C++ operator methods.
Ted Kremenek [Fri, 7 May 2010 01:04:23 +0000 (01:04 +0000)]
Add USR test case for C++ operator methods.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103223 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoReverted r103214.
mike-m [Fri, 7 May 2010 00:42:33 +0000 (00:42 +0000)]
Reverted r103214.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103222 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoImplement encoding of methods which have instantiated
Fariborz Jahanian [Fri, 7 May 2010 00:28:49 +0000 (00:28 +0000)]
Implement encoding of methods which have instantiated
template arguments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103221 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoWhen determining whether the two types involved in reference binding
Douglas Gregor [Fri, 7 May 2010 00:28:31 +0000 (00:28 +0000)]
When determining whether the two types involved in reference binding
are reference-compatible, reference-related, etc., do not complete the
type of the reference itself because it is not necessary to determine
well-formedness of the program. Complete the type that we are binding
to, since that can affect whether we know about a derived-to-base
conversion.

Fixes PR7080.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103220 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAfter some discussion, conservatively extend our sentinel check to discard
John McCall [Thu, 6 May 2010 23:53:00 +0000 (23:53 +0000)]
After some discussion, conservatively extend our sentinel check to discard
casts, but still require the (casted) type to be a pointer.  Fixes PR5685.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103216 91177308-0d34-0410-b5e6-96231b3b80d8

14 years ago2nd part of: Overhauled llvm/clang docs builds.
mike-m [Thu, 6 May 2010 23:46:27 +0000 (23:46 +0000)]
2nd part of: Overhauled llvm/clang docs builds.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103214 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd USR support for C++ namespaces, and unify mangling of location information in...
Ted Kremenek [Thu, 6 May 2010 23:38:28 +0000 (23:38 +0000)]
Add USR support for C++ namespaces, and unify mangling of location information in USRs
for anonymous symbols.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103212 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd CXCursor support for C++ namespaces.
Ted Kremenek [Thu, 6 May 2010 23:38:21 +0000 (23:38 +0000)]
Add CXCursor support for C++ namespaces.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103211 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoIt turns out that we should be allowing redeclarations within function
Douglas Gregor [Thu, 6 May 2010 23:31:27 +0000 (23:31 +0000)]
It turns out that we should be allowing redeclarations within function
scope. Thanks to Steven Watanabe for correcting me.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103210 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDo not give implicitly-defined virtual members functions
Douglas Gregor [Thu, 6 May 2010 23:13:35 +0000 (23:13 +0000)]
Do not give implicitly-defined virtual members functions
available_externally linkage, since they may not have been given a
strong definition in another translation unit. Without this patch, the
following test case fails to link with a GCC-compiled libstdc++:

  #include <sstream>
  int main() { std::basic_stringbuf<char> bs; }

Fixes the last problem with the Boost.IO library.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103208 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix typo in comment; 80 col violation
Douglas Gregor [Thu, 6 May 2010 22:33:50 +0000 (22:33 +0000)]
Fix typo in comment; 80 col violation

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103204 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoThe global variable for the VTT might not have external linkage; allow
Douglas Gregor [Thu, 6 May 2010 22:18:21 +0000 (22:18 +0000)]
The global variable for the VTT might not have external linkage; allow
us to find local variables, too. Fixes the last remaining
Boost.Rational failure.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103203 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agomention that cmake works on unix too. PR7061
Chris Lattner [Thu, 6 May 2010 21:57:57 +0000 (21:57 +0000)]
mention that cmake works on unix too.  PR7061

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103202 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoignore *.orig when installing, patch by Brooks Davis!
Chris Lattner [Thu, 6 May 2010 21:49:51 +0000 (21:49 +0000)]
ignore *.orig when installing, patch by Brooks Davis!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103200 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFixed DISABLE_SMART_POINTERS breakage
Douglas Gregor [Thu, 6 May 2010 21:39:56 +0000 (21:39 +0000)]
Fixed DISABLE_SMART_POINTERS breakage

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103198 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoHandle -ffunction-sections and -fdata-sections in the driver.
Rafael Espindola [Thu, 6 May 2010 21:06:04 +0000 (21:06 +0000)]
Handle -ffunction-sections and -fdata-sections in the driver.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103197 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoBasic: Update getClangRepositoryPath for my change to integration branch layout.
Daniel Dunbar [Thu, 6 May 2010 18:39:38 +0000 (18:39 +0000)]
Basic: Update getClangRepositoryPath for my change to integration branch layout.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103192 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDiagnose deprecated/unavailable functions selected by overload resolution.
John McCall [Thu, 6 May 2010 18:15:07 +0000 (18:15 +0000)]
Diagnose deprecated/unavailable functions selected by overload resolution.
Fixes rdar://problem/4232969, or at least the clang parts of it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103191 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoTry to work around a Visual C++ bug with copy-assignment.
Douglas Gregor [Thu, 6 May 2010 18:05:52 +0000 (18:05 +0000)]
Try to work around a Visual C++ bug with copy-assignment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103190 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRework our handling of temporary objects within the conditions of
Douglas Gregor [Thu, 6 May 2010 17:25:47 +0000 (17:25 +0000)]
Rework our handling of temporary objects within the conditions of
if/switch/while/do/for statements. Previously, we would end up either:

  (1) Forgetting to destroy temporaries created in the condition (!),
  (2) Destroying the temporaries created in the condition *before*
  converting the condition to a boolean value (or, in the case of a
  switch statement, to an integral or enumeral value), or
  (3) In a for statement, destroying the condition's temporaries at
  the end of the increment expression (!).

We now destroy temporaries in conditions at the right times. This
required some tweaking of the Parse/Sema interaction, since the parser
was building full expressions too early in many places.

Fixes PR7067.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103187 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoCode Gen support for Getter/Setter synthesis of
Fariborz Jahanian [Thu, 6 May 2010 15:45:36 +0000 (15:45 +0000)]
Code Gen support for Getter/Setter synthesis of
C++ object properties. (still radar 7468090).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103182 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoReverted part of r103177 (repositioning of clang-builtin include/)
mike-m [Thu, 6 May 2010 15:23:52 +0000 (15:23 +0000)]
Reverted part of r103177 (repositioning of clang-builtin include/)
which breaks clang-i686-xp-msvc9 test-clang.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103180 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoReposition clang-builtin include/ to immediately precede /usr/include/,
mike-m [Thu, 6 May 2010 14:11:13 +0000 (14:11 +0000)]
Reposition clang-builtin include/ to immediately precede /usr/include/,
matching gcc compiler. Fixes #include_next <...> shenanigans that lead to
file-not-found failures with <cstddef> on libstdc++ 4.3.[012].

Updated C++ include header search paths for various Debian/Ubuntu and Fedora
linux distros.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103177 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoPush TypeSourceInfo::getTypeLoc() into a header file so that it's
John McCall [Thu, 6 May 2010 09:25:57 +0000 (09:25 +0000)]
Push TypeSourceInfo::getTypeLoc() into a header file so that it's
inlineable.  That header file has to be TypeLoc.h, which means that
TypeLoc.h needs to depend on Decl.h because TypeSourceInfo doesn't
have its own header.  That could be remedied, though.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103176 91177308-0d34-0410-b5e6-96231b3b80d8