[llvm-commits] [llvm] r99446 - /llvm/trunk/include/llvm/Target/TargetInstrDesc.h
Chris Lattner
sabre at nondot.org
Wed Mar 24 16:07:48 PDT 2010
Author: lattner
Date: Wed Mar 24 18:07:47 2010
New Revision: 99446
URL: http://llvm.org/viewvc/llvm-project?rev=99446&view=rev
Log:
add a convenient TargetInstrDesc::getNumImplicitUses/Defs method.
Modified:
llvm/trunk/include/llvm/Target/TargetInstrDesc.h
Modified: llvm/trunk/include/llvm/Target/TargetInstrDesc.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetInstrDesc.h?rev=99446&r1=99445&r2=99446&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Target/TargetInstrDesc.h (original)
+++ llvm/trunk/include/llvm/Target/TargetInstrDesc.h Wed Mar 24 18:07:47 2010
@@ -204,6 +204,16 @@
return ImplicitUses;
}
+ /// getNumImplicitUses - Return the number of implicit uses this instruction
+ /// has.
+ unsigned getNumImplicitUses() const {
+ if (ImplicitUses == 0) return 0;
+ unsigned i = 0;
+ for (; ImplicitUses[i]; ++i) /*empty*/;
+ return i;
+ }
+
+
/// getImplicitDefs - Return a list of registers that are potentially
/// written by any instance of this machine instruction. For example, on X86,
/// many instructions implicitly set the flags register. In this case, they
@@ -218,6 +228,15 @@
return ImplicitDefs;
}
+ /// getNumImplicitDefs - Return the number of implicit defs this instruction
+ /// has.
+ unsigned getNumImplicitDefs() const {
+ if (ImplicitDefs == 0) return 0;
+ unsigned i = 0;
+ for (; ImplicitDefs[i]; ++i) /*empty*/;
+ return i;
+ }
+
/// hasImplicitUseOfPhysReg - Return true if this instruction implicitly
/// uses the specified physical register.
bool hasImplicitUseOfPhysReg(unsigned Reg) const {
More information about the llvm-commits
mailing list