Chris Lattner
5bcdf24a50
Handle global variable definitions which change the type of a definition, such as:
...
extern int x[];
void foo() { x[0] = 1; }
int x[10];
void bar() { x[0] = 1; }
llvm-svn: 44509
2007-12-02 07:09:19 +00:00
Chris Lattner
f0780fae43
convert the rest of the stderr users in codegen to use diagnostics.
...
llvm-svn: 44503
2007-12-02 01:49:16 +00:00
Chris Lattner
1386de8757
fix a bug handling typedefs in member expr codegen. Patch
...
by Seo Sanghyeon
llvm-svn: 44455
2007-11-30 18:02:19 +00:00
Chris Lattner
b6a7b582ee
Fix a codegen crash on void ?: reported by Oliver
...
llvm-svn: 44454
2007-11-30 17:56:23 +00:00
Chris Lattner
fb30009465
Implement support for -fwritable-strings and make the code generator
...
merge string literals when it is not provided.
llvm-svn: 44394
2007-11-28 05:34:05 +00:00
Chris Lattner
595db86c9d
__real__ and __imag__ can be lvalues. Add support to ast and codegen for them.
...
llvm-svn: 43525
2007-10-30 22:53:42 +00:00
Devang Patel
ffe1e218f2
Fix 80 col violations.
...
llvm-svn: 43516
2007-10-30 20:59:40 +00:00
Devang Patel
ed93c3c3b3
Codegen union member references.
...
llvm-svn: 43390
2007-10-26 19:42:18 +00:00
Devang Patel
7718d7a2eb
Handle non LValue base expressions.
...
llvm-svn: 43387
2007-10-26 18:15:21 +00:00
Devang Patel
d68df20620
Handle
...
foo()->a = 42;
llvm-svn: 43315
2007-10-24 22:26:28 +00:00
Devang Patel
790afb0444
check base type.
...
llvm-svn: 43283
2007-10-24 00:54:17 +00:00
Devang Patel
e531ae687a
Use isUnionType() predicate.
...
llvm-svn: 43281
2007-10-24 00:28:49 +00:00
Devang Patel
c4e224e59c
untabify
...
llvm-svn: 43280
2007-10-24 00:26:24 +00:00
Devang Patel
30efa2eec9
Handle simple struct member expr.
...
llvm-svn: 43258
2007-10-23 20:28:39 +00:00
Chris Lattner
ef6b136781
move IdentifierTable.h from liblex to libbasic.
...
llvm-svn: 42730
2007-10-07 08:58:51 +00:00
Chris Lattner
793d10ca38
fix some warnings, patch by Justin Handville
...
llvm-svn: 42010
2007-09-16 19:23:47 +00:00
Steve Naroff
9def2b15c1
Phase 2 of making the Decl class more lightweight...
...
Move Identifier/Loc instance variables (and associated getters/setters) down from Decl to ScopedDecl/FieldDecl.
Objc AST's can now inherit from Decl without getting instance variables and types that are C specific. For now, I am keeping NextDeclarator, since I believe it may be useful to ObjC. If not, it can be moved later.
llvm-svn: 41934
2007-09-13 21:41:19 +00:00
Chris Lattner
69de3f4af6
When dumping out errors about unsupported stuff, emit loc info.
...
llvm-svn: 41907
2007-09-13 01:17:29 +00:00
Chris Lattner
4647a21825
Generalize RValue to handle complex better, generalize EmitCompoundStmt to
...
support any sort of expr, add a new EmitAnyExpr routine.
llvm-svn: 41660
2007-08-31 22:49:20 +00:00
Chris Lattner
9e47ead594
Implement codegen support for lowering "library builtins" like __builtin_isinf
...
to their corresponding library routines (e.g. isinf). This allows us to handle
all the stuff in macos math.h, and other stuff as it's added to *Builtins.def.
llvm-svn: 41634
2007-08-31 04:44:06 +00:00
Chris Lattner
fb38f274ff
remove some ugly code now that implicit defs are being generated in this case, thanks Steve!
...
llvm-svn: 41560
2007-08-29 06:38:44 +00:00
Chris Lattner
c1045b1a69
remove dead code
...
llvm-svn: 41470
2007-08-26 23:02:57 +00:00
Chris Lattner
6c555f96e8
eliminate EmitAnyExpr, inlining it and simplifying it into its only caller.
...
llvm-svn: 41468
2007-08-26 22:58:05 +00:00
Chris Lattner
a811da5fcd
eliminate use of EmitAnyExpr.
...
llvm-svn: 41467
2007-08-26 22:55:13 +00:00
Chris Lattner
268fcce4f0
remove ConvertScalarValueToBool.
...
llvm-svn: 41447
2007-08-26 16:46:58 +00:00
Chris Lattner
b84bb95b44
be slightly more volatile correct
...
llvm-svn: 41444
2007-08-26 16:22:13 +00:00
Chris Lattner
46c7161311
Omit EmitConversion
...
llvm-svn: 41438
2007-08-26 07:16:41 +00:00
Chris Lattner
798da7033f
implicit casts take care of this code, remove it now.
...
llvm-svn: 41434
2007-08-26 07:06:24 +00:00
Chris Lattner
3474c202ab
refactor scalar conversions out into CGExprScalar.cpp
...
llvm-svn: 41433
2007-08-26 06:48:56 +00:00
Chris Lattner
c7f06ca780
tolerate unimplemented codegen better
...
llvm-svn: 41424
2007-08-26 05:06:40 +00:00
Chris Lattner
3d966d6556
Teach emit-llvm for scalars to properly handle compound assignment
...
operators in all their glory :)
llvm-svn: 41373
2007-08-24 21:00:35 +00:00
Chris Lattner
2da04b3322
completely refactor codegen of scalar expressions out into its own CGExprScalar.cpp file.
...
This patch temporarily breaks compound assignment operators, but greatly simplifies many
things.
llvm-svn: 41355
2007-08-24 05:35:26 +00:00
Chris Lattner
8ad56707ea
stub out complex -> bool conversion.
...
llvm-svn: 41347
2007-08-24 00:01:20 +00:00
Chris Lattner
08b15df766
implement passing of complex and aggregates through call args.
...
llvm-svn: 41344
2007-08-23 23:43:33 +00:00
Anders Carlsson
76f4a902d7
Implement parsing and code generation of Objective-C string literals.
...
llvm-svn: 41238
2007-08-21 17:43:55 +00:00
Chris Lattner
4b0e7873f6
move EmitLoadOfComplex/EmitStoreOfComplex into ComplexExprEmitter.
...
llvm-svn: 41236
2007-08-21 17:28:34 +00:00
Chris Lattner
3cf417b369
implement comma for complex.
...
llvm-svn: 41235
2007-08-21 17:15:50 +00:00
Chris Lattner
64be48fede
and/or/xor are invalid for complex, even integer complex apparently.
...
llvm-svn: 41234
2007-08-21 17:12:50 +00:00
Chris Lattner
bf1bd0dcc7
simplify code slightly
...
llvm-svn: 41233
2007-08-21 17:03:38 +00:00
Chris Lattner
96d7256d62
reimplement support for complex comparisons, add support for integer complex compares.
...
llvm-svn: 41231
2007-08-21 16:57:55 +00:00
Chris Lattner
6ce75dff4d
reimplement complex mul
...
llvm-svn: 41226
2007-08-21 16:34:16 +00:00
Chris Lattner
835635d85a
reimplement addition of complex numbers.
...
llvm-svn: 41215
2007-08-21 04:59:27 +00:00
Chris Lattner
76ba849ed3
Fix array->pointer decay. This unbreaks test/CodeGen/array.c
...
llvm-svn: 41202
2007-08-20 22:37:10 +00:00
Anders Carlsson
1d8e521022
Add support for code generation of builtins.
...
llvm-svn: 41188
2007-08-20 18:05:56 +00:00
Ted Kremenek
c81614d5d1
Modified ArraySubscriptExpr to have accessors getLHS and getRHS in addition
...
to getBase and getIdx. getBase and getIdx now return a "normalized" view
of the expression (e.g., always "A[4]" instead of possibly "4[A]"). getLHS
and getRHS return the expressions with syntactic fidelity to the original
source code.
Also modified client code of ArraySubscriptExpr, including the AST dumper
and pretty printer, the return-stack value checker, and the LLVM code
generator.
llvm-svn: 41180
2007-08-20 16:18:38 +00:00
Chris Lattner
6278e6ac30
start splitting out aggregate value computation from EmitExpr into EmitAggExpr.
...
aggregate value and scalar expression computation are very different, this
gets them away from each other. This causes a temporary regression on some
complex number examples.
llvm-svn: 41014
2007-08-11 00:04:45 +00:00
Chris Lattner
8eab8ff127
fix a codegen bug handling ocuvector element exprs.
...
llvm-svn: 40995
2007-08-10 17:10:08 +00:00
Chris Lattner
90d9120453
implement initial codegen for aggregate return functions. This implements
...
codegen for:
_Complex double bar(int);
void test(_Complex double*);
void test2(int c) {
_Complex double X;
X = bar(1);
test(&X);
}
llvm-svn: 40993
2007-08-10 17:02:28 +00:00
Chris Lattner
02697701d9
Fix a bug handling function -> pointer decay and avoid emitting a noop
...
bitcast.
llvm-svn: 40992
2007-08-10 16:33:59 +00:00
Chris Lattner
87f4836184
now that implicit conversions are explicit, we can eliminate
...
EmitUsualArithmeticConversions.
llvm-svn: 40931
2007-08-08 17:49:18 +00:00