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

18160 Коммитов

Автор SHA1 Сообщение Дата
Anders Carlsson 3b5ad2283c Move a few more functions away from CGCXX and to CGClass and CGExprCXX.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92399 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-01 20:29:01 +00:00
Douglas Gregor e3582011a6 Make sure that the search for visible declarations looks into the semantic parents of out-of-line function contexts
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92397 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-01 17:44:25 +00:00
Douglas Gregor 736fc1b588 Fix typo test RUN lines
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92396 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-01 17:23:17 +00:00
Mike Stump 13b2f92184 Fix last patch, catch of reference to non-pointer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92386 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-01 03:20:32 +00:00
Mike Stump b606c38468 Fix catching a reference to a pointer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92385 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-01 02:51:52 +00:00
Douglas Gregor d203a16296 When typo correction for an id-expression finds a type (or Objective-C
class), provide a suggestion for the type or class found. However,
since we can't recover properly in this case, don't provide a fix-it
hint. Example:

test/FixIt/typo.m:8:3: error: use of undeclared identifier 'NSstring';
did you
      mean 'NSString'?
  NSstring *str = @"A string";
  ...
  ^
1 diagnostic generated.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92379 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-01 00:15:04 +00:00
Douglas Gregor c171e3b192 Typo correction for C99 designated field initializers, e.g.,
test/FixIt/typo.c:19:4: error: field designator 'bunds' does not refer to any
      field in type 'struct Window'; did you mean 'bounds'?
  .bunds.
   ^~~~~
   bounds



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92376 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-01 00:03:05 +00:00
Anders Carlsson e8f90389c4 If the key function of a record is inline, then the RTTI data should have weak_odr linkage.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92371 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-31 19:36:25 +00:00
Anders Carlsson ac4c939c2d It's OK for a return type to be incomplete if it's being defined.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92367 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-31 18:54:35 +00:00
Anders Carlsson be2e205add Make sure that an overriding return type is complete before checking if it's covariant. Fixes PR5920.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92365 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-31 18:34:24 +00:00
Anders Carlsson bba4d023de Remove rtti.cpp, it's very fragile and has been marked XFAIL for a while now. Between rtti-layout.cpp and rtti-linkage.cpp, RTTI testing should be covered.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92361 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-31 17:44:32 +00:00
Anders Carlsson 531d55ff7b More RTTI builder cleanup.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92360 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-31 17:43:53 +00:00
Benjamin Kramer ffd6e39006 Avoid an unnecessary copy of Predefines. getMemBufferCopy does the null termination for us.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92358 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-31 15:33:09 +00:00
Benjamin Kramer b939a4e8b4 Convert to StringRef, avoid a memcpy in the common case.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92357 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-31 13:32:38 +00:00
Douglas Gregor fe0241e31d Typo correction for C++ base and member initializers, e.g.,
test/FixIt/typo.cpp:41:15: error: initializer 'base' does not name a non-static
      data member or base class; did you mean the base class 'Base'?
  Derived() : base(),
              ^~~~
              Base
test/FixIt/typo.cpp:42:15: error: initializer 'ember' does not name a non-static
      data member or base class; did you mean the member 'member'?
              ember() { }
              ^~~~~
              member



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92355 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-31 09:10:24 +00:00
Douglas Gregor 6c409a0319 Add another typo test for nested-name-specifiers
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92351 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-31 08:27:32 +00:00
Douglas Gregor 175a65686e Typo correction for identifiers within nested name specifiers, e.g.,
typo.cpp:18:1: error: use of undeclared identifier 'other_std'; did
      you mean 'otherstd'?
other_std::strng str1;
^~~~~~~~~
otherstd




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92350 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-31 08:26:35 +00:00
Douglas Gregor bfea239caf Typo correction for template names, e.g.,
typo.cpp:27:8: error: no template named 'basic_sting' in namespace 'std'; 
    did you mean 'basic_string'?
  std::basic_sting<char> b2;
  ~~~~~^~~~~~~~~~~
       basic_string



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92348 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-31 08:11:17 +00:00
Douglas Gregor 2dcc01195b Typo correction for member access into classes/structs/unions, e.g.,
s.fnd("hello")




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92345 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-31 07:42:17 +00:00
Zhongxing Xu b94b81a9ab Let constraint manager inform checkers that some assumption logic has happend.
Add new states for symbolic regions tracked by malloc checker. This enables us
to do malloc checking more accurately. See test case.

Based on Lei Zhang's patch and discussion.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92342 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-31 06:13:07 +00:00
Douglas Gregor bb092bafa9 Implement typo correction for id-expressions, e.g.,
typo.cpp:22:10: error: use of undeclared identifier 'radious'; did
      you mean 'radius'?
  return radious * pi;
         ^~~~~~~
         radius

