Commit Graph

424 Commits

Author SHA1 Message Date
Jeff Cohen 5d956e4234 Fix this error:
llvm[2]: Compiling llvmAsmParser.cpp for Debug build
/usr/home/jeffc/llvm/lib/AsmParser/llvmAsmParser.y: In function 'int llvmAsmparse()':
/usr/home/jeffc/llvm/lib/AsmParser/llvmAsmParser.y:1846: error: expected `;' before '}' token

llvm-svn: 33425
2007-01-21 19:19:31 +00:00
Reid Spencer ceb8459f1d Regenerate.
llvm-svn: 33284
2007-01-17 02:48:45 +00:00
Reid Spencer 082a77f1c9 For PR1117:
Make the assembler generate a nice error message if a bad cast instruction
is attempted instead of asserting out. This is made possible by the
recently exposed method CastInst::castIsValid() which checks the validity
of any cast instruction.

llvm-svn: 33283
2007-01-17 02:47:33 +00:00
Chris Lattner 03c4953cdd rename Type::isIntegral to Type::isInteger, eliminating the old Type::isInteger.
rename Type::getIntegralTypeMask to Type::getIntegerTypeMask.

This makes naming much more consistent.  For example, there are now no longer any
instances of IntegerType that are not considered isInteger! :)

llvm-svn: 33225
2007-01-15 02:27:26 +00:00
Chris Lattner c1be5ac420 regenerate
llvm-svn: 33224
2007-01-15 02:12:07 +00:00
Chris Lattner b02536cadf allow i1 to operators like shift and add.
llvm-svn: 33221
2007-01-15 02:00:29 +00:00
Reid Spencer 58a8db0a3f Regenerate.
llvm-svn: 33182
2007-01-13 05:00:46 +00:00
Reid Spencer 502d64e654 Bye bye bool. AsmWriter doesn't generate it any more so AsmParser shouldn't
read it any more. This is consistent with the new IR as well.

llvm-svn: 33181
2007-01-13 05:00:20 +00:00
Anton Korobeynikov 8ea9d3a687 Regenerate
llvm-svn: 33137
2007-01-12 19:22:51 +00:00
Anton Korobeynikov a0554d90e8 * PIC codegen for X86/Linux has been implemented
* PIC-aware internal structures in X86 Codegen have been refactored
* Visibility (default/weak) has been added
* Docs fixes (external weak linkage, visibility, formatting)

llvm-svn: 33136
2007-01-12 19:20:47 +00:00
Chris Lattner 67598a8ccc regenerate
llvm-svn: 33131
2007-01-12 18:33:30 +00:00
Chris Lattner f2a4af8da3 This production is dead, the lexer can never return 'NOT'
llvm-svn: 33130
2007-01-12 18:32:39 +00:00
Reid Spencer b20ef92e42 Regenerate.
llvm-svn: 33117
2007-01-12 07:28:27 +00:00
Reid Spencer 0879a87a0d Integer type names need 1 or more digits, not zero or more.
llvm-svn: 33116
2007-01-12 07:27:59 +00:00
Reid Spencer 7a9c62baa6 For PR1064:
Implement the arbitrary bit-width integer feature. The feature allows
integers of any bitwidth (up to 64) to be defined instead of just 1, 8,
16, 32, and 64 bit integers.

This change does several things:
1. Introduces a new Derived Type, IntegerType, to represent the number of
   bits in an integer. The Type classes SubclassData field is used to
   store the number of bits. This allows 2^23 bits in an integer type.
2. Removes the five integer Type::TypeID values for the 1, 8, 16, 32 and
   64-bit integers. These are replaced with just IntegerType which is not
   a primitive any more.
3. Adjust the rest of LLVM to account for this change.

Note that while this incremental change lays the foundation for arbitrary
bit-width integers, LLVM has not yet been converted to actually deal with
them in any significant way. Most optimization passes, for example, will
still only deal with the byte-width integer types.  Future increments
will rectify this situation.

llvm-svn: 33113
2007-01-12 07:05:14 +00:00
Reid Spencer 542964f55b Rename BoolTy as Int1Ty. Patch by Sheng Zhou.
llvm-svn: 33076
2007-01-11 18:21:29 +00:00
Zhou Sheng 75b871fb1e For PR1043:
Merge ConstantIntegral and ConstantBool into ConstantInt.
Remove ConstantIntegral and ConstantBool from LLVM.

llvm-svn: 33073
2007-01-11 12:24:14 +00:00
Andrew Lenharth e3c5a4cfed Make packed structs use packed initialiers for consistency
llvm-svn: 33015
2007-01-08 18:16:47 +00:00
Reid Spencer 32af9e8cc5 For PR411:
Take an incremental step towards type plane elimination. This change
separates types from values in the symbol tables by finally making use
of the TypeSymbolTable class. This yields more natural interfaces for
dealing with types and unclutters the SymbolTable class.

llvm-svn: 32956
2007-01-06 07:24:44 +00:00
Reid Spencer 3325908643 Regenerate.
llvm-svn: 32934
2007-01-05 21:51:07 +00:00
Reid Spencer 6c435f0fa0 For PR1077:
Disallow merging of dupliate global variables. It is now illegal to declare
or define two global variables of the same name and same type. llvm-gcc3 is
dead in 2.0 and llvm-gcc4 doesn't have that problem nor need the hack.

llvm-svn: 32933
2007-01-05 21:50:38 +00:00
Reid Spencer bf48e3c87d Regenerate.
llvm-svn: 32905
2007-01-05 17:07:23 +00:00
Reid Spencer 136a91c4e7 Change the syntax for parameter attributes:
1. The @ sign is no longer necessary.
2. We now support "function attributes" as parameter attribute 0.
3. Instead of locating the return type attributes after the type of a
   function result, they are now located after the function header's
   closing paranthesis and before any alignment or section options.
4. The way has been prepared for a new "noreturn" function attribute but
   there is no support for recognizing it in the lexer nor doing anything
   with it if it does get set.
5. The FunctionType::getParamAttrsText method now has support for
   returning multiple attributes. This required a change in its interface.

I'm unhappy that this change leads to 6 new shift/reduce conflicts, but
in each case bison's decision to choose the shift is correct so there
shouldn't be any damage from these conflicts.

llvm-svn: 32904
2007-01-05 17:06:19 +00:00
Reid Spencer 494289f70e Regenerate.
llvm-svn: 32862
2007-01-04 02:57:52 +00:00
Reid Spencer 8a1be97a9e Disallow packed types in icmp/fcmp instructions. The code generator is
not prepared to handle them yet.

llvm-svn: 32861
2007-01-04 02:57:22 +00:00
Reid Spencer ca3d1cb840 Regenerate.
llvm-svn: 32853
2007-01-04 00:06:14 +00:00
Reid Spencer 4eda71eec1 Permit icmp and fcmp to have packed operands.
Make an error message a little more useful.

llvm-svn: 32852
2007-01-04 00:05:48 +00:00
Reid Spencer 87622ae03d Regenerate.
llvm-svn: 32825
2007-01-02 21:54:12 +00:00
Reid Spencer 6130ae0000 Implement checking for unresolved types in the argument types and result
type of function definitions.
This fixes test/Regression/Assember/2007-01-02-Undefined-Arg-Type.ll

llvm-svn: 32824
2007-01-02 21:53:43 +00:00
Reid Spencer d0da3e200a Regenerate.
llvm-svn: 32800
2006-12-31 21:47:02 +00:00
Reid Spencer d6979030c1 Remove an extra semi-colon.
llvm-svn: 32799
2006-12-31 21:46:36 +00:00
Reid Spencer 6829c25a3c Add a missing colon. Noticed by Jeff Cohen.
llvm-svn: 32796
2006-12-31 21:25:25 +00:00
Reid Spencer 42f0cbe769 For PR950:
Regenerate

llvm-svn: 32782
2006-12-31 05:40:51 +00:00
Reid Spencer fa35bb3e20 For PR950:
Major reorganization. This patch introduces the signedness changes for
the new integer types (i8, i16, i32, i64) which replace the old signed
versions (ubyte, sbyte, ushort, short, etc). This patch also implements
the function type parameter attributes feature. Together these conspired
to introduce new reduce/reduce errors into the grammar. Consequently, it
was necessary to introduce a new keyword into the grammar in order to
disambiguate. Without this, yacc would make incorrect shift/reduce and
reduce/reduce decisions and fail to parse the intended assembly.

Changes in assembly:

1. The "implementation" keyword is superfluous but still supported. You
   can use it as a sentry which will ensure there are no remaining up
   reference types. However, this is optional as those checks are also
   performed elsewhere.

2. Parameter attributes are now implemented using an at sign to
   indicate the attribute. The attributes are placed after the type
   in a function declaration or after the argument value in a function
   call. For example:
      i8 @sext %myfunc(i16 @zext)
      call i8 @sext %myfunc(i16 @zext %someVal)
   The facility is available for supporting additional attributes and
   they can be combined using the @(attr1,attr2,attr3) syntax. Right
   now  the only two supported are @sext and @zext

3. Functions must now be defined with the "define" keyword which is
   analagous to the "declare" keyword for function declarations. The
   introduction of this keyword disambiguates situations where a
   named result type is confused with a new type or gvar definition.
   For example:
      %MyType = type i16
      %MyType %func(%MyType) { ... }
   With the introduction of optional parameter attributes between
   the function name and the function result type, yacc will pick
   the wrong rule to reduce unless it is disambiguated with "define"
   before the function definition, as in:
      define %MyType @zext %func(%MyType %someArg) { ... }

llvm-svn: 32781
2006-12-31 05:40:12 +00:00
Reid Spencer dc0a3a2fd2 Regenerate.
llvm-svn: 32772
2006-12-29 20:35:03 +00:00
Reid Spencer 7ce2d2a8fe For PR950:
Remove all grammar conflicts from assembly parsing.  This change involves:
1. Making the "type" keyword not a primitive type (removes several
   reduce/reduce conflicts)
2. Being more specific about which linkage types are allowed for functions
   and global variables. In particular "appending" can no longer be
   specified for a function. A differentiation was made between the various
   internal and external linkage types.
3. Introduced the "define" keyword which is now required when defining a
   function. This disambiguates several cases where a named function return
   type could get confused with the definition of a new type. Using the
   keyword eliminates all shift/reduce conflicts and the remaining
   reduce/reduce conflicts.

These changes are necessary to implement the function parameter attributes
that will be introduced soon. Adding the function parameter attributes in
the presence of the shift/reduce and reduce/reduce conflicts led to severe
ambiguities that caused the parser to report syntax errors that needed to
be resolved. This patch resolves them.

llvm-svn: 32770
2006-12-29 20:29:48 +00:00
Reid Spencer 266e42b312 For PR950:
This patch removes the SetCC instructions and replaces them with the ICmp
and FCmp instructions. The SetCondInst instruction has been removed and
been replaced with ICmpInst and FCmpInst.

llvm-svn: 32751
2006-12-23 06:05:41 +00:00
Reid Spencer 3f46fbaa00 Allow negative constants for unsigned integers and unsigned constants
greater than MAX_INT64 for signed integers. This is now valid and is just
waiting for the distinction between signed and unsigned to go away.

llvm-svn: 32716
2006-12-20 17:20:09 +00:00
Andrew Lenharth 2d189ff8cd Hopefully these are the regenerated files
llvm-svn: 32362
2006-12-08 18:07:09 +00:00
Andrew Lenharth dcb3c978c4 Packed Structures
llvm-svn: 32361
2006-12-08 18:06:16 +00:00
Bill Wendling f3baad3ee1 Changed llvm_ostream et all to OStream. llvm_cerr, llvm_cout, llvm_null, are
now cerr, cout, and NullStream resp.

llvm-svn: 32298
2006-12-07 01:30:32 +00:00
Reid Spencer e266dc7621 Regenerate.
llvm-svn: 32246
2006-12-05 23:50:48 +00:00
Reid Spencer 7d9b8a8f03 Remove dead var NewVarArgs.
llvm-svn: 32245
2006-12-05 23:46:41 +00:00
Reid Spencer 2764219e3e Regenerate.
llvm-svn: 32242
2006-12-05 23:29:42 +00:00
Reid Spencer cec21a5592 Dump the old va_arg and va_next upgrade support. No need to keep track of
the current basic block any more either.

llvm-svn: 32241
2006-12-05 23:28:06 +00:00
Reid Spencer 844668d2ef Regenerate.
llvm-svn: 32233
2006-12-05 19:16:11 +00:00
Reid Spencer 5bcee9aa1e Remove various old upgrade hacks that are no longer needed.
llvm-svn: 32232
2006-12-05 19:15:41 +00:00
Reid Spencer d2e0c34798 Regenerate.
llvm-svn: 32173
2006-12-04 05:24:24 +00:00
Reid Spencer f349069f1c For PR950: For ICmp and FCmp constant expressions, put the predicate outiside the parentheses to match what llvm-upgrade generates.
llvm-svn: 32171
2006-12-04 05:20:06 +00:00
Reid Spencer 65f19a0eca Regenerate.
llvm-svn: 32156
2006-12-03 16:20:14 +00:00