summaryrefslogtreecommitdiff
path: root/tools/llvm-upgrade/UpgradeLexer.l
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2007-01-02 05:44:33 +0000
committerReid Spencer <rspencer@reidspencer.com>2007-01-02 05:44:33 +0000
commit2b8036e2c89f1c2075fd6611dd0eb6047cad54dd (patch)
tree92c2dfb45a91e96ea8828e8c3694afc4e111a207 /tools/llvm-upgrade/UpgradeLexer.l
parent627c73d13a82eca7f8c1f630bc5d6d462224f7e7 (diff)
downloadllvm-2b8036e2c89f1c2075fd6611dd0eb6047cad54dd.tar.gz
llvm-2b8036e2c89f1c2075fd6611dd0eb6047cad54dd.tar.bz2
llvm-2b8036e2c89f1c2075fd6611dd0eb6047cad54dd.tar.xz
For PR1070:
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
Diffstat (limited to 'tools/llvm-upgrade/UpgradeLexer.l')
-rw-r--r--tools/llvm-upgrade/UpgradeLexer.l4
1 files changed, 1 insertions, 3 deletions
diff --git a/tools/llvm-upgrade/UpgradeLexer.l b/tools/llvm-upgrade/UpgradeLexer.l
index 8ffca760fd..d9e5d0ebe3 100644
--- a/tools/llvm-upgrade/UpgradeLexer.l
+++ b/tools/llvm-upgrade/UpgradeLexer.l
@@ -48,9 +48,7 @@
return sym
#define RET_TY(sym,OldTY,NewTY,sign) \
- Upgradelval.Type.newTy = new std::string(NewTY); \
- Upgradelval.Type.oldTy = OldTY; \
- Upgradelval.Type.elemTy = VoidTy; \
+ Upgradelval.Type = new TypeInfo(NewTY, OldTY); \
return sym
#define YY_NEVER_INTERACTIVE 1