Commit Graph

34974 Commits

Author SHA1 Message Date
Rafael Espindola 6389ef9854 detect invalid combination of sret and byval
llvm-svn: 39971
2007-07-17 13:34:23 +00:00
Gabor Greif bea1390e68 cheap change to fix solaris compilation. I can make this a static inline if desired
llvm-svn: 39970
2007-07-17 11:05:49 +00:00
Gabor Greif 6881ace037 XFAIL these on sparc-solaris
llvm-svn: 39969
2007-07-17 10:25:31 +00:00
Evan Cheng 9ae2eb43d8 Use push / pop for prologues and epilogues.
llvm-svn: 39967
2007-07-17 07:59:08 +00:00
Reid Spencer d6748cf229 Make use of the process_builder_args library function.
llvm-svn: 39965
2007-07-17 07:17:02 +00:00
Reid Spencer 5bc753e26b For PR1558:
Move tests that have C/C++ sources into the appropriate directory. This
allows them to be selected for testing based on whether llvm-gcc is
present or not.

llvm-svn: 39963
2007-07-17 06:20:38 +00:00
Chris Lattner 396156e00b no email addrs in file headers
llvm-svn: 39962
2007-07-17 05:56:43 +00:00
Bill Wendling 89ba70eba6 Use the correct method for getting the ReferenceType from a QualType.
llvm-svn: 39960
2007-07-17 05:09:22 +00:00
Chris Lattner 5b2f6970c1 I forgot to check this in earlier
llvm-svn: 39958
2007-07-17 04:58:06 +00:00
Bill Wendling ee673372ef Return the correct type from isReferenceType().
llvm-svn: 39956
2007-07-17 04:47:36 +00:00
Bill Wendling 354fb2678d Change dyn_cast for reference types to be more like pointers and not need the canonical type. Also fix so that we're not expecting a return value from a void function
llvm-svn: 39954
2007-07-17 04:16:47 +00:00
Bill Wendling dfc810717e Fix references:
According to the spec (C++ 5p6[expr]), we need to adjust "T&" to
    "T" before further analysis. We do this via the "implicit cast"
    thingy.

llvm-svn: 39953
2007-07-17 03:52:31 +00:00
Reid Spencer 5060fd0fa3 Unbreak the build by putting calls to free into the implementation file and
having that implementation file #include <cstdlib>.

llvm-svn: 39952
2007-07-17 02:16:12 +00:00
Evan Cheng 20b76421ed Temporarily set SROA threshold to 512.
llvm-svn: 39950
2007-07-17 01:52:05 +00:00
Steve Naroff dbd9e89334 Convert UsualArithmeticConversions to return "void". Now that we synthesize ImplicitCastExpr's,
there is no compelling need to return the converted type. If both expression type's are arithmetic, then
both types will always be the same. If they aren't (for pointer/int types, say), then the
types will be different. The client is responsible for distinguishing...

llvm-svn: 39947
2007-07-17 00:58:39 +00:00
Owen Anderson 09f86993bd Take advantage of undefined behavior if the source program tries to GEP
beyond the end of an alloca to make FastDSE faster and more aggressive.

llvm-svn: 39945
2007-07-16 23:34:39 +00:00
Reid Spencer 81f1a6c4cb Normally, we don't want to install and we only need to build tools.
llvm-svn: 39944
2007-07-16 23:25:52 +00:00
Steve Naroff 1a2cf6b3b3 Implement semantic analysis for the cast operator.
llvm-svn: 39943
2007-07-16 23:25:18 +00:00
Reid Spencer 19dc0decbe No, we're not looking for a directory named /config.status.
Sigh .. fix copy & paste error.

llvm-svn: 39939
2007-07-16 22:54:42 +00:00
Reid Spencer b7b081d44a In ModuleInfo.txt, make sure that the script being executed can be
found by prepending a .
In build-for-llvm-top.sh, dereference variables for exansion.

llvm-svn: 39936
2007-07-16 22:25:13 +00:00
Steve Naroff 94a5acac9b Remove the 2 QualType references to method UsualArithmeticConversions. Last week, I added these
to quickly fix a regression. Avoiding them entirely is a much cleaner solution. Clients of 
UsualArithmeticConversions should simply call getType() on the expression to get the
converted type. In practice, only a small number of routines care about this.

