Commit Graph

260 Commits

Author SHA1 Message Date
Sebastian Redl 85a4019167 Fix testcase for 64-bit systems.
llvm-svn: 59099
2008-11-12 00:18:32 +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
Chris Lattner bd178d51ff merge some testcases together.
llvm-svn: 59031
2008-11-11 06:42:53 +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
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 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 d678ae2da3 Quick fix for PR2950, infinite loop generating debug info for
recursive types.
 - Style will be clean up in further patches.

llvm-svn: 58490
2008-10-31 04:04:54 +00:00
Daniel Dunbar 03a3844c66 Add attribute always_inline support.
llvm-svn: 58304
2008-10-28 00:17:57 +00:00
Daniel Dunbar 0b288b8a59 Add test case to exercise IRgen "unsupported" path (mostly cleanup).
llvm-svn: 58286
2008-10-27 22:11:01 +00:00
Mon P Wang 179a72f000 Added vec_set intrinsics
llvm-svn: 57749
2008-10-18 02:43:25 +00:00
Daniel Dunbar 380827cfa1 Quick patch for PR2784, assert genereting debug info for opaque
structure.
 - I'm not sure yet about the behavior, but this at least prevents the
   crash.

Add some asserts on RegionStack usage.

llvm-svn: 57661
2008-10-17 01:07:56 +00:00
Chris Lattner 25728d931a fix incorrect rdar number.
llvm-svn: 57165
2008-10-06 07:43:28 +00:00
Chris Lattner 1b0a00a4c9 __CONSTANT_CFSTRINGS__ should be defined even in C mode, otherwise the CFSTR
won't expand to the builtin.  This fixes rdar://6248329

llvm-svn: 57164
2008-10-06 07:43:09 +00:00
Chris Lattner a97132a9c4 Make sema and codegen allow __builtin___CFStringMakeConstantString as a valid
constant lvalue.  Implement this in codegen by moving the code out of CGBuiltin
into EmitConstantExpr.

llvm-svn: 57163
2008-10-06 07:26:43 +00:00
Daniel Dunbar 93bc49d882 Add X86 builtin code generation test case.
llvm-svn: 57104
2008-10-05 06:38:36 +00:00
Daniel Dunbar b11d5d65e8 Add some builtins to codegen test case.
llvm-svn: 57101
2008-10-05 06:34:45 +00:00
Nuno Lopes a459f12862 fix test for latest changes in llvm asm representation
llvm-svn: 56842
2008-09-30 14:37:33 +00:00
Daniel Dunbar 00e36f4c5c Fix function-attributes test case to not rely on llvm-gcc.
llvm-svn: 56734
2008-09-27 00:44:01 +00:00
Daniel Dunbar 23b46ca198 Fix attributes test case to not run clang umpteen times.
llvm-svn: 56733
2008-09-27 00:39:13 +00:00
Daniel Dunbar c6fdac260b Bug fix, result of isIntegerConstantExpr could be of incorrect width
for type.
  - PR2817

llvm-svn: 56482
2008-09-22 23:53:24 +00:00
Argyrios Kyrtzidis 07052350f0 Implement CodeGen support for the 'CXXConditionDeclExpr' expression node, which represents a 'condition' declaration, e.g: "if (int x=0) {...}".
llvm-svn: 56045
2008-09-10 02:36:38 +00:00
Daniel Dunbar 0beedc1684 Fix a number of issues w.r.t. emission of global for functions and
aliases.
 - Attributes specific to a definition are only set when the
   definition is seen.
 - Alias generation is delayed until the end of the module; necessary
   since the alias may reference forward.
 - Fixes: PR2743, <rdr://6140807&6094512>
 - Improves: <rdr://6095112> (added XFAIL)

Also, print module on verification failures.

llvm-svn: 55966
2008-09-08 23:44:31 +00:00
Daniel Dunbar 47be094138 Add missing RUN line
llvm-svn: 55934
2008-09-08 18:01:15 +00:00
Argyrios Kyrtzidis 91c3f526dc Line endings: CRLF -> LF
llvm-svn: 55829
2008-09-05 08:53:53 +00:00
Daniel Dunbar 2ffee610da Set sext/zext on function result.
- <rdar://problem/6156739>

