aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/MachineInstr.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2011-12-08 19:23:10 +0000
committerEvan Cheng <evan.cheng@apple.com>2011-12-08 19:23:10 +0000
commit43d5d4ca1c93529c43e78cc5aa03c4ee10a6b0d8 (patch)
treea29ece352a28db522f70a42ae577aacfb5da4194 /lib/CodeGen/MachineInstr.cpp
parente9c1e07c5f2abd4ce30b942ddb2ac165391b21a2 (diff)
downloadexternal_llvm-43d5d4ca1c93529c43e78cc5aa03c4ee10a6b0d8.zip
external_llvm-43d5d4ca1c93529c43e78cc5aa03c4ee10a6b0d8.tar.gz
external_llvm-43d5d4ca1c93529c43e78cc5aa03c4ee10a6b0d8.tar.bz2
Make MachineInstr instruction property queries more flexible. This change all
clients to decide whether to look inside bundled instructions and whether the query should return true if any / all bundled instructions have the queried property. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146168 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineInstr.cpp')
-rw-r--r--lib/CodeGen/MachineInstr.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/CodeGen/MachineInstr.cpp b/lib/CodeGen/MachineInstr.cpp
index 0471cf2..d16e5d4 100644
--- a/lib/CodeGen/MachineInstr.cpp
+++ b/lib/CodeGen/MachineInstr.cpp
@@ -749,24 +749,24 @@ void MachineInstr::addMemOperand(MachineFunction &MF,
}
bool
-MachineInstr::hasProperty(unsigned MCFlag, bool PeekInBundle, bool IsOr) const {
- if (!PeekInBundle || getOpcode() != TargetOpcode::BUNDLE)
+MachineInstr::hasProperty(unsigned MCFlag, QueryType Type) const {
+ if (Type == IgnoreBundle || getOpcode() != TargetOpcode::BUNDLE)
return getDesc().getFlags() & (1 << MCFlag);
const MachineBasicBlock *MBB = getParent();
MachineBasicBlock::const_insn_iterator MII = *this; ++MII;
while (MII != MBB->end() && MII->isInsideBundle()) {
if (MII->getDesc().getFlags() & (1 << MCFlag)) {
- if (IsOr)
+ if (Type == AnyInBundle)
return true;
} else {
- if (!IsOr)
+ if (Type == AllInBundle)
return false;
}
++MII;
}
- return !IsOr;
+ return Type == AllInBundle;
}
bool MachineInstr::isIdenticalTo(const MachineInstr *Other,