llvm-svn: 39934
2007-07-16 22:23:01 +00:00
Reid Spencer a71bd75e2f Prepare for the future when llvm doesn't depend on llvm-gcc-4-0.
This also avoids a fork bomb from the llvm-top/build script which
doesn't know how to handle cycles in the dependence graph.

llvm-svn: 39933
2007-07-16 22:11:02 +00:00
Chris Lattner 96d423ef37 In the final step for preserving typedef info better in the AST, upgrade
isPointerType and isVectorType to only look through a single level of typedef
when one is present.  For this invalid code:

typedef float float4 __attribute__((vector_size(16)));
typedef int int4 __attribute__((vector_size(16)));
typedef int4* int4p;
void test(float4 a, int4p result, int i) {
    result[i] = a;
}

we now get:

t.c:5:15: error: incompatible types assigning 'float4' to 'int4'
    result[i] = a;
    ~~~~~~~~~ ^ ~

instead of:

t.c:5:15: error: incompatible types assigning 'float4' to 'int  __attribute__((vector_size(16)))'
    result[i] = a;
    ~~~~~~~~~ ^ ~

The rest of the type predicates should be upgraded to do the same thing.

llvm-svn: 39932
2007-07-16 22:05:22 +00:00
Reid Spencer f54537370a Remove insignificant test no longer needed.
llvm-svn: 39931
2007-07-16 22:03:36 +00:00
Steve Naroff 3109001c19 Change DefaultFunctionArrayConversions and UsualUnaryConversions to return void. The caller
needs to query the expression for the type. Since both these functions guarantee the expression 
contains a valid type, removed old/vacuous asserts (from code calling both of these routines).

llvm-svn: 39930
2007-07-16 21:54:35 +00:00
Owen Anderson 7fcaaadf1c Add support for walking up memory def chains, which enables finding many more
dead stores on 400.perlbench.

llvm-svn: 39929
2007-07-16 21:52:50 +00:00
Chris Lattner daaa9f207c Fix a GCC warning:
SemaExpr.cpp:561: warning: dereferencing type-punned pointer will break strict-aliasing rules

Patch by Benoit Boissinot!

llvm-svn: 39928
2007-07-16 21:39:03 +00:00
Chris Lattner e73e4322d6 Implement break and continue. Patch by Anders Carlsson!
llvm-svn: 39927
2007-07-16 21:28:45 +00:00
Owen Anderson 81990a3fc3 Use realloc() to (potentially) resize the contents of SmallPtrSet in place.
llvm-svn: 39926
2007-07-16 21:27:44 +00:00
Chris Lattner 7d138433e9 avoid requiring people to update from llvm svn.
llvm-svn: 39925
2007-07-16 21:04:56 +00:00
Reid Spencer 3363f4ad96 Return Undef if the block has no dominator. This was required to allow
llvm-gcc build to succeed. Without this change it fails in libstdc++
compilation. This causes no regressions in dejagnu tests. However, 
someone who knows this code better might want to review it.

llvm-svn: 39924
2007-07-16 21:03:44 +00:00
Dan Gohman 72efc04d8e Use ConstantFoldFP for folding all unary floating-point operations which may
have an error, and refector out the code for binary operators into
ConstantFoldBinaryFP and use it for all binary floating-point operations
which may have an error. These functions still rely exclusively on errno
to detect errors though.

llvm-svn: 39923
2007-07-16 15:26:22 +00:00
Dan Gohman 33988db5d5 Fix the documentation for llvm.sqrt so that sqrt(0) has defined behavior,
which appears to be the intent.

llvm-svn: 39922
2007-07-16 14:37:41 +00:00
Dan Gohman 06c60b6032 Fix comments about vectors to use the current wording.
llvm-svn: 39921
2007-07-16 14:29:03 +00:00
Dan Gohman c6e67a6126 Remove the trailing semicolon from function declarations in LLVM,
where it's interpreted as a comment, not part of the syntax.