llvm-svn: 55815
2008-09-05 00:57:45 +00:00
Daniel Dunbar 8cde00a510 Implement codegen of aggregates as lvalues in binary expressions,
e.g. "(a = b).somefield".

llvm-svn: 55758
2008-09-04 03:20:13 +00:00
Daniel Dunbar 20e5db77a3 Add two test cases for builtins (mostly related to object size
builtins).

llvm-svn: 55736
2008-09-03 21:17:21 +00:00
Daniel Dunbar 40bf7fe20e In incompatible pointer-typed ?: expressions, add implicit conversion
of RHSs to id type instead of void* if either has Objective-C object
type.
 - This ensures the result can still be used in normal places an
   object can be used, like a message send.

Add implicit conversions for ?: applied to qualified id types to
ensure that the RHSs are compatible. 
 - This prevents a codegen crash (creating invalid PHI nodes).
 - Again, this relates to the fact that qualified id types have no
   canonical types.
 - Note that the implicit type casted to is incorrect, however this
   doesn't currently cause problems because of the flexibility of the
   id type.

Test cases for above.

llvm-svn: 55346
2008-08-26 00:41:39 +00:00
Eli Friedman 3d421e190a Do typechecking and codegen for K&R-style function declarations
correctly.  Not a regression, but made more obvious by my recent fix 
which made function type compatibility checking a bit more strict.

llvm-svn: 55339
2008-08-25 21:31:01 +00:00
Argyrios Kyrtzidis ce4528f008 Add CodeGen support for CXXZeroInitValueExpr.
llvm-svn: 55249
2008-08-23 19:35:47 +00:00
Daniel Dunbar 5f977e7b15 Missed a test case writing a .ll file.
Suppress count output from 'make test' on errors (used to generate
result code).

llvm-svn: 55107
2008-08-21 04:30:23 +00:00
Daniel Dunbar 19d84c3c51 Update a number of CodeGen tests to not create .ll files in the test
directory.
 - Removed .ll from the svn:ignore lists to try and prevent this.
 - Added svn:ignore on test/Misc/Output

llvm-svn: 55104
2008-08-21 02:51:29 +00:00
Daniel Dunbar 94834d8883 Fix subtle bug introduced in r54852.
- UsualUnaryConversions takes an Expr *& and may modify its argument,
   this broke when it was refactored into Sema::CheckCastTypes. This
   meant that we were missing implicit casts in some places.
 - Seems pretty sad that this got through our tests.

llvm-svn: 55039
2008-08-20 03:55:42 +00:00
Daniel Dunbar 5a42754328 Fix test case RUN: line (thanks Argiris)
llvm-svn: 54922
2008-08-18 17:52:17 +00:00
Nuno Lopes cb46c144bc make sure the size of constant arrays is respected
llvm-svn: 54769
2008-08-13 23:28:57 +00:00
Daniel Dunbar c4baa06d15 Add GetAddrOfConstantCString method
- Returns addr of constant for argument + '\0'.
 - I couldn't think of a better name.
 - Move appropriate users of GetAddrOfConstantString to this.

Rename getStringForStringLiteral to GetStringForStringLiteral.

Add GetAddrOfConstantStringFromLiteral
 - This combines GetAddrOfConstantString and
   GetStringForStringLiteral. This method can be, but is not yet, more
   efficient.

Change GetAddrOfConstantString to not add terminating '\0'
 - <rdar://problem/6140956>

llvm-svn: 54768
2008-08-13 23:20:05 +00:00
Daniel Dunbar 2de4b5e2fc Add test case for -fexceptions
llvm-svn: 54647
2008-08-11 18:40:47 +00:00
Daniel Dunbar 07bb087ac1 Fix crash during initialization of a bitfield which followed a zero
length element.

Fix some 80-col violations.

llvm-svn: 54610
2008-08-10 07:00:24 +00:00
Daniel Dunbar 8d81683554 Replace old bitfield test.
- Change hardcoded assembly instructions to a use of 'opt' (still
   waiting for someone to yell at me for this).

 - Add some cases to cover behavior fixed by previous commit.

