Eli Friedman
a243311f1d
Clean up constant implicit cast emission; fixes a few edge cases
...
invlolving implicit casts that cause both a decay to pointer type and a
type conversion.
llvm-svn: 47440
2008-02-21 17:57:49 +00:00
Eli Friedman
115e989985
Fix brace-enclosed string initializers for char arrays. From pr2079,
...
ahtough I had the fix in my tree previously.
llvm-svn: 47439
2008-02-21 17:45:41 +00:00
Chris Lattner
c9b96ae832
strings are arrays too
...
llvm-svn: 46945
2008-02-11 01:35:07 +00:00
Eli Friedman
a5b2023810
Make unsupported constant exprs fail with a warning instead of crashing
...
codegen.
llvm-svn: 46943
2008-02-11 00:23:10 +00:00
Chris Lattner
36fc8790b7
Fix PR1992 by computing the right type for string literals, which
...
is an array type not a pointer type. This requires updating some
diags that change and updating the code generator to handle the
proper form of strings.
llvm-svn: 46941
2008-02-11 00:02:17 +00:00
Anders Carlsson
d3b06cda3c
Add pointer + int (and vice versa) to the constant emitter.
...
llvm-svn: 46812
2008-02-06 07:23:14 +00:00
Anders Carlsson
fcbb11a86f
Add some binops.
...
llvm-svn: 46766
2008-02-05 20:54:21 +00:00
Chris Lattner
86964a9653
Change the key of CGRecordLayouts from being an llvm type* to being a decl*. LLVM
...
Type*'s can change as types are refined, so we can't use them as a stable key in
the map. Decls don't change, so use them instead.
This patch was written by Anders, but he's too shy to commit it himself :)
llvm-svn: 46743
2008-02-05 06:55:31 +00:00
Devang Patel
a703a67384
Cleanup InitListExpr code generation code.
...
Handle padding fields while initializing struct (fix PR 1962)
llvm-svn: 46736
2008-02-05 02:39:50 +00:00
Lauro Ramos Venancio
86b99c1b79
getLLVMFieldNo can't be called before emitting the base value.
...
llvm-svn: 46576
2008-01-30 21:23:20 +00:00
Devang Patel
45a65d2ee1
Handle incomplete struct initializer.
...
llvm-svn: 46534
2008-01-29 23:23:18 +00:00
Anders Carlsson
a8dc3e6b52
Implement __builtin_offsetof.
...
llvm-svn: 46515
2008-01-29 15:56:48 +00:00
Anders Carlsson
ce0740e1f5
Handle binary or in constant expressions.
...
llvm-svn: 46482
2008-01-29 01:33:32 +00:00
Anders Carlsson
0674a7417f
Correctly handle constants that refer to enums.
...
llvm-svn: 46481
2008-01-29 01:28:48 +00:00
Anders Carlsson
6f2a10e8c9
Correctly handle scalars in braces.
...
llvm-svn: 46480
2008-01-29 01:15:48 +00:00
Anders Carlsson
8a88c3815a
Tweaks to EmitLValue in CGExprConstant. Patch by Eli Friedman.
...
llvm-svn: 46389
2008-01-26 04:30:23 +00:00
Anders Carlsson
a413911373
Add CodeGen for AddrOf in constant initializers. Original patch by Eli Friedman.
...
llvm-svn: 46388
2008-01-26 02:08:50 +00:00
Anders Carlsson
610ee7134e
Factor out the constant generation into its own file.
...
llvm-svn: 46386
2008-01-26 01:36:00 +00:00