diff options
author | Reed Kotler <rkotler@mips.com> | 2013-09-23 22:36:11 +0000 |
---|---|---|
committer | Reed Kotler <rkotler@mips.com> | 2013-09-23 22:36:11 +0000 |
commit | f2058addc2aa221d0fd744180a2c04a38ebddcd0 (patch) | |
tree | f3b7391b5731b7e28c535f88b5ab6656b561fb92 /lib/Target/Mips/MipsOs16.cpp | |
parent | 54e82495e99632c2d1009ac0dde796c0e9e651f7 (diff) | |
download | llvm-f2058addc2aa221d0fd744180a2c04a38ebddcd0.tar.gz llvm-f2058addc2aa221d0fd744180a2c04a38ebddcd0.tar.bz2 llvm-f2058addc2aa221d0fd744180a2c04a38ebddcd0.tar.xz |
Make nomips16 mask not repeat if it ends with a '.'.
This mask is purely for debugging and testing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191231 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Mips/MipsOs16.cpp')
-rw-r--r-- | lib/Target/Mips/MipsOs16.cpp | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/lib/Target/Mips/MipsOs16.cpp b/lib/Target/Mips/MipsOs16.cpp index 49c73b5614..fe60841212 100644 --- a/lib/Target/Mips/MipsOs16.cpp +++ b/lib/Target/Mips/MipsOs16.cpp @@ -94,6 +94,7 @@ namespace llvm { bool MipsOs16::runOnModule(Module &M) { bool usingMask = Mips32FunctionMask.length() > 0; + bool doneUsingMask = false; // this will make it stop repeating DEBUG(dbgs() << "Run on Module MipsOs16 \n" << Mips32FunctionMask << "\n"); if (usingMask) DEBUG(dbgs() << "using mask \n" << Mips32FunctionMask << "\n"); @@ -103,13 +104,22 @@ bool MipsOs16::runOnModule(Module &M) { if (F->isDeclaration()) continue; DEBUG(dbgs() << "Working on " << F->getName() << "\n"); if (usingMask) { - if (functionIndex == Mips32FunctionMask.length()) - functionIndex = 0; - if (Mips32FunctionMask[functionIndex] == '1') { - DEBUG(dbgs() << "mask forced mips32: " << F->getName() << "\n"); - F->addFnAttr("nomips16"); + if (!doneUsingMask) { + if (functionIndex == Mips32FunctionMask.length()) + functionIndex = 0; + switch (Mips32FunctionMask[functionIndex]) { + case '1': + DEBUG(dbgs() << "mask forced mips32: " << F->getName() << "\n"); + F->addFnAttr("nomips16"); + break; + case '.': + doneUsingMask = true; + break; + default: + break; + } + functionIndex++; } - functionIndex++; } else { if (needsFP(*F)) { |