summaryrefslogtreecommitdiffstats
path: root/llvm/lib/AsmParser/llvmAsmParser.y
Commit message (Collapse)AuthorAgeFilesLines
...
* Changes to support making the shift instructions be true BinaryOperators.Reid Spencer2007-02-021-24/+7
| | | | | | | | | | | | This feature is needed in order to support shifts of more than 255 bits on large integer types. This changes the syntax for llvm assembly to make shl, ashr and lshr instructions look like a binary operator: shl i32 %X, 1 instead of shl i32 %X, i8 1 Additionally, this should help a few passes perform additional optimizations. llvm-svn: 33776
* eliminate a temporary vectorChris Lattner2007-01-311-2/+3
| | | | llvm-svn: 33695
* For PR1136: Rename GlobalVariable::isExternal as isDeclaration to avoidReid Spencer2007-01-301-2/+2
| | | | | | confusion with external linkage types. llvm-svn: 33663
* Propagate changes from my local tree. This patch includes:Anton Korobeynikov2007-01-281-6/+6
| | | | | | | | | | | | | | | | | | | | | | 1. New parameter attribute called 'inreg'. It has meaning "place this parameter in registers, if possible". This is some generalization of gcc's regparm(n) attribute. It's currently used only in X86-32 backend. 2. Completely rewritten CC handling/lowering code inside X86 backend. Merged stdcall + c CCs and fastcall + fast CC. 3. Dropped CSRET CC. We cannot add struct return variant for each target-specific CC (e.g. stdcall + csretcc and so on). 4. Instead of CSRET CC introduced 'sret' parameter attribute. Setting in on first attribute has meaning 'This is hidden pointer to structure return. Handle it gently'. 5. Fixed small bug in llvm-extract + add new feature to FunctionExtraction pass, which relinks all internal-linkaged callees from deleted function to external linkage. This will allow further linking everything together. NOTEs: 1. Documentation will be updated soon. 2. llvm-upgrade should be improved to translate csret => sret. Before this, there will be some unexpected test fails. llvm-svn: 33597
* For PR645:Reid Spencer2007-01-261-117/+116
| | | | | | | | | | | | | | Implement separation of local and global symbols. Local symbols and types now use % prefix. Global variables and functions now use @ prefix. For PR761: Replace: target endian = target pointersize = With: target datalayout = llvm-svn: 33524
* Fix this error:Jeff Cohen2007-01-211-1/+1
| | | | | | | | 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
* For PR1117:Reid Spencer2007-01-171-15/+12
| | | | | | | | | 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
* rename Type::isIntegral to Type::isInteger, eliminating the old Type::isInteger.Chris Lattner2007-01-151-8/+8
| | | | | | | | | 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
* allow i1 to operators like shift and add.Chris Lattner2007-01-151-4/+4
| | | | llvm-svn: 33221
* Bye bye bool. AsmWriter doesn't generate it any more so AsmParser shouldn'tReid Spencer2007-01-131-5/+8
| | | | | | read it any more. This is consistent with the new IR as well. llvm-svn: 33181
* * PIC codegen for X86/Linux has been implementedAnton Korobeynikov2007-01-121-16/+36
| | | | | | | | * 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
* This production is dead, the lexer can never return 'NOT'Chris Lattner2007-01-121-14/+1
| | | | llvm-svn: 33130
* For PR1064:Reid Spencer2007-01-121-7/+7
| | | | | | | | | | | | | | | | | | | | | | | 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
* Rename BoolTy as Int1Ty. Patch by Sheng Zhou.Reid Spencer2007-01-111-3/+3
| | | | llvm-svn: 33076
* For PR1043:Zhou Sheng2007-01-111-5/+5
| | | | | | | Merge ConstantIntegral and ConstantBool into ConstantInt. Remove ConstantIntegral and ConstantBool from LLVM. llvm-svn: 33073
* Make packed structs use packed initialiers for consistencyAndrew Lenharth2007-01-081-0/+52
| | | | llvm-svn: 33015
* For PR411:Reid Spencer2007-01-061-4/+4
| | | | | | | | | 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
* For PR1077:Reid Spencer2007-01-051-26/+7
| | | | | | | | 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
* Change the syntax for parameter attributes:Reid Spencer2007-01-051-45/+52
| | | | | | | | | | | | | | | | | | | 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
* Disallow packed types in icmp/fcmp instructions. The code generator isReid Spencer2007-01-041-0/+4
| | | | | | not prepared to handle them yet. llvm-svn: 32861
* Permit icmp and fcmp to have packed operands.Reid Spencer2007-01-041-5/+2
| | | | | | Make an error message a little more useful. llvm-svn: 32852
* Implement checking for unresolved types in the argument types and resultReid Spencer2007-01-021-0/+59
| | | | | | | type of function definitions. This fixes test/Regression/Assember/2007-01-02-Undefined-Arg-Type.ll llvm-svn: 32824
* Remove an extra semi-colon.Reid Spencer2006-12-311-1/+1
| | | | llvm-svn: 32799
* Add a missing colon. Noticed by Jeff Cohen.Reid Spencer2006-12-311-0/+1
| | | | llvm-svn: 32796
* For PR950:Reid Spencer2006-12-311-245/+409
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* For PR950:Reid Spencer2006-12-291-76/+78
| | | | | | | | | | | | | | | | | | | | | | | 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
* For PR950:Reid Spencer2006-12-231-23/+1
| | | | | | | | 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
* Allow negative constants for unsigned integers and unsigned constantsReid Spencer2006-12-201-11/+13
| | | | | | | 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
* Packed StructuresAndrew Lenharth2006-12-081-0/+14
| | | | llvm-svn: 32361
* Changed llvm_ostream et all to OStream. llvm_cerr, llvm_cout, llvm_null, areBill Wendling2006-12-071-3/+3
| | | | | | now cerr, cout, and NullStream resp. llvm-svn: 32298
* Remove dead var NewVarArgs.Reid Spencer2006-12-051-3/+0
| | | | llvm-svn: 32245
* Dump the old va_arg and va_next upgrade support. No need to keep track ofReid Spencer2006-12-051-156/+2
| | | | | | the current basic block any more either. llvm-svn: 32241
* Remove various old upgrade hacks that are no longer needed.Reid Spencer2006-12-051-41/+1
| | | | llvm-svn: 32232
* For PR950: For ICmp and FCmp constant expressions, put the predicate ↵Reid Spencer2006-12-041-7/+7
| | | | | | outiside the parentheses to match what llvm-upgrade generates. llvm-svn: 32171
* Remove useless #include.Reid Spencer2006-12-031-1/+0
| | | | llvm-svn: 32155
* Shorten the FCmp and ICmp mnemonics to 3 letters. Make the parserReid Spencer2006-12-031-6/+21
| | | | | | disambiguate them. llvm-svn: 32151
* Remove backwards compatibility goop. Now implemented in llvm-upgrade.Reid Spencer2006-12-031-519/+380
| | | | llvm-svn: 32144
* Introducing external weak linkage. Darwin codegen should be added later.Anton Korobeynikov2006-12-011-1/+1
| | | | llvm-svn: 32052
* Removed #include <iostream> and used llvm streamsBill Wendling2006-11-281-3/+3
| | | | llvm-svn: 31984
* Implement signedness caching for values, value lists, constants andReid Spencer2006-11-281-175/+220
| | | | | | | | | | | constant lists. This is just an internal change to the parser in preparation for some backwards compatibility code that is to follow. This will allow things like "uint 4000000000" to retain the unsignedness of the integer constant as the value moves through the parser. In the future, all integer types will be signless but parsing "uint" and friends will be retained for backwards compatibility. llvm-svn: 31964
* For PR950:Reid Spencer2006-11-271-24/+68
| | | | | | | | | | The long awaited CAST patch. This introduces 12 new instructions into LLVM to replace the cast instruction. Corresponding changes throughout LLVM are provided. This passes llvm-test, llvm/test, and SPEC CPUINT2000 with the exception of 175.vpr which fails only on a slight floating point output difference. llvm-svn: 31931
* For PR950:Reid Spencer2006-11-191-202/+227
| | | | | | | | | Retain the signedness of the old integer types in a new TypeInfo structure so that it can be used in the grammar to implement auto-upgrade of things that depended on signedness of types. This doesn't implement any new functionality in the AsmParser, its just plumbing for future changes. llvm-svn: 31866
* Initialize some pointers to quiet the compiler (when doing build_gccBill Wendling2006-11-121-2/+2
| | | | | | builds). llvm-svn: 31694
* For PR950:Reid Spencer2006-11-081-4/+34
| | | | | | | | This patch converts the old SHR instruction into two instructions, AShr (Arithmetic) and LShr (Logical). The Shr instructions now are not dependent on the sign of their operands. llvm-svn: 31542
* Fix a bug noticed by Emil Mikulic.Chris Lattner2006-11-081-2/+2
| | | | llvm-svn: 31538
* For PR950:Reid Spencer2006-11-021-7/+15
| | | | | | Replace the REM instruction with UREM, SREM and FREM. llvm-svn: 31369
* For PR950:Reid Spencer2006-10-261-19/+64
| | | | | | | | Make necessary changes to support DIV -> [SUF]Div. This changes llvm to have three division instructions: signed, unsigned, floating point. The bytecode and assembler are bacwards compatible, however. llvm-svn: 31195
* Removed extraneous semi-colon; this was prevening the grammar file fromJohn Criswell2006-10-241-1/+1
| | | | | | bison'ing correctly. llvm-svn: 31169
* Remove unneeded CHECK_FOR_ERROR invocations.Reid Spencer2006-10-221-2/+0
| | | | llvm-svn: 31110
* change keyword to datalayoutChris Lattner2006-10-221-2/+2
| | | | llvm-svn: 31108
OpenPOWER on IntegriCloud