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 | e883f501bbd63c192c04f80f9e92fb81741f1c9a (patch) | |
tree | 159e8ea36ba65cca042a092296a69671af910e85 /llvm/lib/Target/Mips/MipsOs16.cpp | |
parent | d60982a01bf51b143144998621d984bf37ba6bf9 (diff) | |
download | bcm5719-llvm-e883f501bbd63c192c04f80f9e92fb81741f1c9a.tar.gz bcm5719-llvm-e883f501bbd63c192c04f80f9e92fb81741f1c9a.zip |
Make nomips16 mask not repeat if it ends with a '.'.
This mask is purely for debugging and testing.
llvm-svn: 191231
Diffstat (limited to 'llvm/lib/Target/Mips/MipsOs16.cpp')
-rw-r--r-- | llvm/lib/Target/Mips/MipsOs16.cpp | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/llvm/lib/Target/Mips/MipsOs16.cpp b/llvm/lib/Target/Mips/MipsOs16.cpp index 49c73b56142..fe60841212e 100644 --- a/llvm/lib/Target/Mips/MipsOs16.cpp +++ b/llvm/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)) { |