This was super-easy, since we already had decent recovery by looking
for names in dependent base classes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92341 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-31 05:20:13 +00:00
Chris Lattner 8c3f89032c improve diagnostics for case when a field type is unknown by
not emitting a follow-on error about 'int', which the user
never wrote.  PR5924.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92339 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-31 03:10:55 +00:00
Anders Carlsson 0814809e5b Fix a bunch of bugs with VMI RTTI building, and add a whole bunch of tests.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92319 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-30 23:47:56 +00:00
Zhongxing Xu a8c6c448c9 The element type should also be canonicalized. Add a case for VariableArrayType.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92318 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-30 22:59:54 +00:00
Chris Lattner 634785ca84 testcase for previous patch!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92317 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-30 22:10:22 +00:00
Chris Lattner 551f708778 when making a decl for __builtin_fabsf() make sure to
attach the appropriate attributes to it.  I don't think
this manifests as any real change though, we're still
not getting the right LLVM IR attributes out of codegen.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92316 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-30 22:06:22 +00:00
Zhongxing Xu f2017d13eb Fix a comment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92314 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-30 21:24:23 +00:00
Chris Lattner e8337dff77 fix PR5917, L'x' was getting the wrong type in c++ mode. Per
C++2.13.2p2: "A wide-character literal has type wchar_t"


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92313 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-30 21:19:39 +00:00
Fariborz Jahanian 6f0a0a9d20 When rewriting a __block declaration, use a suitable API to get location of
the declaration in the presence of an initializer macro.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92312 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-30 20:38:08 +00:00
Chris Lattner 6b401c0e7f remove extraneous #include
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92310 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-30 19:54:10 +00:00
Douglas Gregor 546be3c5c0 Typo correction for type names when they appear in declarations, e.g., given
tring str2;

we produce the following diagnostic + fix-it:

typo.cpp:15:1: error: unknown type name 'tring'; did you mean 'string'?
  tring str2;
  ^~~~~
  string


To make this really useful, we'll need to introduce typo correction in
many more places (wherever we do name lookup), and implement
declaration-vs-expression heuristics that cope with typos
better. However, for now this will handle the simple cases where we
already get good "unknown type name" diagnostics.

The LookupVisibleDecls functions are intended to be used by code
completion as well as typo correction; that refactoring will happen
later.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92308 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-30 17:04:44 +00:00
Douglas Gregor a6e5199336 Fix typo in comment
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92307 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-30 16:01:52 +00:00
Zhongxing Xu b07587dde6 Remove an duplicated #include.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92306 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-30 06:48:20 +00:00
Zhongxing Xu 84eaeffe94 Simplify code by using an equivalent template class.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92305 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-30 06:38:20 +00:00
Chandler Carruth e724246b9f More fixes to the handling of CVR-comparisons on array types. Adds a method to
QualType to get CVR-qualifiers through array types, and switches the primary
comparison methods to use it. This may allow simplifying some of the callers of
getUnqualifiedArrayType.

Also fix the normalizing of CV-qualification during template deduction to
normalize through arrays and allow a more qualified deduced array type. This
fixes PR5911.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92289 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-30 04:10:01 +00:00
Anders Carlsson beb8019429 Add base class checks.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92286 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-30 01:29:05 +00:00
Anders Carlsson 2c0769e3e4 Add more vtable tests.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92285 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-30 01:25:42 +00:00
Anders Carlsson f64531a170 More RTTI cleanup, test that RTTI classes have the correct vtables.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92284 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-30 01:00:12 +00:00
John McCall 5126fd0dd9 Typedefs can be redeclared. That seems like something we should record in
the AST lest we run into some crazy canonicalization bug like PR5874.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92283 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-30 00:31:22 +00:00
Eli Friedman 4df6ec10e0 Test for PR5908.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92282 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-30 00:20:14 +00:00
Eli Friedman 2333f7727f Make sure to explicitly pass type/value dependence to Expr constructor. This
caught several cases where we were not doing the right thing. I'm
not completely sure all cases are being handled correctly, but this should
be an improvement.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92281 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-30 00:13:48 +00:00
Anders Carlsson c8cfd636f6 Match gcc and treat vector types as fundamental types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92278 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-29 22:30:11 +00:00
Anders Carlsson 9c7b6bb952 Handle enum types as well.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92276 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-29 22:13:01 +00:00
Anders Carlsson 978ef68bc4 Test linkage of RTTI descriptors of array types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92274 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-29 21:58:32 +00:00
Anders Carlsson 09b6e6e885 Fix function type RTTI linkage and add tests.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92266 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-29 20:20:19 +00:00
Chandler Carruth 595e290bcb Fix support for const_cast<>s of array types which actual change the
CV-qualifiers. Remove an error expectation from the 'good' set of const-cast
test cases. With this patch, the final non-template test case from PR5542
passes. (It's the same as the one already in const-cast.cpp.)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92257 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-29 08:05:19 +00:00
Chris Lattner 1280708c17 strength reduce this call away.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92253 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-29 07:49:13 +00:00
Chris Lattner b175666363 fix whitespace in test to match llvm asmprinter change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92251 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-29 07:42:23 +00:00
Chandler Carruth 28e318cc60 Correctly refer to element CVR qualifications when determining if a type is
more or less cv-qualified than another during implicit conversion and overload
resolution ([basic.type.qualifier] p5). Factors the logic out of template
deduction and into the ASTContext so it can be shared.

This fixes several aspects of PR5542, but not all of them.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92248 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-29 07:16:59 +00:00
Anders Carlsson f5f7d864f5 Get rid of FixedWidthIntType, as suggested by Chris and Eli.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92246 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-29 07:07:36 +00:00