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

16564 Коммитов

Автор SHA1 Сообщение Дата
Daniel Dunbar 9119e7e0a4 Trim includes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88982 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16 22:38:48 +00:00
Daniel Dunbar c363cb1929 Store more information in HeaderSearchOptions so that its initialization is not
language dependent.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88981 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16 22:38:40 +00:00
Daniel Dunbar 6143ea28a9 clang-cc: Eliminate cyclic dependency in initializing CodeGenOptions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88980 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16 22:38:14 +00:00
Eli Friedman 6d10ac9ef3 Implement a few more cases for copy constructor synthesis.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88971 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16 21:47:41 +00:00
Douglas Gregor a4923eb7c4 First part of changes to eliminate problems with cv-qualifiers and
sugared types. The basic problem is that our qualifier accessors
(getQualifiers, getCVRQualifiers, isConstQualified, etc.) only look at
the current QualType and not at any qualifiers that come from sugared
types, meaning that we won't see these qualifiers through, e.g.,
typedefs:

  typedef const int CInt;
  typedef CInt Self;

Self.isConstQualified() currently returns false!

Various bugs (e.g., PR5383) have cropped up all over the front end due
to such problems. I'm addressing this problem by splitting each
qualifier accessor into two versions: 

  - the "local" version only returns qualifiers on this particular
    QualType instance
  - the "normal" version that will eventually combine qualifiers from this
    QualType instance with the qualifiers on the canonical type to
    produce the full set of qualifiers.

This commit adds the local versions and switches a few callers from
the "normal" version (e.g., isConstQualified) over to the "local"
version (e.g., isLocalConstQualified) when that is the right thing to
do, e.g., because we're printing or serializing the qualifiers. Also,
switch a bunch of
  
  Context.getCanonicalType(T1).getUnqualifiedType() == Context.getCanonicalType(T2).getQualifiedType()

expressions over to 

  Context.hasSameUnqualifiedType(T1, T2)




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88969 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16 21:35:15 +00:00
Eli Friedman ad35a83102 Clean up scalar cast kind handling; make cast kind handling explicitly handle
more cases.  No intended visible change.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88968 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16 21:33:53 +00:00
Mike Stump 81c2e60a56 Audit done, all the required casts are already done.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88966 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16 21:22:19 +00:00
Devang Patel e705641ba5 revert r88963.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88965 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16 21:17:07 +00:00
Devang Patel 9464ec45f9 Use TrackingVH to hold forward decl. This one is for RecordType.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88963 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16 21:06:35 +00:00
Eli Friedman 14d6365b6d Parallel fix to r88951: use TrackingVH to hold forward decl.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88962 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16 21:04:30 +00:00
Sebastian Redl a439e6f8f5 Repair broken FindCompositePointerType. Correct early termination condition. Get CVR qualifiers from canonical types. Traverse collected qualifiers in reverse order on rebuilding the pointer, so that we don't swap inner and outer qualifiers. That last one fixes PR5509.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88960 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16 21:03:45 +00:00
Eli Friedman 1468ac7112 Fix valgrind uninitialized error.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88952 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16 20:33:31 +00:00
Devang Patel ffffb03de0 Use TrackingVH to hold forward decl.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88951 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16 20:09:38 +00:00
Ted Kremenek d651141308 Fix condition in LocationCheck::classof(). Thanks to Marius Wachtler for pointing this out!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88949 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16 20:06:54 +00:00
Rafael Espindola ab7ae95c46 Use configure options for searching for libstdc++.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88945 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16 19:49:37 +00:00
Mike Stump 912b662aec Fix members to be public.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88944 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16 19:48:50 +00:00
Mike Stump 333dfe94b9 Make bots happy.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88941 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16 19:34:15 +00:00
Eli Friedman 1a3c75f32f Fix PR5488: special-case the overloaded arrow operator so that we don't try to
treat it as a unary operator.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88938 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16 19:13:03 +00:00
David Chisnall 1804463ee7 Fixed two minor differences between clang and GCC-generated runtime structures for the GNU runtime.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88937 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16 19:05:54 +00:00
Fariborz Jahanian 63e963cdff Handle case of missing '@end' in implementation context
gracefully, on par with gcc, by: Issuing a warning,
doing final sematinc check of its definitions and generating
its meta-data.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88934 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16 18:57:01 +00:00
Mike Stump 2a70e94c54 Fix spelling for target triplet.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88928 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16 18:06:39 +00:00
Anders Carlsson fd015353a3 The ssp and sspreq function attributes should only be applied to function definitions, not declarations or calls.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88915 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16 16:56:03 +00:00
Ken Dyck eef22efce8 Parameterize the constant-generating macros in stdint.h with new built-in
__INTn_C_SUFFIX__ macros that are defined for types with corresponding
constant suffixes (i.e. long and long long).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88914 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16 16:36:33 +00:00
Duncan Sands eac73e5b3e Pass a value for the isSigned parameter of CreateIntCast, rather than
passing the name (an exotic way of specifying that the result is signed!).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88909 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16 13:11:21 +00:00
Mike Stump c849c052d6 Implement most of dynamic_cast. WIP.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88901 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16 06:50:58 +00:00
Mike Stump 083e3060b7 Try and fix buildbot issue.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88900 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16 06:49:10 +00:00
Eli Friedman 7eb79c1010 Make GetAddrOfConstantStringFromLiteral return a constant of the correct type.
This doesn't have any visible effects at the moment because normally the
implicit cast code forces the type to the expected type.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88896 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16 05:55:46 +00:00
Eli Friedman eaae78a6fb Some minor cleanup for EmitCastLValue.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88894 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16 05:48:01 +00:00
Eli Friedman 05d9d7aa2d Set the cast kind for a few more code paths.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88893 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16 05:44:20 +00:00
Eli Friedman 8dfa2b3a5b Fix a couple of cases where we weren't generating the right kind of call
for a call to a virtual function.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88891 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16 05:31:29 +00:00
Eli Friedman eaea8c4c23 Implement two-argument form of delete operator.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88890 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16 05:16:40 +00:00
Eli Friedman 5e6214b4c7 Fix test on Linux.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88889 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16 05:14:40 +00:00
Zhongxing Xu 652be346f7 * Do the same thing to the basicstore as in r84163.
* Add a load type to GRExprEngine::EvalLoad().
* When retrieve from 'theValue' of OSAtomic funcitions, use the type of the 
  region instead of the argument expression as the load type.
