summaryrefslogtreecommitdiff
path: root/tools/llvm-upgrade/UpgradeParser.y
Commit message (Collapse)AuthorAge
* For PR1146:Reid Spencer2007-04-22
| | | | | | | | | Make ParamAttrsList objects unique. You can no longer directly create or destroy them but instead must go through the ParamAttrsList::get() interface. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36327 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1336:Reid Spencer2007-04-16
| | | | | | | | Functions without names deserve to be created too. This fixes: test/CodeGen/Generic/vector-constantexpr.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36105 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1336:Reid Spencer2007-04-16
| | | | | | | | When upgrading global vars, look for conflicts with functions as well. This fixes test/Transforms/GlobalDCE/2002-08-17-FunctionDGE.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36103 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1336:Reid Spencer2007-04-16
| | | | | | | | | | Rewrite the upgrade of GEP indices to be a little less obtuse. This fixes test/Assembler/2002-08-19-BytecodeReader.llx test/Assembler/2003-08-21-ConstantExprCast-Fold.llx test/Assembler/2004-01-11-getelementptrfolding.llx git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36095 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a crash-by-unknown-exception caused by attempting to use a null pointerReid Spencer2007-04-11
| | | | | | | as the key for a map insertion. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35896 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1146:Reid Spencer2007-04-11
| | | | | | | | Put the parameter attributes in their own ParamAttr name space. Adjust the rest of llvm as a result. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35877 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1146:Reid Spencer2007-04-09
| | | | | | | Adapt handling of parameter attributes to use ParamAttrsList class. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35812 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1312:Reid Spencer2007-04-07
| | | | | | | | | For the short CALL/INVOKE syntax, the signedness of the result type is two extractions away from the type argument because its a POINTER to function type, not a function type. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35735 91177308-0d34-0410-b5e6-96231b3b80d8
* Upgrade the bit count intrinsics to have an i32 result.Reid Spencer2007-04-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35578 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't upgrade functions that look like a bswap intrinsic but aren't.Reid Spencer2007-04-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35570 91177308-0d34-0410-b5e6-96231b3b80d8
* Handle upgrade of llvm.bswap.iXX to llvm.bswap.iXX.iXX per new namingReid Spencer2007-04-02
| | | | | | | rules for overloaded intrinsic functions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35565 91177308-0d34-0410-b5e6-96231b3b80d8
* Unbreak non-debug builds.Evan Cheng2007-03-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35264 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1243:Reid Spencer2007-03-21
| | | | | | | | Okay, really fix it this time. Make sure the CurFun.Linkage is set early and consolidate some duplicate code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35236 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1256:Reid Spencer2007-03-21
| | | | | | | | | | | | | | | | | | | Make Signedness information pervasive throughout all types and values. There is no easy way to get around this. Because the GEP instruction can index through an arbitrarily complex value structure, it is necessary to keep track of signedness information throughout that structure. This change makes Signedness a full class, capable of representing Signedness in arbitrarily shaped types. The class is then used throughout llvm-upgrade to track signedness and differentiate between globals, locals, and functions based on their signedness. For PR1243: This patch also removes bogus warnings about renaming internal globals. It now only emits such warnings when renaming non-internal globals because they may affect linkage. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35234 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert last changes as they introduced other problems.Reid Spencer2007-03-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35115 91177308-0d34-0410-b5e6-96231b3b80d8
* The sign information was not propagating into the rename map so only theReid Spencer2007-03-14
| | | | | | | | | | | | | | last entry stored in the map could be retrieved for a given integer type. Propagating the sign information required an invasive change to ensure that all ValueRef (ValID) instances get the right sign information as well. Also, put in some assertions to ensure the RenameMap always gives us out the type that is expected. This fixes PR1256 and test/Assembler/2007-03-14-UgpradeLocalSignless.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35112 91177308-0d34-0410-b5e6-96231b3b80d8
* Make older versions of bison happy.Jeff Cohen2007-03-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35099 91177308-0d34-0410-b5e6-96231b3b80d8
* remove use of deprecated apiChris Lattner2007-02-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34416 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1195:Reid Spencer2007-02-15
| | | | | | | | Change use of "packed" term to "vector" in comments, strings, variable names, etc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34300 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1195:Reid Spencer2007-02-15
| | | | | | | | Rename PackedType -> VectorType, ConstantPacked -> ConstantVector, and PackedTyID -> VectorTyID. No functional changes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34293 91177308-0d34-0410-b5e6-96231b3b80d8
* remove use of vector-related ctorsChris Lattner2007-02-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34224 91177308-0d34-0410-b5e6-96231b3b80d8
* stop using me thods that take a vectorChris Lattner2007-02-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34206 91177308-0d34-0410-b5e6-96231b3b80d8
* add #includeChris Lattner2007-02-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34187 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1187:Reid Spencer2007-02-08
| | | | | | | Rename function scope names that conflict with basic block names. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34048 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1187:Reid Spencer2007-02-08
| | | | | | | | | | Always rename, never give a redef error. We could check for collapsed type planes and generate an error if that's not the cause, but the 99.9999 percentile case will be that its the result of collapsed type planes. So, rather than doing an expensive check, just rename. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34047 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1187:Reid Spencer2007-02-08
| | | | | | | | | | | | | | Some changes to get the smbd.ll test case working: 1. Move the logic for CSRETCC->sret attribute out of the ResolveDefinitions code and into getExistingValue. This resolves it much earlier and works in function scope as well. 2. Fix handling of CSRETCC->sret for the store instruction. 3. Rewrite the code for handling renaming to factor in linkage types. 4. Rename a structure filed for a PATypeInfo* so it doesn't get confused with a field for a Type*. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34043 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1187:Reid Spencer2007-02-08
| | | | | | | | When a naming conflict arises, allow internal linkage functions to be renamed without warning or error. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34024 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR411:Reid Spencer2007-02-05
| | | | | | | | | Adjust to changes in Module interface: getMainFunction() -> getFunction("main") getNamedFunction(X) -> getFunction(X) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33922 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR411:Reid Spencer2007-02-05
| | | | | | | | | | | This patch replaces the SymbolTable class with ValueSymbolTable which does not support types planes. This means that all symbol names in LLVM must now be unique. The patch addresses the necessary changes to deal with this and removes code no longer needed as a result. This completes the bulk of the changes for this PR. Some cleanup patches will follow. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33918 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1151:Reid Spencer2007-02-04
| | | | | | | | | | Make llvm-upgrade valgrind clean. Deleting type instances is a really nasty thing to do to LLVM. This was a hold-over from the re-write. This fixes test/Assembler/2007-01-22-UpgradeTypeMapInvalidMemory.ll and potentially many other bugs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33858 91177308-0d34-0410-b5e6-96231b3b80d8
* Changes to support making the shift instructions be true BinaryOperators.Reid Spencer2007-02-02
| | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33776 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1136: Rename GlobalVariable::isExternal as isDeclaration to avoidReid Spencer2007-01-30
| | | | | | | confusion with external linkage types. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33663 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1142:Reid Spencer2007-01-29
| | | | | | | | | | | When an unresolved definition is found, check to see if it is only unresolved because the csretcc was upgraded to the sret param attribute. Such changes change the function type and lead to unresolved definitions. In such cases, just cast the function to the type expected by the CallInst. That is, cast to the version of the function that has the sret param attribute. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33623 91177308-0d34-0410-b5e6-96231b3b80d8
* Upgrade old csret calling convention into sret parameter attribute.Reid Spencer2007-01-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33614 91177308-0d34-0410-b5e6-96231b3b80d8
* Merge error at my side. Fixed.Anton Korobeynikov2007-01-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33601 91177308-0d34-0410-b5e6-96231b3b80d8
* Drop CSRET CCAnton Korobeynikov2007-01-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33598 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1137:Reid Spencer2007-01-28
| | | | | | | | | | | When a value is found to have the same name as another, try harder to disambiguate when its a type plane collapse issue and when it isn't. We traverse the type to see if it contains an integer. If it does not then we issue the error because it can't be resulting from integer type planes collapsing. Otherwise we just rename it, even if that's a bit of overkill. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33594 91177308-0d34-0410-b5e6-96231b3b80d8
* Make sure that an upgraded index is also inserted into the VIndicesReid Spencer2007-01-26
| | | | | | | | | | | otherwise it gets ignored. This fixes test/CodeGen/X86/2006-05-11-InstrSched.ll Thanks to Evan Cheng for noticing this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33546 91177308-0d34-0410-b5e6-96231b3b80d8
* Ensure that gep_upgrade zext instructions we insert have unique names.Reid Spencer2007-01-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33544 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove extraneous ; to make some versions of bison happy.Reid Spencer2007-01-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33541 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the SignedType class and other dead code. Improve comments.Reid Spencer2007-01-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33538 91177308-0d34-0410-b5e6-96231b3b80d8
* For All These Bugs:Reid Spencer2007-01-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | PR645 PR761 PR1082 PR1122 Completely rewrite llvm-upgrade. This should be its final design. Any future changes will use this same design. The changes involve the following: 1. Make this work very much like the 1.9 AsmParser 2. Retain old upgrades dating back to release 1.2 time frame. 3. Merge in some of the upgrades between 1.9 and 2.0 (e.g. icmp/fcmp). 4. Attach a Signedness value (Signless, Unsigned, Signed) to every type, Value, Constant, Instruction, and list of those things in the Parser. Use these to make signedness decisions for instruction upgrades. 5. Implement unique name upgrade for function values and global values. 6. Identify rename cases that might cause problems and warn about them. For example: renaming a global variable with external linkage. 7. Generate a 2.0 IR using VMCore. This is necessary for numerous reasons and has the advantage that it never goes out of date. 8. Use the AsmPrinter to make the output nice. 9. Clean up error and warning messages from 1.9 form. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33531 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bunch of missing semicolon parse errors from bison.Jeff Cohen2007-01-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33426 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1113:Reid Spencer2007-01-15
| | | | | | | | | | | | Increment the counter after the second use, not after the first use. This fixes PR1113. Also, rename some classes for simplicity and to more naturally be reminscient of LLVM 1.9. This in preparation for additional classes that will provide a scaled down model of the LLVM 1.9 IR. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33226 91177308-0d34-0410-b5e6-96231b3b80d8
* Reorganize things a bit in preparation for rewrite. Although this looksReid Spencer2007-01-15
| | | | | | | | | | | | | | | | like a lot, its really only two changes: 1. Move stuff that should be private to .y out of the .h file. 2. Make all semantic values pointers. This cleans up the silly destroy methods and changes them to delete. It also moves the TypeInfo and ValueInfo classes into the .y where we can modify them more readily because they have no clients any more. This shouldn't result in any functional changes in llvm-upgrade. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33211 91177308-0d34-0410-b5e6-96231b3b80d8
* Can't generate "bool" any more. Change to i1Reid Spencer2007-01-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33179 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't attempt to upgrade argument to va.start and va.end if there are none.Reid Spencer2007-01-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33171 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1093:Reid Spencer2007-01-13
| | | | | | | | Implement upgrading of the varargs intrinsics. These must now have i8* arguments. This patch bitcasts arguments to i8* and fixes the prototypes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33163 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove support for upgrading NOT. The llvm-upgrade lexer didn't recognizeReid Spencer2007-01-12
| | | | | | | it either. NOT is just plain illegal now. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33139 91177308-0d34-0410-b5e6-96231b3b80d8
* Upgrade the llvm.isunordered intrinsics to "fcmp uno" instruction.Reid Spencer2007-01-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32986 91177308-0d34-0410-b5e6-96231b3b80d8