Commit Graph

57775 Commits

Author SHA1 Message Date
Dan Gohman 092b8b6fdb Use X86::SUBREG_8BIT instead of hard-coding the equivalent constant.
llvm-svn: 68951
2009-04-13 15:14:03 +00:00
Dan Gohman c5c2fc45ae Add a comment about MOVSX64rr8.
llvm-svn: 68950
2009-04-13 15:13:28 +00:00
Dan Gohman 04b482227a Add comments to INSERT_SUBREG, EXTRACT_SURBEG, SUBREG_TO_REG,
and IMPLICIT_DEF.

llvm-svn: 68949
2009-04-13 15:12:29 +00:00
Dan Gohman 39aa13a401 Fix another hard-coded constant to use X86AddrNumOperands.
This unbreaks the JIT on x86-64.

llvm-svn: 68948
2009-04-13 15:04:25 +00:00
Rafael Espindola 6d6c6043ea X86-64 TLS support for local exec and initial exec.
llvm-svn: 68947
2009-04-13 13:02:49 +00:00
Sanjiv Gupta 0368bc4703 While passing arg of types larger than char only one byte at lower end was getting passed. We couldn't catch this as we did not have tests that were passing an int value larger than 256.
llvm-svn: 68946
2009-04-13 09:38:38 +00:00
Nick Lewycky e2b8261d87 Fix ocaml bindings; add "available_externally" linkage type.
llvm-svn: 68945
2009-04-13 07:02:32 +00:00
Nick Lewycky 8019af6b2c Fix warning in .ll parser, detect and reject available_externally on function
declarations.

llvm-svn: 68944
2009-04-13 07:02:02 +00:00
Chris Lattner 1050b99f8c the driver caught up. This makes -msse3 correctly set __SSE3__ etc.
llvm-svn: 68943
2009-04-13 06:33:49 +00:00
Chris Lattner 2dba0f0d75 add AvailableExternally linkage to C bindings.
llvm-svn: 68942
2009-04-13 06:25:37 +00:00
Chris Lattner 5c6160d019 fix rdar://6774906, a crash handling implicit conversions between pointers
in different address spaces.

llvm-svn: 68941
2009-04-13 06:04:39 +00:00
Chris Lattner 184f1be4a8 Add a new "available_externally" linkage type. This is intended
to support C99 inline, GNU extern inline, etc.  Related bugzilla's
include PR3517, PR3100, & PR2933.  Nothing uses this yet, but it
appears to work.

llvm-svn: 68940
2009-04-13 05:44:34 +00:00
Chris Lattner 836e77d161 eliminate unneeded parens.
llvm-svn: 68939
2009-04-13 05:38:23 +00:00
Nick Lewycky 11dc7c1a34 Regenerate.
llvm-svn: 68938
2009-04-13 04:26:27 +00:00
Nick Lewycky e54da991d1 Link against libffi if available, fall back to "no external calls from
interpreter mode" when it's not.

llvm-svn: 68937
2009-04-13 04:26:06 +00:00
Devang Patel e8f66b3ed0 Enable debug info generation while optimizing.
llvm-svn: 68936
2009-04-13 04:22:59 +00:00
Chris Lattner 7de6456593 mention the non-standard builtin macros we support.
llvm-svn: 68935
2009-04-13 02:45:46 +00:00
Nick Lewycky 04adcf153d Add paragraph tags.
llvm-svn: 68934
2009-04-13 02:03:40 +00:00
Chris Lattner 0af3ba1748 implement the microsoft/gnu "__COUNTER__" macro: rdar://4329310
llvm-svn: 68933
2009-04-13 01:29:17 +00:00
Chris Lattner 0d6c061401 Improve error recovery for calls, fixing:
PR3972: Poor diagnostic with missing ')'

llvm-svn: 68932
2009-04-13 00:10:38 +00:00
Chris Lattner bc670459ad fix PR3932: [ObjC]Type defined as 'id' is not recognized as a valid object type.
by making ASTContext::isObjCObjectPointerType accept typedefs of id.