* Then we can convert CastRetrievedSVal to a pure assertion. In the future
  we can let all Retrieve() methods simply return SVal.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88888 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16 04:49:44 +00:00
Eli Friedman 7f92f0362e Add constant evaluation for comma operator with floating-point operand. Fixes
PR5449.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88885 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16 04:25:37 +00:00
Zhongxing Xu 1eacb725d3 Remove an unused parameter.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88882 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16 02:52:18 +00:00
Chandler Carruth 894993f48a Fix a missing include from r88876.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88879 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-15 23:10:57 +00:00
Anders Carlsson bc0d83b866 When generating the deleting ctor, emit a call to delete.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88878 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-15 23:03:25 +00:00
Anders Carlsson 6d7013940a Make sure that virtual destructors have delete operators.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88877 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-15 22:49:34 +00:00
Anders Carlsson 70f5bc77db Add DeclarationName::dump().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88876 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-15 22:30:43 +00:00
Mike Stump 80556320e7 Peer through refernces for typeid. WIP.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88871 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-15 20:30:39 +00:00
Anders Carlsson 1f126bd18c Deallocation functions must also be static.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88859 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-15 19:08:46 +00:00
Anders Carlsson 67bf2e7706 allocation functions are always static.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88858 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-15 18:59:32 +00:00
Anders Carlsson 78f7455181 Factor finding a deallocation function for a record type out into a separate function.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88857 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-15 18:45:20 +00:00
Mike Stump 333b2a7463 Fix linux buildbots.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88856 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-15 17:57:00 +00:00
Mike Stump f549e898a4 Finish off zero check for typeid(*p) so that it will do a __cxa_bad_typeid.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88852 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-15 16:52:53 +00:00
Anders Carlsson 50724302e2 If we find a deallocation function in the class scope, but it is a placement function we should not look for a deallocation function in the global scope.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88851 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-15 16:43:15 +00:00
Edward O'Callaghan 84423a8c84 Add MIPS support to Triple for Linux and the PSP. Credit to Bruno Cardoso Lopes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88850 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-15 10:22:07 +00:00
Douglas Gregor ab15d0e5af When performing a static downcast as part of a static_cast, make sure
that we're dealing with canonical types like the documentation say
(yay, CanQualType). Alas, this is another instance where using
getQualifiers() on a non-canonical QualType got us in trouble.

Good news: with this fix, Clang can now parse all of its own headers!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88848 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-15 09:20:52 +00:00
Douglas Gregor c07a494b37 Don't gratuitously mark the default constructors of base or member initializers as used
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88847 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-15 08:51:10 +00:00
Douglas Gregor 891fdae811 When adding the underlying declaration of a decl to a lookup-results
set, expand overloaded function declarations. Long-term, this should
actually be done by the name-lookup code rather than here, but this
part of the code (involving using declarations) is getting a makeover
now and the test-case is useful.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88846 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-15 08:11:13 +00:00