]> granicus.if.org Git - clang/log
clang
14 years agoImprove commentary on the indirect-goto jump scope checker and extract
John McCall [Wed, 12 May 2010 02:37:54 +0000 (02:37 +0000)]
Improve commentary on the indirect-goto jump scope checker and extract
a convenience routine to find the innermost common ancestor of two scopes.

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

14 years agoCorrect spelling of expected error message. Apparently I forgot to re-run
John McCall [Wed, 12 May 2010 01:15:36 +0000 (01:15 +0000)]
Correct spelling of expected error message.  Apparently I forgot to re-run
the test suite after modifying this diagnostic.

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

14 years agoWhen checking scopes for indirect goto, be more permissive (but still safe)
John McCall [Wed, 12 May 2010 00:58:13 +0000 (00:58 +0000)]
When checking scopes for indirect goto, be more permissive (but still safe)
about the permitted scopes.  Specifically:
  1) Permit labels and gotos to appear after a prologue of variable initializations.
  2) Permit indirect gotos to jump out of scopes that don't require cleanup.
  3) Diagnose possible attempts to indirect-jump out of scopes that do require
     cleanup.
This requires a substantial reinvention of the algorithm for checking indirect
goto.  The current algorithm is Omega(M*N), with M = the number of unique
scopes being jumped from and N = the number of unique scopes being jumped to,
with an additional factor that is probably (worst-case) linear in the depth
of scopes.  Thus the entire thing is likely cubic given some truly bizarre
ill-formed code;  on well-formed code the additional factor collapses to
an amortized constant (when amortized over the entire function) and so
the algorithm is quadratic.  Even this requires every label to appear in
its own scope, which would be very unusual for indirect-goto code (and
extremely unlikely for well-formed code);  it is far more likely that
all labels will be in the same scope and so the algorithm becomes linear.
For such a marginal feature, I am fairly happy with this result.

(this is using JumpDiagnostic's definition of scope, where successive
variables in a block appear in their own scope)

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

14 years agoUse end location of DeclStmt to mark stop point.
Devang Patel [Wed, 12 May 2010 00:39:34 +0000 (00:39 +0000)]
Use end location of DeclStmt to mark stop point.
This is meaningful for blocks. This patch fixes bunch of test failures in gdb testsuite.

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

14 years agoBoostCon tutorial notes, temporary
Douglas Gregor [Tue, 11 May 2010 22:09:20 +0000 (22:09 +0000)]
BoostCon tutorial notes, temporary

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

14 years agoMerged Elaborated and QualifiedName types.
Abramo Bagnara [Tue, 11 May 2010 21:36:43 +0000 (21:36 +0000)]
Merged Elaborated and QualifiedName types.

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

14 years agoSpeculatively revert r103497, "Do not mark the virtual members of an
Daniel Dunbar [Tue, 11 May 2010 21:32:35 +0000 (21:32 +0000)]
Speculatively revert r103497, "Do not mark the virtual members of an
implicitly-instantiated class as ...", which seems to have broken bootstrap.

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

14 years agoIRgen/i386/C++: Fix isSingleElementStruct computation for C++ record decls.
Daniel Dunbar [Tue, 11 May 2010 21:15:36 +0000 (21:15 +0000)]
IRgen/i386/C++: Fix isSingleElementStruct computation for C++ record decls.
 - Fixes PR7098.

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

14 years agoDo not mark the virtual members of an implicitly-instantiated class as
Douglas Gregor [Tue, 11 May 2010 20:24:17 +0000 (20:24 +0000)]
Do not mark the virtual members of an implicitly-instantiated class as
referenced unless we see one of them defined (or the key function
defined, if it as one) or if we need the vtable for something. Fixes
PR7114.

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

14 years agoVISIBILITY_HIDDEN was renamed LLVM_LIBRARY_VISIBILITY.
Duncan Sands [Tue, 11 May 2010 20:16:05 +0000 (20:16 +0000)]
VISIBILITY_HIDDEN was renamed LLVM_LIBRARY_VISIBILITY.

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

14 years agoFix test.
Fariborz Jahanian [Tue, 11 May 2010 18:48:13 +0000 (18:48 +0000)]
Fix test.

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

14 years agoIt's bad form to create VarDecl's without DeclContexts
Douglas Gregor [Tue, 11 May 2010 18:17:16 +0000 (18:17 +0000)]
It's bad form to create VarDecl's without DeclContexts

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

14 years agoThe C++98/03 standard is disturbingly silent about out-of-scope
Douglas Gregor [Tue, 11 May 2010 17:39:34 +0000 (17:39 +0000)]
The C++98/03 standard is disturbingly silent about out-of-scope
explicit instantiations of template. C++0x clarifies the intent
(they're ill-formed in some cases; see [temp.explicit] for
details). However, one could squint at the C++98/03 standard and
conclude they are permitted, so reduce the error to a warning
(controlled by -Wc++0x-compat) in C++98/03 mode.

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

14 years agoStatic data members intialized in-class that have constant values are
Douglas Gregor [Tue, 11 May 2010 16:41:27 +0000 (16:41 +0000)]
Static data members intialized in-class that have constant values are
value-dependent if their initializers are value-dependent; my recent
tweak to these dependent rules overstepped by taking away this
value-dependents. Fixes a Boost.GIL regression.

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

14 years agoMinor refactoring of my last patch.
Fariborz Jahanian [Tue, 11 May 2010 16:31:10 +0000 (16:31 +0000)]
Minor refactoring of my last patch.

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

14 years agoFix indentation
Douglas Gregor [Tue, 11 May 2010 08:44:04 +0000 (08:44 +0000)]
Fix indentation

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

14 years agoA DeclRefExpr that refers to a member function or a static data member
Douglas Gregor [Tue, 11 May 2010 08:41:30 +0000 (08:41 +0000)]
A DeclRefExpr that refers to a member function or a static data member
of the current instantiation is value-dependent. The C++ standard
fails to enumerate this case and, therefore, we missed it. Chandler
did all of the hard work of reducing the last remaining
Boost.PtrContainer failure (which had to do with static initialization
in the Serialization library) down to this simple little test.

While I'm at it, clean up the dependence rules for template arguments
that are declarations, and implement the dependence rules for template
argument packs.

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

14 years agoAdd a test for a subtle instantiation pattern that showed up within a Boost
Chandler Carruth [Tue, 11 May 2010 08:02:08 +0000 (08:02 +0000)]
Add a test for a subtle instantiation pattern that showed up within a Boost
miscompile reduction. Clang already handles this correctly, but let's make sure
it stays that way.

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

14 years agoFixes for compilation with Microsoft Visual Studio 2010, from Steven Watanabe!
Douglas Gregor [Tue, 11 May 2010 06:18:17 +0000 (06:18 +0000)]
Fixes for compilation with Microsoft Visual Studio 2010, from Steven Watanabe!

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

14 years agoInitialize Column.
Devang Patel [Mon, 10 May 2010 23:48:38 +0000 (23:48 +0000)]
Initialize Column.

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

14 years agoAllow static_cast to objective-c pointers.
Fariborz Jahanian [Mon, 10 May 2010 23:46:53 +0000 (23:46 +0000)]
Allow static_cast to objective-c pointers.
Fixes radar 7952457.

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

14 years agotests: Avoid spurious use of /dev/null.
Daniel Dunbar [Mon, 10 May 2010 23:31:31 +0000 (23:31 +0000)]
tests: Avoid spurious use of /dev/null.

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

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