llvm-svn: 39920
2007-07-16 13:37:30 +00:00
Bill Wendling a5d30d5d83 Fix validation errors
llvm-svn: 39917
2007-07-16 08:52:56 +00:00
Bill Wendling af5b63f6da Clean up some formatting
llvm-svn: 39916
2007-07-16 08:46:40 +00:00
Bill Wendling bcb3b41d99 Clean up some formatting. Add some doc_code div tags.
llvm-svn: 39915
2007-07-16 08:44:39 +00:00
Reid Spencer f8031b9cf2 Prepare for building from llvm-top. Unfortunately, this doesn't work because
of the cyclic depndency between llvm and llvm-gcc-4-0.

llvm-svn: 39910
2007-07-16 08:05:18 +00:00
Reid Spencer 961eddcfa6 Prepare stacker module for the new llvm-top build mechanism.
llvm-svn: 39909
2007-07-16 07:51:40 +00:00
Bill Wendling 457d1343b1 Constify the is*Lvalue() methods.
llvm-svn: 39907
2007-07-16 07:07:56 +00:00
Chris Lattner bb1b44f004 Make octal constant lexing use AdvanceToTokenCharacter to give more
accurate diagnostics.  For test/Lexer/comments.c we now emit:

int x = 000000080;  /* expected-error {{invalid digit}} */
               ^
constants.c:7:4: error: invalid digit '8' in octal constant
00080;             /* expected-error {{invalid digit}} */
   ^


The last line is due to an escaped newline.  The full line looks like:

int y = 0000\
00080;             /* expected-error {{invalid digit}} */


Previously, we emitted:
constants.c:4:9: error: invalid digit '8' in octal constant
int x = 000000080;  /* expected-error {{invalid digit}} */
        ^
constants.c:6:9: error: invalid digit '8' in octal constant
int y = 0000\
        ^

which isn't too bad, but the new way is better for the user,
regardless of whether there is an escaped newline or not.

All the other lexer-related diagnostics should switch over 
to using AdvanceToTokenCharacter where appropriate.  Help
wanted :).

This implements test/Lexer/constants.c.

llvm-svn: 39906
2007-07-16 06:55:01 +00:00
Chris Lattner 8a7003cd9f Add a new Preprocessor::AdvanceToTokenCharacter method which, given a sloc
specifying the start of a token and a logical (phase 3) character number,
returns a sloc representing the input character corresponding to it.

llvm-svn: 39905
2007-07-16 06:48:38 +00:00
Chris Lattner eb5b20ae48 add better comments.
llvm-svn: 39904
2007-07-16 06:46:50 +00:00
Chris Lattner b0f5d55912 factor a common predicate into a static method.
llvm-svn: 39903
2007-07-16 06:16:59 +00:00
Chris Lattner 651f0e9c8f Add a hack (mirroring llvm-gcc) to pointer difference
codegen to compile:

int test(int *A, int *B) {
  return A-B;
}

into:

_test:
        movl 4(%esp), %eax
        subl 8(%esp), %eax
        sarl $2, %eax
        ret

instead of:

_test:
        movl 4(%esp), %eax
        subl 8(%esp), %eax
        movl %eax, %ecx
        sarl $31, %ecx
        shrl $30, %ecx
        addl %ecx, %eax
        sarl $2, %eax
        ret

llvm-svn: 39902
2007-07-16 05:43:05 +00:00
Chris Lattner f57999dcb1 add required directories to the path automatically, so the user doesn't need to worry about it.
llvm-svn: 39901
2007-07-16 04:35:52 +00:00
Chris Lattner 8ecc9f60b2 Make check conflicts with the other default llvm target, 'make check' will come later I guess.
llvm-svn: 39900
2007-07-16 04:30:36 +00:00
Chris Lattner 55d278cef9 'make check' is what more people expect.
llvm-svn: 39899
2007-07-16 04:26:57 +00:00
Chris Lattner 31e39e9cdb Doug Gregor pointed out that _Complex actually isn't C++ at all.
llvm-svn: 39898
2007-07-16 04:22:42 +00:00