John McCall
b1be523752
Move things around so that Sema.h no longer depends on even DeclBase.h.
...
It still depends on Type because DeclarationName.h does.
llvm-svn: 112177
2010-08-26 09:15:37 +00:00
John McCall
8e7d656a4a
De-memberify the VarDecl and FunctionDecl StorageClass enums.
...
This lets us remove Sema.h's dependency on Expr.h and Decl.h.
llvm-svn: 112156
2010-08-26 03:08:43 +00:00
John McCall
8302463dc6
Split out a header to hold APIs meant for the Sema implementation from Sema.h.
...
Clients of Sema don't need to know (for example) the list of diagnostics we
support.
llvm-svn: 112093
2010-08-25 22:03:47 +00:00
John McCall
e302792b61
GCC didn't care for my attempt at API compatibility, so brute-force everything
...
to the new constants.
llvm-svn: 112047
2010-08-25 11:45:40 +00:00
John McCall
2536c6da0e
More incremental progress towards not including Expr.h in Sema.h.
...
llvm-svn: 112044
2010-08-25 10:28:54 +00:00
John McCall
28a0cf7825
Remove Sema.h's dependency on DeclCXX.h.
...
llvm-svn: 112032
2010-08-25 07:42:41 +00:00
John McCall
a1e130be25
Remove the DenseSet dependency from Sema.h.
...
llvm-svn: 112030
2010-08-25 07:03:20 +00:00
John McCall
cc14d1fd23
More header elimination. The goal of all this is to allow Parser to
...
#include Sema.h while keeping all the AST declarations opaque. That may
not be reasonably attainable, though.
llvm-svn: 111907
2010-08-24 08:50:51 +00:00
John McCall
bfd822ce64
Remove a header dependency from Sema.h at the cost of some type safety.
...
If someone wants to fix this some other way....
llvm-svn: 111905
2010-08-24 07:32:53 +00:00
John McCall
dadc575b1e
OwningExprResult -> ExprResult. This patch brought to you by
...
M-x query-replace-regexp
\(Sema::\|Action::\|Parser::\|\)Owning\(Expr\|Stmt\)Result -> \2Result
llvm-svn: 111903
2010-08-24 06:29:42 +00:00
John McCall
ba7bf59503
Abstract out passing around types and kill off ActionBase.
...
llvm-svn: 111901
2010-08-24 05:47:05 +00:00
Douglas Gregor
f0f8369912
Diagnose the presence of multiple initializations of static data
...
members, from Faisal Vali! Fixes PR6904.
llvm-svn: 111900
2010-08-24 05:27:49 +00:00
John McCall
b268a282a4
Kill off ExprArg (now just Expr*) and StmtArg (now just Stmt*).
...
llvm-svn: 111863
2010-08-23 23:25:46 +00:00
John McCall
37ad551a25
Sundry incremental steps towards killing off Action.
...
llvm-svn: 111795
2010-08-23 06:44:23 +00:00
Douglas Gregor
ec3a3f5257
Do not elide copy construction when we're performing base-class initialization
...
llvm-svn: 111783
2010-08-22 18:27:02 +00:00
John McCall
4887165193
DeclPtrTy -> Decl *
...
llvm-svn: 111733
2010-08-21 09:40:31 +00:00
Fariborz Jahanian
a50b3a20f1
objective-c ivar refactoring patch. Iterations
...
over ivars for a varienty of puposes is now
consolidated into two small routines; DeepCollectObjCIvars
and ShallowCollectObjCIvars.
llvm-svn: 111679
2010-08-20 21:21:08 +00:00
John McCall
8b0666cf79
Another step in the process of making the parser depend on Sema:
...
- move DeclSpec &c into the Sema library
- move ParseAST into the Parse library
Reflect this change in a thousand different includes.
Reflect this change in the link orders.
llvm-svn: 111667
2010-08-20 18:27:03 +00:00
Douglas Gregor
5be1eb8daf
Revert r111609, which is failing its new test.
...
llvm-svn: 111611
2010-08-20 03:26:10 +00:00
John McCall
a189f2eb0a
Detect efforts to declare a template member friend and explicitly ignore them.
...
Avoids a crash.
llvm-svn: 111609
2010-08-20 01:40:01 +00:00
Douglas Gregor
086cae6c1f
Fix the source range of an anonymous namespace, from Jan Bierbaum
...
llvm-svn: 111561
2010-08-19 20:55:47 +00:00
Alexis Hunt
dcfba7b35b
Generate Attr subclasses with TableGen.
...
Now all classes derived from Attr are generated from TableGen.
Additionally, Attr* is no longer its own linked list; SmallVectors or
Attr* are used. The accompanying LLVM commit contains the updates to
TableGen necessary for this.
Some other notes about newly-generated attribute classes:
- The constructor arguments are a SourceLocation and a Context&,
followed by the attributes arguments in the order that they were
defined in Attr.td
- Every argument in Attr.td has an appropriate accessor named getFoo,
and there are sometimes a few extra ones (such as to get the length
of a variadic argument).
Additionally, specific_attr_iterator has been introduced, which will
iterate over an AttrVec, but only over attributes of a certain type. It
can be accessed through either Decl::specific_attr_begin/end or
the global functions of the same name.
llvm-svn: 111455
2010-08-18 23:23:40 +00:00
Chris Lattner
396639db95
zap dead code.
...
llvm-svn: 111365
2010-08-18 16:09:06 +00:00
John McCall
02db245d5e
Rip out the existing retroactive abstract-class usage checker,
...
which in a fit of zeal wanted to walk the entire translation unit,
and replace it with a new checker that walks the types of declarations
nested within the class. Also, look into templates when doing this.
llvm-svn: 111357
2010-08-18 09:41:07 +00:00
John McCall
3696dcb171
Don't try to initialize a reference with a constructed temporary if either
...
of the classes is invalid. A class is invalid if a base is invalid.
llvm-svn: 111227
2010-08-17 07:23:57 +00:00
Argyrios Kyrtzidis
a3ae3eb690
Fix initialization for members of anonymous struct in a union.
...
llvm-svn: 111159
2010-08-16 17:27:13 +00:00
Douglas Gregor
c3a6ade0bb
Move Sema's headers into include/clang/Sema, renaming a few along the way.
...
llvm-svn: 110945
2010-08-12 20:07:10 +00:00
Abramo Bagnara
8de74e9c81
Added locations and type source info for DeclarationName inside UsingDecl.
...
llvm-svn: 110912
2010-08-12 11:46:03 +00:00
Abramo Bagnara
d6d2f18905
Added locations and type source info for DeclarationName.
...
llvm-svn: 110860
2010-08-11 22:01:17 +00:00
Eli Friedman
aab1fda91f
PR7800: both virtual and non-virtual bases must be marked as used for VTTs.
...
llvm-svn: 110526
2010-08-07 23:11:44 +00:00
John McCall
cf14216509
Store inheritance paths after CastExprs instead of inside them.
...
This takes some trickery since CastExpr has subclasses (and indeed,
is abstract).
Also, smoosh the CastKind into the bitfield from Expr.
Drops two words of storage from Expr in the common case of expressions
which don't need inheritance paths. Avoids a separate allocation and
another word of overhead in cases needing inheritance paths. Also has
the advantage of not leaking memory, since destructors for AST nodes are
never run.
llvm-svn: 110507
2010-08-07 06:22:56 +00:00
Nick Lewycky
60ecc522e0
Remove the DeclaredInCondition bit now that it's no longer used.
...
llvm-svn: 110432
2010-08-06 05:43:55 +00:00
Eli Friedman
570024a8d9
Implement #pragma GCC visibility.
...
llvm-svn: 110315
2010-08-05 06:57:20 +00:00
Sebastian Redl
e0351b970d
Remove a redundant and broken check. Fixes PR7810.
...
llvm-svn: 110294
2010-08-05 00:45:34 +00:00
John McCall
deb646ebb5
Only look up an 'operator delete' on the definition of a destructor, not on
...
a declaration.
llvm-svn: 110175
2010-08-04 01:04:25 +00:00
John McCall
8b0f4ff317
Further adjustments to -Wglobal-constructors; works for references and direct
...
initializations now.
llvm-svn: 110063
2010-08-02 21:13:48 +00:00
Argyrios Kyrtzidis
2d68810caf
Read/write in PCH Sema's StdNamespace and StdBadAlloc and use a LazyDeclPtr for them that will deserialize them when needed.
...
llvm-svn: 110031
2010-08-02 07:14:54 +00:00
Argyrios Kyrtzidis
4f8e17379d
Rename getStdNamespace -> getOrCreateStdNamespace, to better reflect its functionality.
...
No functionality change.
llvm-svn: 110030
2010-08-02 07:14:39 +00:00
John McCall
47e40931c9
Make a first pass at implementing -Wglobal-constructors. I'm worried that this
...
will end up bizarrely mirroring CGExprConstant, but that might be the hazard of
this feature.
llvm-svn: 109984
2010-08-01 20:20:59 +00:00
Abramo Bagnara
ed5b6899ab
Fixed typedef inside extern "C".
...
llvm-svn: 109865
2010-07-30 16:47:02 +00:00
Nick Lewycky
19b9f958e1
Add source location information to C++ base specifiers.
...
llvm-svn: 109396
2010-07-26 16:56:01 +00:00
Douglas Gregor
b412e174db
Remove the vast majority of the Destroy methods from the AST library,
...
since we aren't going to be calling them ever.
llvm-svn: 109377
2010-07-25 18:17:45 +00:00
Eli Friedman
e4686d7acf
Remove dead code.
...
llvm-svn: 109358
2010-07-24 21:35:09 +00:00
Eli Friedman
9255adfb7a
PR7698: Make sure we correctly handle the initialization of an array with
...
dependent size.
llvm-svn: 109356
2010-07-24 21:19:15 +00:00
John McCall
2ca705eb13
Support catching Objective C pointers in C++ under the non-fragile NeXT runtime.
...
Diagnose attempts to do this under the GNU or fragile NeXT runtimes.
llvm-svn: 109298
2010-07-24 00:37:23 +00:00
Sebastian Redl
c57d34bc35
Update ImplicitCastExpr to be able to represent an XValue.
...
llvm-svn: 108807
2010-07-20 04:20:21 +00:00
Douglas Gregor
1d9ef840fa
A using declaration can redeclare a typedef to the same type. These
...
typedefs won't have the same canonical declaration (since they are
distinct), so we need to check for this case specifically. Fixes
<rdar://problem/8018262>.
llvm-svn: 107833
2010-07-07 23:08:52 +00:00
Argyrios Kyrtzidis
36ea322579
Introduce Decl::hasBody() and FunctionDecl::hasBody() and use them instead of getBody() when we are just checking the existence of a body, to avoid de-serialization of the body from PCH.
...
Makes de-serialization of the function body even more "lazier".
llvm-svn: 107768
2010-07-07 11:31:19 +00:00
Douglas Gregor
6191f6c607
Remove my egregious hack that forced deserialization of visible
...
declarations when implicitly declaring the default constructor, copy
constructor, destructor, and copy-assignment operators of a
class. Argiris fixed the underlying problem in r107596.
llvm-svn: 107681
2010-07-06 18:29:01 +00:00
John McCall
1e5d75d73f
Mark the operator delete associated with a virtual destructor as referenced.
...
llvm-svn: 107573
2010-07-03 18:33:00 +00:00