aboutsummaryrefslogtreecommitdiffstats
path: root/tools/llvm-upgrade/UpgradeParser.y
Commit message (Collapse)AuthorAgeFilesLines
...
* For PR1082:Reid Spencer2007-01-061-59/+118
| | | | | | | | | Solve several related problems by making variable names more unique and dealing with recursive phi nodes. Unfortunately, this doesn't solve the main issue reported in the PR, but its a step in that direction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32953 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1080:Reid Spencer2007-01-061-2/+2
| | | | | | | | | Emit the correct syntax for icmp and fcmp constant expressions. The predicate goes outside the parentheses not inside. This was a change made in the assembler without the corresponding change made in llvm-upgrade. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32942 91177308-0d34-0410-b5e6-96231b3b80d8
* Major update of llvm-upgrade:Reid Spencer2007-01-051-118/+471
| | | | | | | | | | | | | | | | | | | | 1. Completely revise the type system so that types are handled as const objects and not created multiple times, cloned, or otherwise copied. This gets around memory issues, saves memory, and also emulates LLVM's no-two-types-of-the-same-shape-created semantics. 2. Adjust the handling of global names. Basically, we cannot rename them for a variety of reasons: linking, forward references, etc. 3. Detect global names that have name conflicts as the result of collapsed type planes or redefinitions that llvm-as no longer accepts. These will produce warnings on stderr and one of the globals will be renamed. 4. Rename ParserInternals.h as UpgradeInternals.h so it doesn't conflict in the debugger with ParserInternals.h from lib/AsmParser. 5. Move the guts of the TypeInfo class into the grammar so we aren't implementing large functions in a header file. This also helps with debugging a bit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32906 91177308-0d34-0410-b5e6-96231b3b80d8
* If we hit a parse error, emit something bad to the output stream. This ↵Chris Lattner2007-01-041-0/+2
| | | | | | | | | | | ensures that llvm-upgrade < foo | llvm-as | llvm-dis will fail if llvm-upgrade fails. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32879 91177308-0d34-0410-b5e6-96231b3b80d8
* Finish implementation of variable renaming to handle collapsed type planesReid Spencer2007-01-031-35/+71
| | | | | | | | | by correctly handling up references and enumerated types. Previously there was some confusion of these two. Thanks to Chris Lattner for demistifying llvm up references. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32846 91177308-0d34-0410-b5e6-96231b3b80d8
* Permit signed and unsigned integer constants to be used with either signedReid Spencer2007-01-021-1/+1
| | | | | | | or unsigned integer types. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32816 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1070:Reid Spencer2007-01-021-283/+416
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Revise the upgrade parser to keep track of types more faithfully and use this information to resolve name conflicts resulting from collapsed type planes. The type planes have collapsed because the integer types are now signless so that uint and int became i32. Where two planes existed for uint and int, only i32 exists. Any variable names depending on the type planes to pmake the identifier unique would cause a conflict. This patch resolves that conflict for many but not all cases. Situations involving the integer types and pointers to them are handled by this patch. However, there are corner cases that are not handled well, such as: %t1 = type { uint, int } %t2 = type { int, uint } void %myfunc(%t1* one, %t2* two) { %var = load %t1* one %var = load %t2* two } In the scenario above, %t1 and %t2 are really the same type: { i32, i32 } Consequently attempting to name %var twice will yield a redefinition error when assembled. While this patch is sufficien to allow the llvm/test suite to pass, More work needs to be to complete the handling of these corner cases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32810 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1070:Reid Spencer2007-01-011-2/+33
| | | | | | | Remove useless bitcasts by commenting them out. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32804 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR950:Reid Spencer2006-12-311-21/+17
| | | | | | | | | | Don't attempt to parse both the old and new grammars. It is near impossible to get it right. Remove support for the new define keyword and don't attempt to insert parameter attributes because there isn't enough contextual information for it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32784 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR950:Reid Spencer2006-12-291-41/+63
| | | | | | | | | | | | Fix several bugs and update for new assembly syntax. Changes made include: 1. Fixing rules for icmp/fcmp instructions to not require a closing paren at the end. This was a cut-and-paste error from a previous commit. 2. Changing things like Out << " " to Out << ' ' 3. Adding the "define" keyword for function definitions 4. Adding support for packed structures git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32771 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR950:Reid Spencer2006-12-231-16/+2
| | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32751 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix test/Regression/Assembler/2006-12-09-Cast-To-Bool.llReid Spencer2006-12-091-1/+1
| | | | | | | Do not upgrade casts of bool to bool. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32404 91177308-0d34-0410-b5e6-96231b3b80d8
* When upgrading cast to bool to a setne, generate icmp ne instead.Reid Spencer2006-12-091-4/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32399 91177308-0d34-0410-b5e6-96231b3b80d8
* Create an option to turn off generation of fcmp instructions while stillReid Spencer2006-12-071-0/+9
| | | | | | | allowing integer setxx instructions to be converted to icmp. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32302 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix build for older versios of bison.Jim Laskey2006-12-061-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32274 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't turn on SETCC upgrade yet!Reid Spencer2006-12-061-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32268 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix upgrade of setcc with bool operands.Reid Spencer2006-12-061-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32266 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR645:Reid Spencer2006-12-051-4/+13
| | | | | | | | Keep track of global constant and variable definitions for eventual use in resolving conflicts between global and local symbol usage. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32234 91177308-0d34-0410-b5e6-96231b3b80d8
* Match the llvmAsmParser's handling of ICmp and FCmp instructions.Reid Spencer2006-12-031-7/+17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32153 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a needed #include.Reid Spencer2006-12-031-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32141 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement upgrade of setcc instruction to icmp/fcmp, but don't enable itReid Spencer2006-12-021-1/+52
| | | | | | | yet. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32139 91177308-0d34-0410-b5e6-96231b3b80d8
* Support several new upgrades:Reid Spencer2006-12-021-30/+63
| | | | | | | | | | | div -> fdiv/udiv/sdiv rem -> frem/urem/srem except -> unwind uninitialized -> external as well as tracking the element type of pointers, packed, and array. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32127 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement the GEP upgrade for non-constant unsigned indicesReid Spencer2006-12-021-55/+84
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32121 91177308-0d34-0410-b5e6-96231b3b80d8
* Keep lists of values so they can be examined.Reid Spencer2006-12-021-19/+53
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32120 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for global types and type resolution. Fix several minorReid Spencer2006-12-021-58/+123
| | | | | | | | formatting and spacing bugs. This is sufficient for llvm-upgrade to correctly upgrade all of llvm/test. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32114 91177308-0d34-0410-b5e6-96231b3b80d8
* Handle upgrade of fp -> ptr cast with fp -> int -> ptrReid Spencer2006-12-011-7/+41
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32109 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't convert {} into []!Reid Spencer2006-12-011-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32106 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow the new cast instructions.Reid Spencer2006-12-011-7/+15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32104 91177308-0d34-0410-b5e6-96231b3b80d8
* Upgrade shr to ashr and lshrReid Spencer2006-12-011-8/+14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32103 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't treat numeric (untyped) constants as a ConstInfo, just pass theReid Spencer2006-12-011-52/+47
| | | | | | | string and let ConstVal add the type. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32096 91177308-0d34-0410-b5e6-96231b3b80d8
* First version of llvm-upgrade that can correctly upgrade all ofReid Spencer2006-12-011-9/+18
| | | | | | | test/Feature git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32092 91177308-0d34-0410-b5e6-96231b3b80d8
* valgrind clean version of llvm-upgradeReid Spencer2006-12-011-11/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32090 91177308-0d34-0410-b5e6-96231b3b80d8
* First version of llvm-upgrade that can correctly upgrade a large testReid Spencer2006-12-011-218/+419
| | | | | | | case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32089 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow llvm-upgrade to read from stdin. Configure the lexer for readingReid Spencer2006-11-301-11/+6
| | | | | | | from C++ std::istream. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32041 91177308-0d34-0410-b5e6-96231b3b80d8
* Initial, non-functional, version of llvm-upgrade. This version just echosReid Spencer2006-11-301-0/+903
its input. Committed for safekeeping purposes. Don't use this yet. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32030 91177308-0d34-0410-b5e6-96231b3b80d8