Commit Graph

379 Commits

Author SHA1 Message Date
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