Commit Graph

22667 Commits

Author SHA1 Message Date
Douglas Gregor 02eb4835ce 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).

llvm-svn: 103341
2010-05-08 18:13:28 +00:00
Douglas Gregor 3626a5cac2 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&); 
         ^

llvm-svn: 103339
2010-05-08 17:41:32 +00:00
Douglas Gregor 14653638de Fix test for Release-Asserts build
llvm-svn: 103337
2010-05-08 16:04:01 +00:00
Daniel Dunbar d43f08d06e Update latest checker build to a local link.
llvm-svn: 103332
2010-05-08 02:03:49 +00:00
Douglas Gregor 5597ab4076 When we encounter a non-dependent type during template instantiation,
mark any declarations we see inside of that type as
"referenced". Fixes PR7079.

llvm-svn: 103323
2010-05-07 23:12:07 +00:00
Devang Patel 67eba80672 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.

llvm-svn: 103320
2010-05-07 23:05:55 +00:00
Douglas Gregor e0c5497935 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.

llvm-svn: 103308
2010-05-07 22:11:34 +00:00
John McCall b1fb0d3610 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>.

llvm-svn: 103307
2010-05-07 22:08:54 +00:00
Chris Lattner ca025db769 add PCH support for a bunch of C++ Decls, patch by
Andrew Sutton!

llvm-svn: 103301
2010-05-07 21:43:38 +00:00
John McCall eb3e4f3481 Make that null-dereference fix a little clearer by rearranging some code.
llvm-svn: 103298
2010-05-07 21:34:32 +00:00
John McCall 06f0e09756 Fix a potential null dereference in the pointer-to-bool evaluator; caught by
Eli Friedman.

llvm-svn: 103297
2010-05-07 21:01:17 +00:00
John McCall 45d55e4f26 Change the pointer / lvalue constant evaluators to build into a target reference
and return a bool.

llvm-svn: 103296
2010-05-07 21:00:08 +00:00
Chris Lattner e979e30501 add more types to -ast-print-xml, PR5006
llvm-svn: 103294
2010-05-07 20:45:29 +00:00
Ted Kremenek 37c220c8ed 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.

llvm-svn: 103289
2010-05-07 20:39:40 +00:00
Chris Lattner a99fa1aee1 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.

llvm-svn: 103288
2010-05-07 20:35:24 +00:00
Ted Kremenek dacfc2eee6 Switch USR generation over from NamedDecl::getNameAsString() to NamedDecl::printName().
llvm-svn: 103285
2010-05-07 20:07:23 +00:00
Ted Kremenek c14f5eb3ec Add NamedDecl::printName() for clients that to use getNameAsString() but are already using a raw_ostream.
llvm-svn: 103284
2010-05-07 20:07:19 +00:00
Douglas Gregor 496e8b345c 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.

llvm-svn: 103283
2010-05-07 19:42:26 +00:00
Fariborz Jahanian 7828ab1ed9 Minor mod. to my last patch.
llvm-svn: 103280
2010-05-07 18:59:54 +00:00
Fariborz Jahanian fdf474b05e Fixes a Code gen crash trying to use a dot-syntax for
a property of a c++ class object (radar 7957369).

llvm-svn: 103279
2010-05-07 18:56:13 +00:00
Devang Patel ba4ad7f2fd Avoid use of DIDescriptor::getNode(). Use overloaded operators instead.
llvm-svn: 103273
2010-05-07 18:12:35 +00:00
John McCall 93d91dcdb7 Change the complex constant evaluator to return a bool instead of an APValue.
llvm-svn: 103268
2010-05-07 17:22:02 +00:00
Douglas Gregor dda3f33987 Add missing #include
llvm-svn: 103260
2010-05-07 15:59:09 +00:00
Douglas Gregor 56f14e575d Revert r103220. It seems to be breaking self-host
llvm-svn: 103259
2010-05-07 15:55:52 +00:00
Douglas Gregor 542ad31597 Add a stub frontend action for BoostCon, for next week's workshop.
llvm-svn: 103258
2010-05-07 15:41:56 +00:00
Rafael Espindola a1f9cc1bec Fix PR4386 by implementing gcc's old behaviour (4.2) when initializing
variables with a comparison of a function pointer with 0.

