Daniel Dunbar
a461e6d124
Disable some debug prints.
...
llvm-svn: 59174
2008-11-12 21:52:46 +00:00
Douglas Gregor
63eb9386b7
Slightly improve type hash
...
llvm-svn: 59173
2008-11-12 21:52:20 +00:00
Ted Kremenek
7cd62457c4
Add skeleton for PTH lexer.
...
llvm-svn: 59169
2008-11-12 21:37:15 +00:00
Ted Kremenek
3a460b1106
Move pieces of Lexer that the Preprocessor mutates to a new base class 'PreprocessorLexer'. This will also be the base class of the new Preprocessed-Token-Header (PTH) lexer. No functionality change.
...
llvm-svn: 59168
2008-11-12 21:33:59 +00:00
Chris Lattner
6515bcc3c6
Fix a FIXME by improving a diagnostic, add a testcase for PR3048
...
llvm-svn: 59167
2008-11-12 21:25:45 +00:00
Sebastian Redl
15b7160a17
64-bit test fixes.
...
llvm-svn: 59165
2008-11-12 21:19:11 +00:00
Chris Lattner
ffb31a23a5
make TryFixInvalidVariablyModifiedType a static function.
...
llvm-svn: 59163
2008-11-12 21:17:48 +00:00
Ted Kremenek
df31792a66
Shore up transfer function for ObjCForCollectionStmt.
...
llvm-svn: 59162
2008-11-12 21:12:46 +00:00
Ted Kremenek
97450fe0a1
Use Stmt* instead of Expr* for block-level expression.
...
llvm-svn: 59161
2008-11-12 21:12:18 +00:00
Ted Kremenek
6d8b46e71d
ObjCForCollectionStmts are block-level expressions.
...
llvm-svn: 59160
2008-11-12 21:11:49 +00:00
Chris Lattner
b5da7a342c
Restructure code to encourage fallthrough, no functionality change.
...
llvm-svn: 59157
2008-11-12 19:48:13 +00:00
Chris Lattner
e7d1cdb6fd
fix PR3048. I'm going to do some more work before closing it off and
...
adding a testcase.
llvm-svn: 59156
2008-11-12 19:45:49 +00:00
Ted Kremenek
1781080c34
Add (preliminary) transfer function support for ObjCForCollectionStmt. Still need to flesh out some logic.
...
When processing DeclStmt, use the new interface to StateManager::BindDecl. Conjuring of symbols is now done in VisitDeclStmt.
llvm-svn: 59155
2008-11-12 19:24:17 +00:00
Ted Kremenek
9999d72fe2
Conjured symbols now bind to Stmt* instead of Expr*.
...
llvm-svn: 59154
2008-11-12 19:22:47 +00:00
Ted Kremenek
60d46414f4
Update method names involving GRStateRef. No functionality change.
...
llvm-svn: 59153
2008-11-12 19:22:09 +00:00
Ted Kremenek
b94d72a0e3
GRStateRef:
...
- Rename SetSVal to BindLoc
- Add BindDecl
- Add BindExpr
GRState:
- Environment now binds to Stmt* instead of Expr*. This is needed for processing ObjCForCollectionStmt (essentially the declaration of the the 'element' variable can have an SVal attached to it).
- BindDecl no longer accepts Expr* for the initialization value; use SVal* instead.
llvm-svn: 59152
2008-11-12 19:21:30 +00:00
Ted Kremenek
cd639218e4
StoreManager::BindDecl now takes an SVal* for the initialization value instead of an Expr* (which can be null). Lazy symbolication of conjured symbols is now the sole responsibility of GRExprEngine.
...
llvm-svn: 59151
2008-11-12 19:18:35 +00:00
Douglas Gregor
a11693bc37
Implement support for operator overloading using candidate operator
...
functions for built-in operators, e.g., the builtin
bool operator==(int const*, int const*)
can be used for the expression "x1 == x2" given:
struct X {
operator int const*();
} x1, x2;
The scheme for handling these built-in operators is relatively simple:
for each candidate required by the standard, create a special kind of
candidate function for the built-in. If overload resolution picks the
built-in operator, we perform the appropriate conversions on the
arguments and then let the normal built-in operator take care of it.
There may be some optimization opportunity left: if we can reduce the
number of built-in operator overloads we generate, overload resolution
for these cases will go faster. However, one must be careful when
doing this: GCC generates too few operator overloads in our little
test program, and fails to compile it because none of the overloads it
generates match.
Note that we only support operator overload for non-member binary
operators at the moment. The other operators will follow.
As part of this change, ImplicitCastExpr can now be an lvalue.
llvm-svn: 59148
2008-11-12 17:17:38 +00:00
Daniel Dunbar
2889780436
Start a README.txt of possible optimizations to do in IRgen.
...
llvm-svn: 59130
2008-11-12 12:31:28 +00:00
Daniel Dunbar
bf3c22e51d
Handle ?: in EmitBranchOnBoolExpr.
...
llvm-svn: 59129
2008-11-12 10:30:32 +00:00
Daniel Dunbar
d2a53a7b77
Rename ?: operator blocks to cond.true and cond.false (I don't know
...
what "cond.?" means, and this avoids quoting).
llvm-svn: 59128
2008-11-12 10:13:37 +00:00
Daniel Dunbar
682712cda0
Comment/indentation fix.
...
llvm-svn: 59127
2008-11-12 10:12:14 +00:00
Eli Friedman
9a156e5c1e
Some additions to tryEvaluate I've had sitting around for a while.
...
This pushes it a lot closer to being able to deal with most of the stuff
CodeGen's constant expression evaluator knows how to deal with. This
also fixes PR3003.
The test could possibly use some improvement, but this'll work for now.
Test 6 is inspired by PR3003; the other tests are mostly just designed
to exercise the new code. The reason for the funny structure of the
tests is that type fixing for arrays inside of structs is the only place
in Sema that calls tryEvaluate, at least for the moment.
llvm-svn: 59125
2008-11-12 09:44:48 +00:00
Chris Lattner
3fd91f83fd
Lower ?: into select when the selected values are cheap and side-effect-free.
...
This cuts another 200 lines off expr.ll, forming 23 selects.
llvm-svn: 59124
2008-11-12 08:55:54 +00:00
Chris Lattner
35710d18fe
emit better codegen for ||/&&, shrinking expr.ll by another 240 lines.
...
This happens for stuff like this:
x = cond1 || cond2 || cond3 || cond4;
llvm-svn: 59123
2008-11-12 08:38:24 +00:00
Chris Lattner
8b0845822d
use ConstantFoldsToSimpleInteger instead of code emission to do
...
constant folding.
llvm-svn: 59121
2008-11-12 08:26:50 +00:00
Daniel Dunbar
5fc2871820
IRgen improvements on unreachable code:
...
- Split out "simple" statements which can easily handle IR generation
when there is no insert point. These are generally statements which
start by emitting a new block or are only containers for other
statements.
- This fixes a regression in emitting dummy blocks, notably for case
statements.
- This also fixes spurious emission of a number of debug stoppoint
intrinsic instructions.
Remove unneeded sw.body block, just clear the insertion point.
Lift out CodeGenFunction::EmitStopPoint which calls into the
CGDebugInfo class when generating debug info.
Normalize definitions of Emit{Break,Continue}Stmt and usage of
ErrorUnsupported.
llvm-svn: 59118
2008-11-12 08:21:33 +00:00
Chris Lattner
d95377341b
Handle Unary ! in EmitBranchOnBoolExpr, so that we can efficiently
...
codegen stuff like "if (!(X && Y))"
llvm-svn: 59115
2008-11-12 08:13:36 +00:00
Chris Lattner
51e7118c30
Use EmitBranchOnBoolExpr in VisitConditionalOperator. This
...
shrinks code yet again by a bit.
llvm-svn: 59114
2008-11-12 08:08:13 +00:00
Chris Lattner
cd439299b0
Move EmitBranchOnBoolExpr and ConstantFoldsToSimpleInteger to
...
CodeGenFunction.cpp. Change VisitConditionalOperator to use
constant fold instead of codegen'ing a constant conditional.
Change ForStmt to use EmitBranchOnBoolExpr, this shrinks
expr.c very slightly to 40239 lines.
llvm-svn: 59113
2008-11-12 08:04:58 +00:00
Chris Lattner
c51ded9e4a
sort files by name.
...
llvm-svn: 59112
2008-11-12 07:46:52 +00:00
Chris Lattner
b7a9e16486
Make emission of 'if' conditions much more sophisticated when we
...
have a condition that is an &&/||. Before we used to compile things like this:
int test() {
if (x && y) foo(); else bar();
}
into:
%0 = load i32* @x ; <i32> [#uses=1]
%1 = icmp ne i32 %0, 0 ; <i1> [#uses=1]
br i1 %1, label %land_rhs, label %land_cont
land_rhs: ; preds = %entry
%2 = load i32* @y ; <i32> [#uses=1]
%3 = icmp ne i32 %2, 0 ; <i1> [#uses=1]
br label %land_cont
land_cont: ; preds = %land_rhs, %entry
%4 = phi i1 [ false, %entry ], [ %3, %land_rhs ] ; <i1> [#uses=1]
br i1 %4, label %ifthen, label %ifelse
ifthen: ; preds = %land_cont
%call = call i32 (...)* @foo() ; <i32> [#uses=0]
br label %ifend
ifelse: ; preds = %land_cont
%call1 = call i32 (...)* @bar() ; <i32> [#uses=0]
br label %ifend
ifend: ; preds = %ifelse, %ifthen
Now we turn it into the much more svelte code:
%0 = load i32* @x ; <i32> [#uses=1]
%1 = icmp ne i32 %0, 0 ; <i1> [#uses=1]
br i1 %1, label %land_lhs_true, label %ifelse
land_lhs_true: ; preds = %entry
%2 = load i32* @y ; <i32> [#uses=1]
%3 = icmp ne i32 %2, 0 ; <i1> [#uses=1]
br i1 %3, label %ifthen, label %ifelse
ifthen: ; preds = %land_lhs_true
%call = call i32 (...)* @foo() ; <i32> [#uses=0]
br label %ifend
ifelse: ; preds = %land_lhs_true, %entry
%call1 = call i32 (...)* @bar() ; <i32> [#uses=0]
br label %ifend
ifend: ; preds = %ifelse, %ifthen
Note the lack of a phi node.
This shrinks the -O0 .ll file for 176.gcc/expr.c from 43176 to 40267 lines.
llvm-svn: 59111
2008-11-12 07:46:33 +00:00
Chris Lattner
fac05aeae5
fix a crash analyzing constants in 176.gcc/expr.c with my next patch. It was
...
crashing because we errors are ignored in subexpressions that are not evaluated,
but we still evaluate the result of parents. This would cause an assertion
because the erroneous subexpr didn't have its result value set to the right type.
llvm-svn: 59110
2008-11-12 07:43:42 +00:00
Chris Lattner
aa3f951efc
Teach the aggressive constant folder to fold X && 0 -> 0 and X || 1 -> 1
...
llvm-svn: 59105
2008-11-12 07:04:29 +00:00
Chris Lattner
4ad31fcc43
Clean up some code to use isZero instead of calling getZExtValue.
...
llvm-svn: 59103
2008-11-12 04:54:14 +00:00
Sebastian Redl
85a4019167
Fix testcase for 64-bit systems.
...
llvm-svn: 59099
2008-11-12 00:18:32 +00:00
Daniel Dunbar
8307290f35
Use createBasicBlock here too.
...
llvm-svn: 59095
2008-11-12 00:02:07 +00:00
Daniel Dunbar
851eec11a7
Disable generation of basic block names in NDEBUG mode.
...
Revert to enabling generation of instruction names when not in NDEBUG
mode.
llvm-svn: 59094
2008-11-12 00:01:12 +00:00
Daniel Dunbar
5c7e3935f1
Rework IRgen invariant w.r.t. current insert point.
...
- EmitStmt is no longer required to finish with a current insertion
point defined (i.e. it does not need to make dummy
blocks). Instead, it can clear the insertion point in the builder
which indicates that the current insertion point is unreachable.
- CodeGenFunction provides HaveInsertPoint and EnsureInsertPoint
which respectively test if there is an insert point and ensure an
insertion point exists (by making a dummy block).
- Clearly mark functions in CodeGenFunction which can be called with
no insertion point defined. Currently this is a limited set, and
EmitStmt simply EnsureInsertPoint()s before emitting subsequent IR.
Remove EmitDummyBlock, which is no longer needed. Clients who haven't
already cleared the insertion point (typically via EmitBranch) can do
so by hand.
Remove isDummyBlock, which has effectively been renamed to
HaveInsertPoint.
The main thrust of this change is that we no longer have create dummy
blocks just to destroy them a short time later in EmitBlock in the
common case that there is no unreachable code following something like
a goto.
Additionally, this means that we are not using the hokey condition in
isDummyBlock that a block without a name is a dummy block. Guess how
well that works when we never emit block names!
llvm-svn: 59089
2008-11-11 23:11:34 +00:00
Daniel Dunbar
ab197ebb1a
Change EmitBranch to always clear the insert point to clarify irgen
...
invariants.
llvm-svn: 59085
2008-11-11 22:06:59 +00:00
Daniel Dunbar
fab3f936dd
Emit debug region end in unified return block.
...
llvm-svn: 59081
2008-11-11 20:59:54 +00:00
Anton Korobeynikov
fdf389b9e4
Codegen support for fastcall & stdcall CC.
...
Patch by Ilya Okonsky!
llvm-svn: 59080
2008-11-11 20:21:14 +00:00
Ted Kremenek
7a18858bcf
Flow-sensitive uninitialized values analysis:
...
- Added support for ObjCForCollectionStmt
- Fixed bug where expression values would be always set to uninitialized when loops were involved
llvm-svn: 59076
2008-11-11 19:41:42 +00:00
Ted Kremenek
3b4e1d5cc6
Accesses to a collection within a fast enumeration 'for' statement constitute a 'use'.
...
llvm-svn: 59075
2008-11-11 19:40:47 +00:00
Ted Kremenek
1d7f2fcda8
Add fine-grain methods for control which bits are set/reset in ExprDeclBitVector.
...
llvm-svn: 59073
2008-11-11 19:39:47 +00:00
Chris Lattner
d53e23328e
Try to not emit the dead side of ?: if the condition is a constant.
...
llvm-svn: 59061
2008-11-11 18:56:45 +00:00
Chris Lattner
c3b41e31fb
"a patch telling cmake to install clang headers in the target
...
install directory"
Patch by Lukasz Janyst!
llvm-svn: 59059
2008-11-11 18:39:10 +00:00
Sebastian Redl
6f28289aca
Introduce a single AST node SizeOfAlignOfExpr for all sizeof and alignof expressions, both of values and types.
...
llvm-svn: 59057
2008-11-11 17:56:53 +00:00
Ted Kremenek
fbd2f4006b
Add transfer function support for ObjCForCollectionStmt to LiveVariables.
...
llvm-svn: 59053
2008-11-11 17:42:10 +00:00
Ted Kremenek
9d56e64543
Add CFG support for Objective-C 2.0 fast enumeration 'for' statement:
...
http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/Articles/chapter_7_section_2.html#//apple_ref/doc/uid/TP30001163-CH18-SW3
Need to modify GRExprEngine, LiveVariables, and UninitializedValues to understand this construct.
llvm-svn: 59049
2008-11-11 17:10:00 +00:00
Sebastian Redl
c470476420
Implement C++ 'typeid' parsing and sema.
...
llvm-svn: 59042
2008-11-11 11:37:55 +00:00
Daniel Dunbar
c56e67644f
Add CodeGenFunction::EmitBranch.
...
- Emits an unconditional branch, with extra logic to avoid generating
spurious branches out of dummy blocks.
llvm-svn: 59037
2008-11-11 09:41:28 +00:00
Daniel Dunbar
a0821bf8a2
Fix cmake build, patch from Jjgod Jiang.
...
llvm-svn: 59036
2008-11-11 08:29:24 +00:00
Chris Lattner
5b1964b5f9
short circuit && and || when possible. This substantially reduces
...
the size of the -O0 output on some cases. For example, on expr.c from
176.gcc, it shrinks the .ll file from 43164 to 42835 lines, and removed
references to two external symbols.
llvm-svn: 59034
2008-11-11 07:41:27 +00:00
Chris Lattner
aaaa199ad1
Make codegen smart enough to not emit the dead side of an if whose
...
condition is a constant. This shrinks -O0 codegen by quite a bit
on some cases.
llvm-svn: 59033
2008-11-11 07:24:28 +00:00
Chris Lattner
cd2523b41c
implement debug info for typeof()
...
llvm-svn: 59032
2008-11-11 07:01:36 +00:00
Chris Lattner
bd178d51ff
merge some testcases together.
...
llvm-svn: 59031
2008-11-11 06:42:53 +00:00
Daniel Dunbar
a94d873b4b
Move backend output out of destructor.
...
Don't free AST consumer when --disable-free is set.
llvm-svn: 59030
2008-11-11 06:35:39 +00:00
Chris Lattner
4497fbf6e0
remove the wrong PR # from the file name.
...
llvm-svn: 59029
2008-11-11 06:28:10 +00:00
Chris Lattner
d75e4e59b9
add PR#
...
llvm-svn: 59028
2008-11-11 06:27:34 +00:00
Chris Lattner
8c5dd730ce
Fix PR3031 by silencing follow-on errors in invalid declarations.
...
llvm-svn: 59027
2008-11-11 06:13:16 +00:00
Daniel Dunbar
c92892d9cc
Remove unused function declaration.
...
llvm-svn: 59024
2008-11-11 04:48:20 +00:00
Daniel Dunbar
29ac59f25c
Add CodeGenFunction::EmitDummyBlock for marking places where we make
...
"dummy" blocks (blocks just used to make sure we have a place to dump
code to).
llvm-svn: 59022
2008-11-11 04:34:23 +00:00
Daniel Dunbar
05e629aec6
Remove CodeGenFunction::StartBlock.
...
- Was confusing and only used in one small part of the code.
llvm-svn: 59020
2008-11-11 04:12:31 +00:00
Daniel Dunbar
471d9ddeab
These tests have no needed to redirect stderr to stdout.
...
llvm-svn: 59019
2008-11-11 04:09:47 +00:00
Daniel Dunbar
75283ff38a
Centralize basic block creation in CodeGenFunction::createBasicBlock.
...
- No functionality change.
llvm-svn: 59017
2008-11-11 02:29:29 +00:00
Zhongxing Xu
deb7cac332
Fix StringLiteral print bug.
...
llvm-svn: 59015
2008-11-11 01:36:32 +00:00
Zhongxing Xu
f8b84b0def
Add && to test command.
...
llvm-svn: 59014
2008-11-11 01:25:18 +00:00
Daniel Dunbar
e27d7b5530
Fix Release-Asserts warning.
...
llvm-svn: 59013
2008-11-11 01:16:00 +00:00
Douglas Gregor
cd695e500d
Basic support for taking the address of an overloaded function
...
llvm-svn: 59000
2008-11-10 20:40:00 +00:00
Steve Naroff
23394ab63f
Update VC++ project file.
...
llvm-svn: 58996
2008-11-10 20:02:45 +00:00
Douglas Gregor
d36ed56c52
Remove an out-of-date FIXME
...
llvm-svn: 58990
2008-11-10 17:01:38 +00:00
Douglas Gregor
49de5340c0
Improve parser error recovery after a constructor initializer
...
llvm-svn: 58989
2008-11-10 16:59:40 +00:00
Douglas Gregor
f52cdd0124
Allow user-defined conversions during reference binding
...
llvm-svn: 58988
2008-11-10 16:14:15 +00:00
Douglas Gregor
1cd48f1645
Don't create a typedef for the injected-class-name
...
llvm-svn: 58987
2008-11-10 14:41:22 +00:00
Douglas Gregor
6cf0806e75
Some cleanups to the declaration/checking of overloaded operators in C++. Thanks to Sebastian for the review
...
llvm-svn: 58986
2008-11-10 13:38:07 +00:00
Zhongxing Xu
bba5c7c629
Add pretty printing to StringRegion.
...
llvm-svn: 58985
2008-11-10 13:05:26 +00:00
Zhongxing Xu
7be05ed6b8
Add region store model to path-sensitive testing.
...
llvm-svn: 58983
2008-11-10 09:43:12 +00:00
Zhongxing Xu
18d6fd45de
Implement RegionStoreManager::RemoveDeadBindings(). This prunes several false warning caused by removal of symbolic constraints. Currently we just mark all symbols live. Further optimization for dead binding removal needed.
...
llvm-svn: 58982
2008-11-10 09:39:04 +00:00
Chris Lattner
b5d21a4d03
don't preserve names on IR instructions. This matches llvm-gcc's behavior and
...
speeds up the compiler by ~8% at -emit-llvm -O0.
llvm-svn: 58977
2008-11-10 06:31:46 +00:00
Chris Lattner
494e4a6e3e
sort files add a missed header to the project.
...
llvm-svn: 58976
2008-11-10 06:31:19 +00:00
Chris Lattner
f61801403d
Fix even more bugs in debug info support:
...
1. emit proper debug info for forward decls of structs.
2. emit DW_TAG_member nodes around members of a field like llvm-gcc does.
This slows down debug info generation, but is required for correctness.
llvm-svn: 58973
2008-11-10 06:10:01 +00:00
Chris Lattner
affb37337f
reimplement debug info generation in terms of DebugInfo.h instead of
...
using MachineModuleInfo. This runs at about the same speed as the old
code, but fixes a bunch of bugs and is simpler and shorter.
llvm-svn: 58971
2008-11-10 06:08:34 +00:00
Zhongxing Xu
1c31dbe417
Print integer value instead of raw pointer. This is a hack to be fixed by migrating the output in analyzer to llvm::raw_ostream.
...
llvm-svn: 58965
2008-11-10 05:00:06 +00:00
Chris Lattner
231f7bbdbe
silence a warning from gcc.
...
llvm-svn: 58956
2008-11-10 03:00:37 +00:00
Argyrios Kyrtzidis
9e59b577d8
Introduce ScopedDecl::getLexicalDeclContext() which is different from ScopedDecl::getDeclContext() when there are nested-names.
...
e.g.:
namespace A {
void f(); // SemanticDC (getDeclContext) == LexicalDC (getLexicalDeclContext) == 'namespace A'
}
void A::f(); // SemanticDC == namespace 'A'
// LexicalDC == global namespace
llvm-svn: 58948
2008-11-09 23:41:00 +00:00
Argyrios Kyrtzidis
8ad00b26ee
When a tag has nested-name ('struct foo::bar'), use not 'CurContext' but the context of the nested-name ('foo::').
...
llvm-svn: 58945
2008-11-09 22:53:32 +00:00
Argyrios Kyrtzidis
e02eb2bac2
Simplify handling of nested-names in tags ('struct foo::bar').
...
-Use more of the non nested-name code path.
-Also use the ActOnTagStruct code path.
llvm-svn: 58944
2008-11-09 22:09:58 +00:00
Anders Carlsson
3442f82c2f
Support named operands in inline asm statements.
...
llvm-svn: 58940
2008-11-09 18:54:14 +00:00
Sebastian Redl
e0b2b1bf8c
Update C++ status: class support improved due to nested name parsing.
...
llvm-svn: 58932
2008-11-09 11:32:32 +00:00
Argyrios Kyrtzidis
16ac9be7f0
Implement Sema support for C++ nested-name-specifiers.
...
llvm-svn: 58916
2008-11-08 17:17:31 +00:00
Argyrios Kyrtzidis
430a58edd8
Silence a GCC member initialization order warning.
...
llvm-svn: 58914
2008-11-08 16:47:38 +00:00
Argyrios Kyrtzidis
32a0379575
Implement support for C++ nested-name-specifiers ('foo::bar::x') in the Parser side.
...
No Sema functionality change, just the signatures of the Action/Sema methods.
llvm-svn: 58913
2008-11-08 16:45:02 +00:00
Argyrios Kyrtzidis
c7e67a04c3
Introduce annotation tokens, a special kind of token, created and used only by the parser to replace a group of tokens with a single token encoding semantic information.
...
Will be fully utilized later for C++ nested-name-specifiers.
llvm-svn: 58911
2008-11-08 16:17:04 +00:00
Sebastian Redl
f4485de48a
Update C++ status to reflect parser capabilities for chapter 9 (classes). Slightly extend the class parser test.
...
llvm-svn: 58909
2008-11-08 15:40:37 +00:00
Sebastian Redl
2e133e47aa
Update C++ status: dynamic_cast is sema-complete.
...
llvm-svn: 58907
2008-11-08 14:43:13 +00:00
Sebastian Redl
842ef52ff3
Move named cast helpers out of Sema, as Chris requested. This requirse making a few functions public that weren't before.
...
llvm-svn: 58906
2008-11-08 13:00:26 +00:00
Argyrios Kyrtzidis
0d9ee2eb2e
Revert r58880, it breaks test/SemaCXX/constructor.cpp
...
llvm-svn: 58904
2008-11-08 12:02:25 +00:00
Argyrios Kyrtzidis
13042a4a4a
Use only one constructor for CXXMethodDecl. Keep initialization stuff into one place.
...
llvm-svn: 58902
2008-11-08 11:24:06 +00:00
Daniel Dunbar
238475c8ca
Avoid redundant cast<>s / simplify type dispatch.
...
llvm-svn: 58892
2008-11-08 06:12:46 +00:00
Daniel Dunbar
bbc0af7e37
Support getTypeInfo, getTypeAlign, getTypeSize on const Type*s.
...
- Size/align are not effected by CVR qualifiers.
Support getCanonicalType: const Type* -> const Type*.
llvm-svn: 58891
2008-11-08 05:48:37 +00:00
Daniel Dunbar
8ec8048f93
"Fix" PR3021, don't crash on generating record types when we can't
...
generate the type of a member.
llvm-svn: 58889
2008-11-08 04:42:29 +00:00
Daniel Dunbar
ad0a0f9cd2
Silence a gcc warning.
...
llvm-svn: 58888
2008-11-08 04:28:37 +00:00
Zhongxing Xu
3d43015bc7
Add a boilerplate for out-of-bound array checking. This has no real function currently.
...
llvm-svn: 58886
2008-11-08 03:45:42 +00:00
Argyrios Kyrtzidis
19b66a5e32
In a declarator, consider an identifier a constructor only if it is followed by '('.
...
Previously:
class C {
int C; // Declarator::SetConstructor was called here.
};
llvm-svn: 58880
2008-11-08 01:09:16 +00:00
Ted Kremenek
58b1c2d54a
update post-build step
...
llvm-svn: 58878
2008-11-08 01:02:26 +00:00
Sebastian Redl
015085fafa
Greatly improve static_cast diagnostics
...
llvm-svn: 58873
2008-11-07 23:29:29 +00:00
Douglas Gregor
a1f013e8ed
Initial, partially-baked support for implicit user-defined conversions by conversion functions
...
llvm-svn: 58870
2008-11-07 22:36:19 +00:00
Cedric Venet
571c662350
Use css style instead of hard coded color in cxx_status. No visible change.
...
llvm-svn: 58867
2008-11-07 22:24:44 +00:00
Argyrios Kyrtzidis
e442635c37
Changes in preparation for nested-name-specifiers.
...
-When parsing declarators, don't depend on "CurScope->isCXXClassScope() == true" for constructors/destructors
-For C++ member declarations, don't depend on "Declarator.getContext() == Declarator::MemberContext"
llvm-svn: 58866
2008-11-07 22:02:30 +00:00
Ted Kremenek
47a6235491
Updated checker build.
...
llvm-svn: 58864
2008-11-07 20:55:59 +00:00
Douglas Gregor
60e64cfc43
Update C++ status
...
llvm-svn: 58862
2008-11-07 20:16:04 +00:00
Douglas Gregor
dbc5daf058
Parsing, ASTs, and semantic analysis for the declaration of conversion
...
functions in C++, e.g.,
struct X {
operator bool() const;
};
Note that these conversions don't actually do anything, since we don't
yet have the ability to use them for implicit or explicit conversions.
llvm-svn: 58860
2008-11-07 20:08:42 +00:00
Argyrios Kyrtzidis
56fa31bc87
Assert that Parser::MaybeParseOperatorFunctionId is called when token is kw_operator, and replace ExpectAndConsume for the 'operator' token with a ConsumeToken.
...
llvm-svn: 58855
2008-11-07 15:54:02 +00:00
Douglas Gregor
450c75a15f
Separate the parsing of type-specifiers from other declaration specifiers, so that we can parse a C++ type-specifier-seq
...
llvm-svn: 58854
2008-11-07 15:42:26 +00:00
Anders Carlsson
aaa183e944
include alloca.h instead of malloc.h. If this doesn't work for everyone we can just declare alloca directly in the file.
...
llvm-svn: 58853
2008-11-07 15:41:33 +00:00
Argyrios Kyrtzidis
a848ced426
Append the test runs with '&&'.
...
llvm-svn: 58851
2008-11-07 14:28:18 +00:00
Argyrios Kyrtzidis
3175fa5139
Properly deserialize ParamInfo of FunctionDecl.
...
When allocating an array for ParamInfo, the "decl->getNumParams()" call was used, but this will return 0 since it checks ParamInfo (which isn't yet defined and is null).
The result was that ParamInfo got an array of zero length to hold the ParmVarDecls.
llvm-svn: 58850
2008-11-07 14:22:23 +00:00
Argyrios Kyrtzidis
c118934d12
Bring in 'alloca' for the Analysis/stack-addr-ps.c test case.
...
llvm-svn: 58849
2008-11-07 14:00:25 +00:00
Zhongxing Xu
86d6d9b5bf
Add simple get method.
...
llvm-svn: 58848
2008-11-07 13:13:41 +00:00
Zhongxing Xu
f66d0a187f
Join two lines.
...
llvm-svn: 58847
2008-11-07 13:05:39 +00:00
Argyrios Kyrtzidis
6709e7d4cc
Fix crash caused by this:
...
void f() {
int +; // crash here
}
llvm-svn: 58846
2008-11-07 13:01:22 +00:00
Argyrios Kyrtzidis
f2ad9491f5
Shut off an unsigned/signed comparison warning for GCC.
...
llvm-svn: 58842
2008-11-07 12:15:16 +00:00
Zhongxing Xu
2c677c34d5
Finish the implementation of VisitCompoundLiteralExpr. As VisitInitListExpr is
...
available, things get much simplified.
One addition is that CompoundLiteralExpr can appear both in rvalue and lvalue
context.
llvm-svn: 58837
2008-11-07 10:38:33 +00:00
Zhongxing Xu
e79a4e667b
Make the assertion real.
...
llvm-svn: 58833
2008-11-07 08:57:30 +00:00
Ted Kremenek
3391cb00fc
Patch by Nikita Zhuk: Add TranslationUnitActions to AnalysisConsumer.
...
llvm-svn: 58831
2008-11-07 02:09:25 +00:00
Douglas Gregor
7d5fc7e28b
Initial, rudimentary implementation of operator overloading for binary
...
operators. For example, one can now write "x + y" where x or y is a
class or enumeration type, and Clang will perform overload resolution
for "+" based on the overloaded operators it finds.
The other kinds of overloadable operators in C++ will follow this same
approach.
Three major issues remain:
1) We don't find member operators
2) Since we don't have user-defined conversion operators, we can't
call any of the built-in overloaded operators in C++ [over.built].
3) Once we've done the semantic checks, we drop the overloaded
operator on the floor; it doesn't get into the AST at all.
llvm-svn: 58821
2008-11-06 23:29:22 +00:00
Douglas Gregor
11d0c4c098
Parsing, ASTs, and semantic analysis for the declaration of overloaded
...
operators in C++. Overloaded operators can be called directly via
their operator-function-ids, e.g., "operator+(foo, bar)", but we don't
yet implement the semantics of operator overloading to handle, e.g.,
"foo + bar".
llvm-svn: 58817
2008-11-06 22:13:31 +00:00
Douglas Gregor
2ad7ee9145
Reclaim some bits in IdentifierInfo, for later use as overloaded operator names.
...
llvm-svn: 58806
2008-11-06 16:32:23 +00:00
Sebastian Redl
b426f63302
Sema-check virtual declarations. Complete dynamic_cast checking.
...
llvm-svn: 58804
2008-11-06 15:59:35 +00:00
Douglas Gregor
d7fc872d5c
Add the remaining C++0x keywords
...
llvm-svn: 58802
2008-11-06 15:17:27 +00:00
Steve Naroff
7e53df94e3
Update VC++ proj.
...
llvm-svn: 58797
2008-11-06 06:24:22 +00:00
Zhongxing Xu
d952b247d1
Bring back RegionExtent classes.
...
llvm-svn: 58795
2008-11-06 04:55:21 +00:00
Ted Kremenek
efc44cbf1f
Updated checker build.
...
llvm-svn: 58776
2008-11-05 22:47:25 +00:00
Ted Kremenek
eb39732d53
Add a test case for CFMakeCollectable.
...
llvm-svn: 58772
2008-11-05 22:17:39 +00:00
Ted Kremenek
ab4782510b
Fix regression with handling of CFMakeCollectable.
...
llvm-svn: 58771
2008-11-05 22:17:20 +00:00
Sebastian Redl
75c54764fd
Improve assert messages.
...
llvm-svn: 58770
2008-11-05 22:15:14 +00:00
Sebastian Redl
3c5aa4d1a9
Move named cast sema functions to their own file.
...
llvm-svn: 58769
2008-11-05 21:50:06 +00:00
Douglas Gregor
831c93f6c0
Parsing, representation, and preliminary semantic analysis of destructors.
...
Implicit declaration of destructors (when necessary).
Extended Declarator to store information about parsed constructors
and destructors; this will be extended to deal with declarators that
name overloaded operators (e.g., "operator +") and user-defined
conversion operators (e.g., "operator int").
llvm-svn: 58767
2008-11-05 20:51:48 +00:00
Ted Kremenek
b4ebbc5a86
AnalysisManager can now be used to for analyses over TranslationUnits.
...
llvm-svn: 58766
2008-11-05 19:05:06 +00:00
Sebastian Redl
6a43b1c435
A small error message improvement and some comment cleanup for static_cast.
...
llvm-svn: 58762
2008-11-05 17:54:26 +00:00
Ted Kremenek
2855a93f07
initXXX methods can return owned objects
...
llvm-svn: 58758
2008-11-05 16:54:44 +00:00
Douglas Gregor
cfd8ddc6de
Keep track of whether a C++ class is an aggregate. Don't allow initialization of non-aggregates with initializer lists.
...
llvm-svn: 58757
2008-11-05 16:20:31 +00:00
Douglas Gregor
6f5431543a
Implement C++ copy-initialization for declarations. There is now some
...
duplication in the handling of copy-initialization by constructor,
which occurs both for initialization of a declaration and for
overloading. The initialization code is due for some refactoring.
llvm-svn: 58756
2008-11-05 15:29:30 +00:00
Douglas Gregor
e8381c00eb
Initial implementation of parsing, semantic analysis, and AST-building
...
for constructor initializations, e.g.,
class A { };
class B : public A {
int m;
public:
B() : A(), m(17) { };
};
llvm-svn: 58749
2008-11-05 04:29:56 +00:00
Cedric Venet
0ce19ba350
Update CMakeLists.txt
...
llvm-svn: 58716
2008-11-04 20:31:17 +00:00
Daniel Dunbar
40346506f1
Remove stray character.
...
llvm-svn: 58713
2008-11-04 18:44:31 +00:00
Ted Kremenek
2afad46626
Update Xcode project.
...
llvm-svn: 58711
2008-11-04 18:39:58 +00:00
Anders Carlsson
a6b508a28c
Make it an error if an Objective-C declaration is not in the global scope.
...
llvm-svn: 58705
2008-11-04 16:57:32 +00:00
Chris Lattner
b8c18fa59a
LinkageSpecDecl is c++ specific, move it to DeclCXX
...
llvm-svn: 58704
2008-11-04 16:51:42 +00:00