llvm-svn: 68931
2009-04-12 23:51:02 +00:00
Chris Lattner 1e2f763c4c rename test
llvm-svn: 68930
2009-04-12 23:49:38 +00:00
Chris Lattner ce8b7d2e24 fix PR3965:SIGINT handler not restored after calling ParseAST(),
patch by Alexei Svitkine!

llvm-svn: 68929
2009-04-12 23:33:13 +00:00
Chris Lattner bdccb0393c add some more coverage.
llvm-svn: 68928
2009-04-12 23:29:27 +00:00
Chris Lattner e1b4174a9a clean up test.
llvm-svn: 68927
2009-04-12 23:27:53 +00:00
Chris Lattner 0177518897 rename test
llvm-svn: 68926
2009-04-12 23:27:31 +00:00
Chris Lattner a2ca03a908 if we already know that a decl is invalid in an @catch, don't verify its type.
llvm-svn: 68925
2009-04-12 23:26:56 +00:00
Rafael Espindola 7186f20a1b In X86DAGToDAGISel::MatchWrapper, if base or index are set, avoid matching
only if symbolic addresses are RIP relatives.

llvm-svn: 68924
2009-04-12 23:00:38 +00:00
Chris Lattner eb4373df60 fix some out of date comments pointed out by Sebastian
llvm-svn: 68923
2009-04-12 22:37:57 +00:00
Owen Anderson deadae28ea Use a hashtable for TargetRegisterClass::contains.
llvm-svn: 68922
2009-04-12 22:31:17 +00:00
Chris Lattner 1d37dcc986 fix a comment typo Sebastian noticed.
llvm-svn: 68921
2009-04-12 22:30:22 +00:00
Chris Lattner 2b988c12fb add support for handling C++'0x unified initializer syntax
to isValidAfterIdentifierInDeclarator, as suggested by Sebastian.

llvm-svn: 68920
2009-04-12 22:29:43 +00:00
Chris Lattner 869c6610c7 Fix some C++ error recovery problems in init declarator parsing
that I noticed working on other things.

Instead of emitting:

t2.cc:1:8: error: use of undeclared identifier 'g'
int x(*g);
       ^
t2.cc:1:10: error: expected ')'
int x(*g);
         ^
t2.cc:1:6: note: to match this '('
int x(*g);
     ^

We now only emit:

t2.cc:1:7: warning: type specifier missing, defaults to 'int'
int x(*g);
      ^


Note that the example in SemaCXX/nested-name-spec.cpp:f4 is still
not great, we now produce both of:

void f4(undef::C); // expected-error {{use of undeclared identifier 'undef'}} \
                      expected-error {{variable has incomplete type 'void'}}

The second diagnostic should be silenced by something getting marked invalid.
I don't plan to fix this though.

llvm-svn: 68919
2009-04-12 22:23:27 +00:00
Chris Lattner 090d34c692 fix another case that assumed that GetTypeForDeclarator would never return null.
llvm-svn: 68918
2009-04-12 22:15:02 +00:00
Chris Lattner 67b0d6afaa mark the declspec as invalid when we recover instead of forcing to int,
this allows downstream diags to be properly silenced.

llvm-svn: 68917
2009-04-12 22:12:26 +00:00
Chris Lattner 38d7919cac fix code that incorrectly assumed that GetTypeForDeclarator cannot
return null.

llvm-svn: 68916
2009-04-12 22:12:06 +00:00
Rafael Espindola 6688b0a5da refactor some code into X86DAGToDAGISel::MatchWrapper
llvm-svn: 68915
2009-04-12 21:55:03 +00:00
Chris Lattner ffaa0e6919 Diagnose invalid uses of tagged types with a missing tag. For example, in:
struct xyz { int y; };
enum abc { ZZZ };

static xyz b;
abc c;

we used to produce:

t2.c:4:8: error: unknown type name 'xyz'
static xyz b;
       ^
t2.c:5:1: error: unknown type name 'abc'
abc c;
^