llvm-svn: 103253
2010-05-07 15:18:43 +00:00
Sebastian Redl 872fad8627 Test case for my last fix.
llvm-svn: 103252
2010-05-07 11:15:33 +00:00
Sebastian Redl fa1f70f338 A correct fix for bug 6466.
llvm-svn: 103250
2010-05-07 09:25:11 +00:00
Sebastian Redl 2e702738bb And finally, revert the accidental check-in part of the previous reversion. I'm on a roll.
llvm-svn: 103249
2010-05-07 09:11:09 +00:00
Sebastian Redl 0b4e312566 Revert 103247, it causes lots of test failures.
llvm-svn: 103248
2010-05-07 09:09:23 +00:00
Sebastian Redl 019b5dbc55 Pass the correct type to BuildMemberReferenceExpr. Fixes bug 6466.
llvm-svn: 103247
2010-05-07 09:06:26 +00:00
Chris Lattner 06821c9e90 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

llvm-svn: 103239
2010-05-07 05:51:13 +00:00
John McCall f0c4f356b8 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.

llvm-svn: 103238
2010-05-07 05:46:35 +00:00
John McCall 864e396d0b Move CheckICE and isIntegerConstantExpr to ExprConstant.cpp because it seemed
like a good idea at the time.

llvm-svn: 103237
2010-05-07 05:32:02 +00:00
Chris Lattner 46e3b4808f start using the caching now that it appears to work!
llvm-svn: 103236
2010-05-07 05:10:46 +00:00
Chris Lattner 66d2f924b4 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.

llvm-svn: 103231
2010-05-07 01:17:07 +00:00
Ted Kremenek 586ff60cfc Add initial USR support for mangling in the types of C++ functions and methods.
llvm-svn: 103225
2010-05-07 01:04:32 +00:00
Ted Kremenek b80cba5d7d Add CXCursor support for LinkageSpecDecl (e.g., 'extern "C"').
llvm-svn: 103224
2010-05-07 01:04:29 +00:00
Ted Kremenek fca5afb421 Add USR test case for C++ operator methods.
llvm-svn: 103223
2010-05-07 01:04:23 +00:00
mike-m 9f08a6f1a8 Reverted r103214.
llvm-svn: 103222
2010-05-07 00:42:33 +00:00
Fariborz Jahanian c5158203dd Implement encoding of methods which have instantiated
template arguments.

llvm-svn: 103221
2010-05-07 00:28:49 +00:00
Douglas Gregor d80c0238bb 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.

llvm-svn: 103220
2010-05-07 00:28:31 +00:00
John McCall 7ddbcf4f4b After some discussion, conservatively extend our sentinel check to discard
casts, but still require the (casted) type to be a pointer.  Fixes PR5685.

llvm-svn: 103216
2010-05-06 23:53:00 +00:00
mike-m 9bb682b713 2nd part of: Overhauled llvm/clang docs builds.
llvm-svn: 103214
2010-05-06 23:46:27 +00:00
Ted Kremenek 0b4b46e3e1 Add USR support for C++ namespaces, and unify mangling of location information in USRs
for anonymous symbols.

llvm-svn: 103212
2010-05-06 23:38:28 +00:00
Ted Kremenek bd67fb208d Add CXCursor support for C++ namespaces.
llvm-svn: 103211
2010-05-06 23:38:21 +00:00
Douglas Gregor 4b718ee691 It turns out that we should be allowing redeclarations within function
scope. Thanks to Steven Watanabe for correcting me.

llvm-svn: 103210
2010-05-06 23:31:27 +00:00
Douglas Gregor d8bb3aff76 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.

llvm-svn: 103208
2010-05-06 23:13:35 +00:00
Douglas Gregor 1411bb8f76 Fix typo in comment; 80 col violation
llvm-svn: 103204
2010-05-06 22:33:50 +00:00
Douglas Gregor ae498b3211 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.

llvm-svn: 103203
2010-05-06 22:18:21 +00:00