diff options
| author | Eric Christopher <echristo@apple.com> | 2011-06-21 00:05:20 +0000 |
|---|---|---|
| committer | Eric Christopher <echristo@apple.com> | 2011-06-21 00:05:20 +0000 |
| commit | cdd3635b0930239aaa91f435910b4b94285901ee (patch) | |
| tree | 56ea5df203033f1a0d2470b4a609f5ffe564df78 /clang/lib/Basic/TargetInfo.cpp | |
| parent | d155c0b45154a12e4450da255ebffc4d145c07be (diff) | |
| download | bcm5719-llvm-cdd3635b0930239aaa91f435910b4b94285901ee.tar.gz bcm5719-llvm-cdd3635b0930239aaa91f435910b4b94285901ee.zip | |
Move additional register names to their own lookup, separate from
register aliases. Fixes unnecessary renames of clobbers.
Fixes part of rdar://9425559
llvm-svn: 133485
Diffstat (limited to 'clang/lib/Basic/TargetInfo.cpp')
| -rw-r--r-- | clang/lib/Basic/TargetInfo.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/clang/lib/Basic/TargetInfo.cpp b/clang/lib/Basic/TargetInfo.cpp index dcf0cb4237a..2d4c4a97916 100644 --- a/clang/lib/Basic/TargetInfo.cpp +++ b/clang/lib/Basic/TargetInfo.cpp @@ -212,6 +212,20 @@ bool TargetInfo::isValidGCCRegisterName(llvm::StringRef Name) const { return true; } + // Check any additional names that we have. + const AddlRegName *AddlNames; + unsigned NumAddlNames; + getGCCAddlRegNames(AddlNames, NumAddlNames); + for (unsigned i = 0; i < NumAddlNames; i++) + for (unsigned j = 0; j < llvm::array_lengthof(AddlNames[i].Names); j++) { + if (!AddlNames[i].Names[j]) + break; + // Make sure the register that the additional name is for is within + // the bounds of the register names from above. + if (AddlNames[i].Names[j] == Name && AddlNames[i].RegNum < NumNames) + return true; + } + // Now check aliases. const GCCRegAlias *Aliases; unsigned NumAliases; @@ -251,6 +265,20 @@ TargetInfo::getNormalizedGCCRegisterName(llvm::StringRef Name) const { } } + // Check any additional names that we have. + const AddlRegName *AddlNames; + unsigned NumAddlNames; + getGCCAddlRegNames(AddlNames, NumAddlNames); + for (unsigned i = 0; i < NumAddlNames; i++) + for (unsigned j = 0; j < llvm::array_lengthof(AddlNames[i].Names); j++) { + if (!AddlNames[i].Names[j]) + break; + // Make sure the register that the additional name is for is within + // the bounds of the register names from above. + if (AddlNames[i].Names[j] == Name && AddlNames[i].RegNum < NumNames) + return Name; + } + // Now check aliases. const GCCRegAlias *Aliases; unsigned NumAliases; |

