]>
granicus.if.org Git - clang/log
Mike Stump [Tue, 17 Nov 2009 00:14:04 +0000 (00:14 +0000)]
Trim spacing.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89006
91177308 -0d34-0410-b5e6-
96231b3b80d8
Mike Stump [Tue, 17 Nov 2009 00:10:05 +0000 (00:10 +0000)]
Since we always have 2 edges, we don't need to reserve 3 slot for the
PHI node.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89005
91177308 -0d34-0410-b5e6-
96231b3b80d8
Mike Stump [Tue, 17 Nov 2009 00:08:50 +0000 (00:08 +0000)]
Minor CFG refinements for typeid and dynamic_cast.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89004
91177308 -0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Mon, 16 Nov 2009 23:53:01 +0000 (23:53 +0000)]
Fix up EmitMemberInitializer to handle many more cases.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88999
91177308 -0d34-0410-b5e6-
96231b3b80d8
Mike Stump [Mon, 16 Nov 2009 23:36:30 +0000 (23:36 +0000)]
Testcase for dynamic_cast.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88996
91177308 -0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Mon, 16 Nov 2009 23:34:11 +0000 (23:34 +0000)]
Reorganize EmitMemberInitializer to put anonymous unions on the common codepath.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88995
91177308 -0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Mon, 16 Nov 2009 23:07:59 +0000 (23:07 +0000)]
Simplify the AST a bit by skipping creating member initializers for members
with a trivial constructor.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88990
91177308 -0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Mon, 16 Nov 2009 22:58:01 +0000 (22:58 +0000)]
Make member initializers for union members work correctly.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88989
91177308 -0d34-0410-b5e6-
96231b3b80d8
Mike Stump [Mon, 16 Nov 2009 22:52:20 +0000 (22:52 +0000)]
Implement dynamic_cast<void*>(E).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88988
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Mon, 16 Nov 2009 22:38:57 +0000 (22:38 +0000)]
Update test, I don't know why this changed but seems innocuous.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88983
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Mon, 16 Nov 2009 22:38:48 +0000 (22:38 +0000)]
Trim includes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88982
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Mon, 16 Nov 2009 22:38:40 +0000 (22:38 +0000)]
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
Daniel Dunbar [Mon, 16 Nov 2009 22:38:14 +0000 (22:38 +0000)]
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
Eli Friedman [Mon, 16 Nov 2009 21:47:41 +0000 (21:47 +0000)]
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
Douglas Gregor [Mon, 16 Nov 2009 21:35:15 +0000 (21:35 +0000)]
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
Eli Friedman [Mon, 16 Nov 2009 21:33:53 +0000 (21:33 +0000)]
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
Mike Stump [Mon, 16 Nov 2009 21:22:19 +0000 (21:22 +0000)]
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
Devang Patel [Mon, 16 Nov 2009 21:17:07 +0000 (21:17 +0000)]
revert r88963.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88965
91177308 -0d34-0410-b5e6-
96231b3b80d8
Devang Patel [Mon, 16 Nov 2009 21:06:35 +0000 (21:06 +0000)]
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
Eli Friedman [Mon, 16 Nov 2009 21:04:30 +0000 (21:04 +0000)]
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
Sebastian Redl [Mon, 16 Nov 2009 21:03:45 +0000 (21:03 +0000)]
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
Eli Friedman [Mon, 16 Nov 2009 20:33:31 +0000 (20:33 +0000)]
Fix valgrind uninitialized error.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88952
91177308 -0d34-0410-b5e6-
96231b3b80d8
Devang Patel [Mon, 16 Nov 2009 20:09:38 +0000 (20:09 +0000)]
Use TrackingVH to hold forward decl.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88951
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Mon, 16 Nov 2009 20:06:54 +0000 (20:06 +0000)]
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
Rafael Espindola [Mon, 16 Nov 2009 19:49:37 +0000 (19:49 +0000)]
Use configure options for searching for libstdc++.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88945
91177308 -0d34-0410-b5e6-
96231b3b80d8
Mike Stump [Mon, 16 Nov 2009 19:48:50 +0000 (19:48 +0000)]
Fix members to be public.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88944
91177308 -0d34-0410-b5e6-
96231b3b80d8
Mike Stump [Mon, 16 Nov 2009 19:34:15 +0000 (19:34 +0000)]
Make bots happy.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88941
91177308 -0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Mon, 16 Nov 2009 19:13:03 +0000 (19:13 +0000)]
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
David Chisnall [Mon, 16 Nov 2009 19:05:54 +0000 (19:05 +0000)]
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
Fariborz Jahanian [Mon, 16 Nov 2009 18:57:01 +0000 (18:57 +0000)]
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
Mike Stump [Mon, 16 Nov 2009 18:06:39 +0000 (18:06 +0000)]
Fix spelling for target triplet.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88928
91177308 -0d34-0410-b5e6-
96231b3b80d8
Anders Carlsson [Mon, 16 Nov 2009 16:56:03 +0000 (16:56 +0000)]
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
Ken Dyck [Mon, 16 Nov 2009 16:36:33 +0000 (16:36 +0000)]
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
Duncan Sands [Mon, 16 Nov 2009 13:11:21 +0000 (13:11 +0000)]
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
Mike Stump [Mon, 16 Nov 2009 06:50:58 +0000 (06:50 +0000)]
Implement most of dynamic_cast. WIP.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88901
91177308 -0d34-0410-b5e6-
96231b3b80d8
Mike Stump [Mon, 16 Nov 2009 06:49:10 +0000 (06:49 +0000)]
Try and fix buildbot issue.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88900
91177308 -0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Mon, 16 Nov 2009 05:55:46 +0000 (05:55 +0000)]
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
Eli Friedman [Mon, 16 Nov 2009 05:48:01 +0000 (05:48 +0000)]
Some minor cleanup for EmitCastLValue.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88894
91177308 -0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Mon, 16 Nov 2009 05:44:20 +0000 (05:44 +0000)]
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
Eli Friedman [Mon, 16 Nov 2009 05:31:29 +0000 (05:31 +0000)]
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
Eli Friedman [Mon, 16 Nov 2009 05:16:40 +0000 (05:16 +0000)]
Implement two-argument form of delete operator.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88890
91177308 -0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Mon, 16 Nov 2009 05:14:40 +0000 (05:14 +0000)]
Fix test on Linux.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88889
91177308 -0d34-0410-b5e6-
96231b3b80d8
Zhongxing Xu [Mon, 16 Nov 2009 04:49:44 +0000 (04:49 +0000)]
* 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
Eli Friedman [Mon, 16 Nov 2009 04:25:37 +0000 (04:25 +0000)]
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
Zhongxing Xu [Mon, 16 Nov 2009 02:52:18 +0000 (02:52 +0000)]
Remove an unused parameter.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88882
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Sun, 15 Nov 2009 23:10:57 +0000 (23:10 +0000)]
Fix a missing include from r88876.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88879
91177308 -0d34-0410-b5e6-
96231b3b80d8
Anders Carlsson [Sun, 15 Nov 2009 23:03:25 +0000 (23:03 +0000)]
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
Anders Carlsson [Sun, 15 Nov 2009 22:49:34 +0000 (22:49 +0000)]
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
Anders Carlsson [Sun, 15 Nov 2009 22:30:43 +0000 (22:30 +0000)]
Add DeclarationName::dump().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88876
91177308 -0d34-0410-b5e6-
96231b3b80d8
Mike Stump [Sun, 15 Nov 2009 20:30:39 +0000 (20:30 +0000)]
Peer through refernces for typeid. WIP.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88871
91177308 -0d34-0410-b5e6-
96231b3b80d8
Anders Carlsson [Sun, 15 Nov 2009 19:08:46 +0000 (19:08 +0000)]
Deallocation functions must also be static.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88859
91177308 -0d34-0410-b5e6-
96231b3b80d8
Anders Carlsson [Sun, 15 Nov 2009 18:59:32 +0000 (18:59 +0000)]
allocation functions are always static.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88858
91177308 -0d34-0410-b5e6-
96231b3b80d8
Anders Carlsson [Sun, 15 Nov 2009 18:45:20 +0000 (18:45 +0000)]
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
Mike Stump [Sun, 15 Nov 2009 17:57:00 +0000 (17:57 +0000)]
Fix linux buildbots.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88856
91177308 -0d34-0410-b5e6-
96231b3b80d8
Mike Stump [Sun, 15 Nov 2009 16:52:53 +0000 (16:52 +0000)]
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
Anders Carlsson [Sun, 15 Nov 2009 16:43:15 +0000 (16:43 +0000)]
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
Edward O'Callaghan [Sun, 15 Nov 2009 10:22:07 +0000 (10:22 +0000)]
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
Douglas Gregor [Sun, 15 Nov 2009 09:20:52 +0000 (09:20 +0000)]
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
Douglas Gregor [Sun, 15 Nov 2009 08:51:10 +0000 (08:51 +0000)]
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
Douglas Gregor [Sun, 15 Nov 2009 08:11:13 +0000 (08:11 +0000)]
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
Daniel Dunbar [Sun, 15 Nov 2009 08:10:41 +0000 (08:10 +0000)]
Add two new C++ lit tests suites, for testing Clang .cpp files with
-fsyntax-only and with -c.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88845
91177308 -0d34-0410-b5e6-
96231b3b80d8
Mike Stump [Sun, 15 Nov 2009 08:09:41 +0000 (08:09 +0000)]
Implement typeid for class types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88843
91177308 -0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Sun, 15 Nov 2009 07:48:03 +0000 (07:48 +0000)]
When looking for operator() to type-check a call to an object of class
type, use full qualified name lookup rather than the poking the
declaration context directly. This makes sure that we see operator()'s
in superclasses. Also, move the complete-type check before this name
lookup.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88842
91177308 -0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Sun, 15 Nov 2009 07:26:58 +0000 (07:26 +0000)]
Make a couple more headers standalone
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88840
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Sun, 15 Nov 2009 07:23:09 +0000 (07:23 +0000)]
Add Clang-Syntax C++Tests; these don't run by default, use the lit arguments
'--param run_clang_syntax=1' to run them.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88839
91177308 -0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Sun, 15 Nov 2009 07:17:25 +0000 (07:17 +0000)]
Remove an obviously-broken header, which still tries to refer to ScopedDecl.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88837
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Sun, 15 Nov 2009 07:11:12 +0000 (07:11 +0000)]
Use the other excludes syntax.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88836
91177308 -0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Sun, 15 Nov 2009 07:10:50 +0000 (07:10 +0000)]
Make some more headers standalone
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88835
91177308 -0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Sun, 15 Nov 2009 07:07:58 +0000 (07:07 +0000)]
If any errors have occurred by the time we hit the end of a function body, clear out any remaining temporaries so they aren't seen later.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88834
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Sun, 15 Nov 2009 06:48:46 +0000 (06:48 +0000)]
Add TargetOptions and use it when constructing targets.
- This ended up being hard to factor, sorry for the large diff.
- Some post-commit cleanup to come.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88833
91177308 -0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Sun, 15 Nov 2009 06:34:37 +0000 (06:34 +0000)]
Make a few headers parse standalone
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88832
91177308 -0d34-0410-b5e6-
96231b3b80d8
Mike Stump [Sun, 15 Nov 2009 03:28:10 +0000 (03:28 +0000)]
Finish off support for typeinfo generation for classes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88828
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Sun, 15 Nov 2009 00:27:43 +0000 (00:27 +0000)]
Add a trivial example plugin, which prints the names of the top-level decls.
- The build scriptage is about twice as long as the code, which is nice. :)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88826
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Sun, 15 Nov 2009 00:22:33 +0000 (00:22 +0000)]
Add examples dir, built with BUILD_EXAMPLES=1 (Makefiles, no CMake equivalent yet).
Move tools/wpa to examples/wpa, and unbreak its build.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88825
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Sun, 15 Nov 2009 00:12:04 +0000 (00:12 +0000)]
Add pluggable action support to clang-cc, via -plugin command line option.
- Expects the plugin has been loaded with -load.
- Using this may require disabling TOOL_NO_EXPORTS in the clang-cc Makefile, this breaks the llvm::Registry way of working (static constructors are bad, kids). This should be replaced with a "real" plugin model that has explicit plugin interfaces.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88824
91177308 -0d34-0410-b5e6-
96231b3b80d8
Mike Stump [Sat, 14 Nov 2009 23:32:21 +0000 (23:32 +0000)]
Finisgh off rest of class_type_info rtti generation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88823
91177308 -0d34-0410-b5e6-
96231b3b80d8
Anders Carlsson [Sat, 14 Nov 2009 22:35:18 +0000 (22:35 +0000)]
When dumping implicit cast exprs, print out whether the cast is an lvalue cast or not.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88821
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Sat, 14 Nov 2009 22:32:38 +0000 (22:32 +0000)]
Move the program action enum to FrontendOptions.
--
ddunbar@giles:clang-cc (master)$ grep llvm::cl::opt clang-cc.cpp # Woot
ddunbar@giles:clang-cc (master)$
--
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88820
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Sat, 14 Nov 2009 22:04:54 +0000 (22:04 +0000)]
Add clang -mcpu=native support, patch by Roman Divacky, varioustweaks by me.
- We still need support for detecting the target features, since the name
doesn't actually do a good job of decribing what the CPU supports (for LLVM).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88819
91177308 -0d34-0410-b5e6-
96231b3b80d8
Anders Carlsson [Sat, 14 Nov 2009 21:45:58 +0000 (21:45 +0000)]
Add an internal CreateRecordDecl that will create a CXXRecordDecl when compiling C++ and a RecordDecl otherwise.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88816
91177308 -0d34-0410-b5e6-
96231b3b80d8
Anders Carlsson [Sat, 14 Nov 2009 21:26:41 +0000 (21:26 +0000)]
Always build a builtin operator expression for the __extension__ unary operator.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88811
91177308 -0d34-0410-b5e6-
96231b3b80d8
Anders Carlsson [Sat, 14 Nov 2009 21:21:42 +0000 (21:21 +0000)]
Handle CK_BitCast in EmitCastLValue.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88810
91177308 -0d34-0410-b5e6-
96231b3b80d8
Sebastian Redl [Sat, 14 Nov 2009 21:15:49 +0000 (21:15 +0000)]
- Have TryStaticImplicitCast set the cast kind to NoOp when binding a reference. CheckReferenceInit already inserts implicit casts to the necessary types. This fixes an assertion in CodeGen for some casts and brings a fix for PR5453 close, if I understand that bug correctly.
- Also, perform calculated implicit cast sequences if they're determined to work. This finally diagnoses static_cast to ambiguous or implicit bases and fixes two long-standing fixmes in the test case. For the C-style cast, this requires propagating the access check suppression pretty deep into other functions.
- Pass the expressions for TryStaticCast and TryStaticImplicitCast by reference. This should lead to a better AST being emitted for such casts, and also fixes a memory leak, because CheckReferenceInit and PerformImplicitConversion wrap the node passed to them. These wrappers were previously lost.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88809
91177308 -0d34-0410-b5e6-
96231b3b80d8
Anders Carlsson [Sat, 14 Nov 2009 21:08:12 +0000 (21:08 +0000)]
Canonicalize the type before trying to create a debug type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88808
91177308 -0d34-0410-b5e6-
96231b3b80d8
Anders Carlsson [Sat, 14 Nov 2009 20:52:05 +0000 (20:52 +0000)]
Have CGDebugInfo::getOrCreateType cache the QualType instead of having every ConvertType overload do it.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88807
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Sat, 14 Nov 2009 19:25:21 +0000 (19:25 +0000)]
Improve test to make sure -fixit is really working.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88801
91177308 -0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 14 Nov 2009 16:36:57 +0000 (16:36 +0000)]
Move DISABLE_INLINE to the front of the decl so MSVC can parse it. Patch by Amine Khaldi!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88797
91177308 -0d34-0410-b5e6-
96231b3b80d8
Mike Stump [Sat, 14 Nov 2009 15:55:18 +0000 (15:55 +0000)]
Build up more of the rtti info for a class. WIP.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88795
91177308 -0d34-0410-b5e6-
96231b3b80d8
Mike Stump [Sat, 14 Nov 2009 14:25:18 +0000 (14:25 +0000)]
Add the name to the rtti data structure.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88792
91177308 -0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 14 Nov 2009 12:08:24 +0000 (12:08 +0000)]
Change *BugReport constructors to take StringRefs.
- Eliminates many calls to std::string.c_str()
- Fixes an invalid read in ReturnStackAddressChecker due to an unsafe call to
StringRef.data() which doesn't guarantee null-termination.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88779
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Sat, 14 Nov 2009 10:53:49 +0000 (10:53 +0000)]
clang-cc: Switch to using FrontendAction. Whee.
Please report any discrepancies you see in clang-cc, I'm not confident that our regression tests cover all the fun ways one can use clang-cc.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88776
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Sat, 14 Nov 2009 10:42:57 +0000 (10:42 +0000)]
Add FrontendActions for all preprocessor based clang-cc actions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88774
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Sat, 14 Nov 2009 10:42:46 +0000 (10:42 +0000)]
Add FrontendActions, which provides a FrontendAction interface to all the existing AST consumer based clang-cc actions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88773
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Sat, 14 Nov 2009 10:42:35 +0000 (10:42 +0000)]
Add FrontendAction interface, for encapsulating a "clang-cc" style action.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88772
91177308 -0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Sat, 14 Nov 2009 08:51:33 +0000 (08:51 +0000)]
Avoid assert-crash in a case where the expression passed to EmitConstantExpr
legitimately has side-effects (and needs to be generated as a non-constant).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88767
91177308 -0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Sat, 14 Nov 2009 08:37:13 +0000 (08:37 +0000)]
Make __func__ and friends work correctly within the initializer for a static
local variable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88766
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Sat, 14 Nov 2009 07:53:24 +0000 (07:53 +0000)]
Shuffle VerifyDiagnosticsClient API to be less fragile.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88765
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Sat, 14 Nov 2009 07:53:04 +0000 (07:53 +0000)]
Add CompilerInstance::InitializeSourceManager.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88764
91177308 -0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Sat, 14 Nov 2009 04:43:10 +0000 (04:43 +0000)]
PR5462: Don't run off the edge of the argument array for vararg handling
when there are more parameters in the prototype than arguments to the call.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88759
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Sat, 14 Nov 2009 04:39:42 +0000 (04:39 +0000)]
Update FixIt tests to make it more obvious they use a separate mode.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88758
91177308 -0d34-0410-b5e6-
96231b3b80d8