Expand the mask capability for deciding which functions are mips16 and mips32
so it can be better used for general interoperability testing between mips32
and mips16.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190762 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/Mips/MipsOs16.cpp b/lib/Target/Mips/MipsOs16.cpp
index 5f9b60c..49c73b5 100644
--- a/lib/Target/Mips/MipsOs16.cpp
+++ b/lib/Target/Mips/MipsOs16.cpp
@@ -103,8 +103,9 @@
if (F->isDeclaration()) continue;
DEBUG(dbgs() << "Working on " << F->getName() << "\n");
if (usingMask) {
- if ((functionIndex < Mips32FunctionMask.length()) &&
- (Mips32FunctionMask[functionIndex] == '1')) {
+ if (functionIndex == Mips32FunctionMask.length())
+ functionIndex = 0;
+ if (Mips32FunctionMask[functionIndex] == '1') {
DEBUG(dbgs() << "mask forced mips32: " << F->getName() << "\n");
F->addFnAttr("nomips16");
}