llvm-svn: 54413
2008-08-06 16:07:39 +00:00
Daniel Dunbar e8bdce441b Fix EmitNullInitializationToLValue for bitfield lvalues.
- PR2643

llvm-svn: 54397
2008-08-06 05:32:55 +00:00
Daniel Dunbar ead7c91240 Fix bitfield accesses which straddle the boundary of the underlying
type.

 - This generates somewhat less optimal code than before but this is
   not hard to rectify once stable (at the cost of slightly more
   complex code).

 - This currently always uses little-endian ordering of the bitfield. 

 - This breaks the CodeGen/bitfield.c test because it was grepping for
   hard-coded assembly instructions. Will fix once a better test case
   is constructed (hard to do without execution).

 - This fixes SingleSource/UnitTests/2006-01-23-InitializedBitField.c
   and Regression/C/PR1386.c from the test suite.

 - <rdar://problem/6085090>, <rdar://problem/6094169>

llvm-svn: 54395
2008-08-06 05:08:45 +00:00
Daniel Dunbar bfb1cd7454 Fix CodeGen of pointer arithmetic in compound assignment statements.
- Changed EmitSub to work on all cases (arithmetic, ptr - int, ptr -
   ptr) so that implementation matches that of other operators.

 - Modify EmitCompoundAssign to compute and perform the appropriate
   casts of left, right, and result types for the assorted pointer
   arithmetic cases.

 - Fix EmitSub (ptr - int) case to negate the rhs *after*
   extension. This is critical when the rhs is unsigned (and needs
   extension).

 - This fixes cfrac.

 - <rdr://6115726>

llvm-svn: 54392
2008-08-06 02:00:38 +00:00
Daniel Dunbar ffc29be83f Implement GNU asm-label extension support in CodeGen. This fixes
scimark2 on Darwin.

 - Added Sema support for asm-label on variables, which I forgot before.

 - Update CodeGen to use GlobalDeclMap to determine if static Decls
   require emission (instead of LLVM module name lookup). Important
   since the Decl name and the LLVM module name can differ.

 - <rdar://problem/6116729>

llvm-svn: 54388
2008-08-06 00:03:29 +00:00
Daniel Dunbar 829e988899 Change CodeGen of global decls to key off of the name (instead of
having multiple bindings from all the possible decls which
  conceptually map to the same global).

 - This eliminates CodeGen depending on the LLVM module for name
   lookup.

 - This also eliminates the need for ReplaceMapValuesWith (hurrah).

 - This handles lookups for FunctionDecls correctly in the presence of
   aliases, this was previously broken.

 - WIP: Can still clean up & unify variable and function emission.

llvm-svn: 54382
2008-08-05 23:31:02 +00:00
Daniel Dunbar eca183bad2 Add test case for PR2001.
llvm-svn: 54352
2008-08-05 16:15:29 +00:00
Daniel Dunbar d548c79eaf Fix const-init test case
- Use -verify and added expected warnings for EXTWARN change.

llvm-svn: 54342
2008-08-05 06:30:41 +00:00
Daniel Dunbar 5aa55d51ca Bug fix, CodeGen of (void*) - (void*) was broken.
- <rdar://problem/6122967>

llvm-svn: 54338
2008-08-05 00:47:03 +00:00
Daniel Dunbar 88402ce8d0 Add CodeGen support for indirect goto.
- Follows emission scheme used by llvm-gcc, i.e. invent an id for
   each label whose address is taken and replace each indirect goto by
   a switch to each possible target.
 - Currently we emit a switch for each indirect goto instead of
   merging them as llvm-gcc does.

llvm-svn: 54318
2008-08-04 16:51:22 +00:00
Daniel Dunbar 74aa7e1eae Support constructor and destructor attributes in CodeGen
- There is an miscompilation issue remaining due to a poor
   interaction between the delayed emission of static functions and
   the emission of constructors, but that already existed prior to
   this change.

llvm-svn: 54258
2008-08-01 00:01:51 +00:00