Lauro Ramos Venancio
f5291d2871
A pointer to an opaque type is an "opaque type definition".
...
llvm-svn: 46575
2008-01-30 21:21:08 +00:00
Nate Begeman
936b207407
Implement first round of feedback on __builtin_overload
...
llvm-svn: 46572
2008-01-30 20:50:20 +00:00
Chris Lattner
05ba4cbe17
fix a problem reported by Eli, caused by not keeping bool as i1
...
when in a register.
llvm-svn: 46552
2008-01-30 07:01:17 +00:00
Chris Lattner
86f5e13224
move some constructors out of line and fix indentation in ObjCAtThrowStmt::getSourceRange.
...
llvm-svn: 46547
2008-01-30 05:01:46 +00:00
Eli Friedman
9d92ce8b3a
Make sure to emit all the arguments to a function call. This fixes the
...
codegen of calls to functions without a prototype and varargs functions,
including printf.
llvm-svn: 46543
2008-01-30 01:32:06 +00:00
Devang Patel
45a65d2ee1
Handle incomplete struct initializer.
...
llvm-svn: 46534
2008-01-29 23:23:18 +00:00
Eli Friedman
7031d734ed
Fix a bug where CodeGen would attempt to erase an instruction that was
...
already used.
llvm-svn: 46519
2008-01-29 18:13:51 +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
Steve Naroff
fda820970a
Add more support for Apple's "private extern" extension...
...
llvm-svn: 46371
2008-01-25 22:14:40 +00:00
Nate Begeman
43eec490fb
Support checking and codegen of constant vector globals
...
llvm-svn: 46343
2008-01-25 05:34:48 +00:00
Fariborz Jahanian
0a71ad2e07
Problem with ObjC's type-encoding of nested structs causing infinit recursion.
...
llvm-svn: 46260
2008-01-22 22:44:46 +00:00
Lauro Ramos Venancio
db449040aa
Fix a typo.
...
llvm-svn: 46259
2008-01-22 22:38:35 +00:00
Lauro Ramos Venancio
09af71c2a6
Implement bitfield write.
...
llvm-svn: 46258
2008-01-22 22:36:45 +00:00
Lauro Ramos Venancio
2ddcb25a3b
Implement bitfield read.
...
llvm-svn: 46257
2008-01-22 20:17:04 +00:00
Lauro Ramos Venancio
0ae6cd5219
Fix two bugs in bitfield codegen.
...
llvm-svn: 46255
2008-01-22 19:15:30 +00:00
Lauro Ramos Venancio
37bae3e8aa
Simplify the bitfield codegen.
...
llvm-svn: 46230
2008-01-21 22:54:57 +00:00
Anders Carlsson
60bfc161a0
Assert that the type of the cast is equal to the _unqualified_ type of the subexpression. Fixes a problem spotted by Nuno Lopes.
...
llvm-svn: 46158
2008-01-18 02:25:57 +00:00
Nate Begeman
1c075a1c9d
Match change in EmitCallExpr
...
llvm-svn: 46136
2008-01-17 18:06:09 +00:00
Nate Begeman
d5b534e16f
Fix for EmitCallExpr changed in OverloadExpr patch
...
llvm-svn: 46135
2008-01-17 18:03:22 +00:00
Nate Begeman
1e36a85f64
Implement basic overload support via a new builtin, __builtin_overload.
...
__builtin_overload takes 2 or more arguments:
0) a non-zero constant-expr for the number of arguments the overloaded
functions will take
1) the arguments to pass to the matching overloaded function
2) a list of functions to match.
The return type of __builtin_overload is inferred from the function whose args
match the types of the arguments passed to the builtin. For example:
float a;
float sinf(float);
int sini(int);
float b = __builtin_overload(1, a, sini, sinf);
Says that we are overloading functions that take one argument, and trying to
pass an argument of the same type as 'a'. sini() does not match since it takes
and argument of type int. sinf does match, so at codegen time this will turn
into float b = sinf(a);
llvm-svn: 46132
2008-01-17 17:46:27 +00:00
Anders Carlsson
1ba25ca171
Add codegen upport for implicit casts to aggregate exprs.
...
llvm-svn: 45954
2008-01-14 06:28:57 +00:00
Chris Lattner
a81a0279cc
Fix the type of predefined identifiers like __func__. Patch by
...
Eli Friedman!
llvm-svn: 45906
2008-01-12 08:14:25 +00:00
Chris Lattner
38376f1595
Add first pieces of support for parsing and representing
...
extern "C" in C++ mode. Patch by Mike Stump!
llvm-svn: 45904
2008-01-12 07:05:38 +00:00
Chris Lattner
41a1ef0dfe
implement proper support for _Bool in memory, which is usually i8, not i1.
...
This fixes a crash reported by Seo Sanghyeon
llvm-svn: 45778
2008-01-09 18:47:25 +00:00
Ted Kremenek
1b0ea82459
Substituted all instances of the string "Objc" for "ObjC". This fixes
...
some naming inconsistencies in the names of classes pertaining to Objective-C
support in clang.
llvm-svn: 45715
2008-01-07 19:49:32 +00:00
Chris Lattner
1800c18ebd
fix long lines.
...
llvm-svn: 45531
2008-01-03 07:05:49 +00:00
Chris Lattner
20455f204f
Fix a crash reported by Seo Sanghyeon.
...
llvm-svn: 45530
2008-01-03 06:36:51 +00:00
Nate Begeman
330aaa79e0
Allow implicit casts during arithmetic for OCUVector operations
...
Add codegen support and test for said casts.
llvm-svn: 45443
2007-12-30 02:59:45 +00:00
Nate Begeman
628028bd27
Allow codegen of vector fdiv
...
llvm-svn: 45440
2007-12-30 01:28:16 +00:00
Chris Lattner
a77acbdcae
implement codegen support for most unary operators when
...
initializing a global. This handles important cases like:
float foo3 = -0.01f;
llvm-svn: 45427
2007-12-29 23:43:37 +00:00
Chris Lattner
5926c0ebfb
remove attribution from makefiles.
...
llvm-svn: 45412
2007-12-29 20:02:25 +00:00
Chris Lattner
5b12ab8c93
Don't attribute in file headers anymore. See llvmdev for the
...
discussion of this change.
llvm-svn: 45410
2007-12-29 19:59:25 +00:00
Christopher Lamb
d91c3d4926
Enable CodeGen for member expressions based on call expressions returning aggregate types. This enables expressions like 'foo().member.submember'.
...
llvm-svn: 45395
2007-12-29 05:02:41 +00:00
Christopher Lamb
fd9af54ad1
Make MemberExpr code safe w.r.t. address spaces.
...
llvm-svn: 45394
2007-12-29 04:06:57 +00:00
Anders Carlsson
c9d41e7d27
No need to do work that the folding builder does for us.
...
llvm-svn: 45361
2007-12-26 18:20:19 +00:00
Seo Sanghyeon
acb00f4a73
Remove broken assert from CodeGen. Better check is done in Sema.
...
llvm-svn: 45358
2007-12-26 05:21:37 +00:00
Seo Sanghyeon
6f1b274976
String literal in aggregate expression
...
llvm-svn: 45330
2007-12-23 03:11:58 +00:00
Devang Patel
505b4f1fd4
Convert opaque type when struct definition is seen.
...
llvm-svn: 45287
2007-12-21 19:35:28 +00:00
Devang Patel
016e41e8a6
Keep track of llvm struct size while adding fields.
...
Update addPaddingFields() interface.
llvm-svn: 45284
2007-12-21 18:43:53 +00:00
Chris Lattner
6c9ffe9529
Implement codegen for ordered comparison builtins.
...
llvm-svn: 45243
2007-12-20 00:44:32 +00:00
Chris Lattner
37bd2ecb11
local static vars are globals also. This fixes a testcase
...
reported by Seo.
llvm-svn: 45156
2007-12-18 08:16:44 +00:00
Anders Carlsson
aa5c91980e
Turns out the LLVMFoldingBuilder can fold InsertElement. Knowing this, we can get rid of our special casing of constants when creating vectors.
...
llvm-svn: 45145
2007-12-18 02:45:33 +00:00
Chris Lattner
b8be97e239
introduce a new CodeGenModule::getIntrinsic method, which wraps
...
Intrinsic::getDeclaration, allowing much more terse code.
llvm-svn: 45136
2007-12-18 00:25:38 +00:00
Fariborz Jahanian
24cb52c9b0
Patch to implemented objective-c's dynamic object pointer qualified with
...
the protocol list (id<P,...> types).
llvm-svn: 45121
2007-12-17 21:03:50 +00:00
Chris Lattner
e6a76da763
Make the insertion point with an explicit new instead of the builder.
...
llvm-svn: 45118
2007-12-17 20:50:59 +00:00
Chris Lattner
28c91c5f35
add a hack so that codegen doesn't abort on missing sema of initializers, now
...
we emit stuff like this:
abort on missing sema of initializers, now
we emit stuff like this:
t3.c:1:24: warning: cannot codegen this initializer yet
const char x[2][4] = { { 'a', 'b', '\0', '\0' }, { 'c', 'd', 'e', '\0' } };
^~~~~~~~~~~~~~~~~~~~~~~~
This should be removed when sema is finished.
llvm-svn: 45086
2007-12-17 05:17:42 +00:00
Christopher Lamb
77560fbde7
Update to use new PointerType::getUnqual() api.
...
llvm-svn: 45081
2007-12-17 01:11:20 +00:00
Anders Carlsson
ca6bcae0be
Start generating SSE intrinsics.
...
llvm-svn: 45079
2007-12-16 22:33:50 +00:00
Anders Carlsson
f5f6544edc
We now support all MMX intrinsics. SSE intrinsics are next.
...
llvm-svn: 45062
2007-12-15 21:23:30 +00:00
Anders Carlsson
4d3094a9bb
Simplify the vector code. Add more shift intrinsics.
...
llvm-svn: 45035
2007-12-14 17:48:24 +00:00
Seo Sanghyeon
d4d8c3c717
Array subscription in aggregate expression
...
llvm-svn: 45023
2007-12-14 02:04:12 +00:00
Seo Sanghyeon
3abb6d8435
Implement dereference operator in aggregate expression
...
llvm-svn: 45020
2007-12-14 01:09:11 +00:00
Chris Lattner
eb13c73c36
minor cleanups
...
llvm-svn: 44996
2007-12-13 07:47:54 +00:00
Chris Lattner
13653d7668
simplify some code.
...
llvm-svn: 44994
2007-12-13 07:34:23 +00:00
Devang Patel
527048247b
Add assert to detect incomplete implementation work.
...
llvm-svn: 44974
2007-12-13 01:24:16 +00:00
Chris Lattner
70efff25be
builtin id 0 is invalid, don't use a slot for it.
...
llvm-svn: 44968
2007-12-13 00:38:03 +00:00
Chris Lattner
b8bd2db8b3
fix off-by-one error.
...
llvm-svn: 44963
2007-12-12 23:46:36 +00:00
Ted Kremenek
1daa3cfbae
TargetInfo no longer includes a reference to SourceManager.
...
Moved all clients of Diagnostics to use FullSourceLoc instead of SourceLocation.
Added many utility methods to FullSourceLoc to provide shorthand for:
FullLoc.getManager().someMethod(FullLoc.getLocation());
instead we have:
FullLoc.someMethod();
Modified TextDiagnostics (and related classes) to use this short-hand.
llvm-svn: 44957
2007-12-12 22:39:36 +00:00
Chris Lattner
c6208a72f7
Fix a codegen crash on test/CodeGen/cast.c, reported by Keith.
...
llvm-svn: 44908
2007-12-12 04:13:20 +00:00
Devang Patel
b37b12d102
Match union field type when member expression is u->x
...
llvm-svn: 44879
2007-12-11 21:33:16 +00:00
Ted Kremenek
d4e5fbacab
Mega-patch: ripped SourceManager out of Diagnostic/DiagnosticClient. Now
...
SourceManager is passed by reference, allowing the SourceManager to be
associated with a specific translation unit, and not the entire execution
of the driver.
Modified all users of Diagnostics to comply with this new interface.
Integrated SourceManager as a member variable of TargetInfo. TargetInfo will
eventually be associated with a single translation unit (just like
SourceManager).
Made the SourceManager reference in ASTContext private. Provided accessor
getSourceManager() for clients to use instead. Modified clients to comply with
new interface.
llvm-svn: 44878
2007-12-11 21:27:55 +00:00
Devang Patel
e3f9fa6322
Refactor bit-field handling code into a separate method.
...
No functionality change.
llvm-svn: 44875
2007-12-11 19:51:39 +00:00
Chris Lattner
63ba2c06c4
fix a build issue with non-apple-gcc-4.0 compilers.
...
llvm-svn: 44844
2007-12-11 04:33:00 +00:00
Anders Carlsson
f1c18350e3
Generate more builtins.
...
llvm-svn: 44841
2007-12-11 03:09:22 +00:00
Anders Carlsson
eee7566205
Generate code for some more intrinsics.
...
llvm-svn: 44839
2007-12-11 02:25:54 +00:00
Chris Lattner
11fbda2b5a
Reimplement support for strings that initialize global inits now that
...
the types are right in sema. Thanks Steve.
llvm-svn: 44834
2007-12-11 01:38:45 +00:00
Devang Patel
7ae82e7305
Separate access field number is not required.
...
llvm-svn: 44833
2007-12-11 01:23:33 +00:00
Devang Patel
113bd8be70
Beautify comment.
...
llvm-svn: 44831
2007-12-11 00:54:19 +00:00
Devang Patel
ab6aadb34a
Add support to share llvm fields for bit-fields.
...
For example, struct { char a; short b:2; };
llvm-svn: 44830
2007-12-11 00:49:18 +00:00
Ted Kremenek
f182e81d85
Added missing inclusion of stdarg.h. Now CGExprScalar.cpp
...
compiles again on Linux.
llvm-svn: 44821
2007-12-10 23:44:32 +00:00
Chris Lattner
433fb26707
add support for implicit cast from array to pointer that is not the element
...
type.
llvm-svn: 44809
2007-12-10 19:50:32 +00:00
Anders Carlsson
b9eb82c3ee
Add EmitShuffleVector helper method.
...
llvm-svn: 44806
2007-12-10 19:35:18 +00:00
Devang Patel
b3ae8d7dc2
Add assert to flag incomplete bit-field support.
...
llvm-svn: 44800
2007-12-10 18:52:06 +00:00
Devang Patel
3c31b54b47
Use getABITypeSizeInBits() instead of getTypeSizeInBits() during struct layout.
...
llvm-svn: 44799
2007-12-10 18:37:40 +00:00
Devang Patel
bb5c0d8960
Use getABITypeSizeInBits() instead of getTypeSizeInBits() during struct layout.
...
llvm-svn: 44798
2007-12-10 18:25:34 +00:00
Chris Lattner
cb04ac9599
abort when we lower an initializer to the wrong type, as we currently do for:
...
char text[] = "string";
llvm-svn: 44752
2007-12-10 00:05:55 +00:00
Chris Lattner
686628e052
extend or truncate the initializer for a string initializer to match its type.
...
llvm-svn: 44751
2007-12-10 00:00:56 +00:00
Chris Lattner
c25c42f3ca
Implement codegen support for:
...
char text[8] = "string";
Big fixme remains.
llvm-svn: 44750
2007-12-09 23:49:42 +00:00
Anders Carlsson
92c4e44da1
Address Chris's comments.
...
llvm-svn: 44749
2007-12-09 23:39:18 +00:00
Anders Carlsson
895af08562
Move target specific builtin IDs to TargetBuiltins.h so that they can be used by CGBuiltin.cpp
...
llvm-svn: 44748
2007-12-09 23:17:02 +00:00
Anders Carlsson
8e1d8cf241
Implement __builtin_ia32_mulps.
...
llvm-svn: 44745
2007-12-09 21:51:19 +00:00
Anders Carlsson
a020c43034
Generate code for target specific intrinsics.
...
llvm-svn: 44744
2007-12-09 21:20:04 +00:00
Chris Lattner
283d094b75
implement support for functions that initialize globals.
...
llvm-svn: 44730
2007-12-09 00:36:01 +00:00
Devang Patel
65a2288eef
More struct bitfields layout work. Now handle,
...
struct STestB1 {char a; char b:2; } stb1;
struct STestB2 {char a; char b:5; char c:4} stb2;
llvm-svn: 44664
2007-12-06 19:16:05 +00:00
Chris Lattner
6eed001371
fix some bogus code noticed by Kevin Andre
...
llvm-svn: 44615
2007-12-05 17:21:34 +00:00
Anders Carlsson
a297e7a888
Implement CodeGen for vectors. Don't create unnecessary conversion instructions if the value to be converted is a constant.
...
llvm-svn: 44606
2007-12-05 07:36:10 +00:00
Anders Carlsson
e8ee04c0bc
Implement codegen for builtin infinity functions.
...
llvm-svn: 44604
2007-12-05 07:22:48 +00:00
Seo Sanghyeon
3d072bea09
Ignore typedefs in pointer arithmetic codegen.
...
llvm-svn: 44529
2007-12-03 06:23:43 +00:00
Anders Carlsson
ef93b9d011
Implement __builtin_bswap32 and __builtin_bswap64.
...
llvm-svn: 44521
2007-12-02 21:58:10 +00:00
Chris Lattner
4e4186b2de
fix logic for member expr codegen.
...
llvm-svn: 44520
2007-12-02 18:52:07 +00:00
Christopher Lamb
0cbd8723f3
Treat discarding array initializer elements as an extwarn (so -pedantic-errors flags it). Allow CodeGen to truncate the initializer if needed.
...
llvm-svn: 44518
2007-12-02 08:49:54 +00:00
Chris Lattner
0475c8178f
globals can't be vla's
...
llvm-svn: 44512
2007-12-02 07:32:25 +00:00
Chris Lattner
d8d18d561e
add codegen support for global inits that require array decay.
...
llvm-svn: 44511
2007-12-02 07:30:13 +00:00
Chris Lattner
d45aa2a03b
warn about unhandled initializers instead of crashing on them.
...
llvm-svn: 44510
2007-12-02 07:19:18 +00:00