we now produce:

t2.c:4:8: error: use of tagged type 'xyz' without 'struct' tag
static xyz b;
       ^
       struct
t2.c:5:1: error: use of tagged type 'abc' without 'enum' tag
abc c;
^
enum

GCC produces the normal:
t2.c:4: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘b’
t2.c:5: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘c’

rdar://6783347

llvm-svn: 68914
2009-04-12 21:49:30 +00:00
Chris Lattner 14bdb78430 fix a valgrind problem I noticed while developing another patch,
if a decl is invalid, it isn't added to the Decls array, so we
need to pass in Decls.size() to avoid reading uninit memory.

llvm-svn: 68913
2009-04-12 20:51:10 +00:00
Nick Lewycky 109af6232b Add Kaleidoscope to examples/ so that it gets built regularly and we'll notice
if an API change causes it to be out of date. The code is copied out of
LangImpl7.html.

llvm-svn: 68912
2009-04-12 20:47:23 +00:00
Chris Lattner 6cc055af1d Implement the first set of changes for PR3963 and rdar://6759604,
which tries to do better error recovery when it is "obvious" that an
identifier is a mis-typed typename.  In this case, we try to parse
it as a typename instead of as the identifier in a declarator, which
gives us several options for better error recovery and immediately
makes diagnostics more useful.  For example, we now produce:

t.c:4:8: error: unknown type name 'foo_t'
static foo_t a = 4;
       ^

instead of:

t.c:4:14: error: invalid token after top level declarator
static foo_t a = 4;
             ^

Also, since we now parse "a" correctly, we make a decl for it,
preventing later uses of 'a' from emitting things like:

t.c:12:20: error: use of undeclared identifier 'a'
int bar() { return a + b; }
                   ^

I'd really appreciate any scrutiny possible on this, it 
is a tricky area.

llvm-svn: 68911
2009-04-12 20:42:31 +00:00
Nick Lewycky 4ac15cee54 Fix compile error. Pointed out by mait on #llvm IRC!
llvm-svn: 68910
2009-04-12 20:15:44 +00:00
Chris Lattner cbafe8d75c add a new isNull() method to DeclGroupRef.
llvm-svn: 68909
2009-04-12 20:13:14 +00:00
Chris Lattner 8279ceab12 a few cleanups to StatementCreatesScope: unnest the whole thing,
exit at the first decl found that creates a scope, don't evaluate
decl_end() every iteration.

llvm-svn: 68908
2009-04-12 20:09:42 +00:00
Chris Lattner 423bcb53f7 add a new Decl::hasAttr<T>() predicate.
llvm-svn: 68907
2009-04-12 20:07:59 +00:00
Chris Lattner 6cd82fb430 "There was a typo in my previous patch which leads to miscompilation of
strncat :(

strncat(foo, "bar", 99)
would be optimized to
memcpy(foo+strlen(foo), "bar", 100, 1)
instead of
memcpy(foo+strlen(foo), "bar", 4, 1)"

Patch by Benjamin Kramer!

llvm-svn: 68905
2009-04-12 18:22:33 +00:00
Fariborz Jahanian 8e23171fbc OS dependent code removed.
llvm-svn: 68904
2009-04-12 17:43:53 +00:00
Sebastian Redl d1309a3c4d Add deleted functions and rvalue references to C++ status.
llvm-svn: 68903
2009-04-12 17:41:24 +00:00
Sebastian Redl 42e92c4bc3 Parse deleted member functions. Parsing member declarations goes through a different code path that I forgot previously.
Implement the rvalue reference overload dance for returning local objects. Returning a local object first tries to find a move constructor now.
The error message when no move constructor is defined (or is not applicable) and the copy constructor is deleted is quite ugly, though.

llvm-svn: 68902
2009-04-12 17:16:29 +00:00
Rafael Espindola e4bd8904f7 Add tests for the parts of X86-64 TLS that are already implemented.
llvm-svn: 68901
2009-04-12 10:43:41 +00:00