summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMisha Brukman <brukman+llvm@gmail.com>2004-10-14 05:50:43 +0000
committerMisha Brukman <brukman+llvm@gmail.com>2004-10-14 05:50:43 +0000
commit35e83cc970e2ed99c8087e0c6b99f8a3618c279b (patch)
tree14ae5a1a894b7179fbb8827e256acdf670a2aa16
parent9c07866ef861e072395306e9811c329c7fe5bbe8 (diff)
downloadllvm-35e83cc970e2ed99c8087e0c6b99f8a3618c279b.tar.gz
llvm-35e83cc970e2ed99c8087e0c6b99f8a3618c279b.tar.bz2
llvm-35e83cc970e2ed99c8087e0c6b99f8a3618c279b.tar.xz
* Add option to read isLittleEndianEncoding for InstrInfo classes
* Doxygen-ify some function comments git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16974 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--utils/TableGen/CodeGenTarget.cpp9
-rw-r--r--utils/TableGen/CodeGenTarget.h4
2 files changed, 13 insertions, 0 deletions
diff --git a/utils/TableGen/CodeGenTarget.cpp b/utils/TableGen/CodeGenTarget.cpp
index 4c882ad555..3680f197c4 100644
--- a/utils/TableGen/CodeGenTarget.cpp
+++ b/utils/TableGen/CodeGenTarget.cpp
@@ -188,6 +188,7 @@ void CodeGenTarget::ReadInstructions() const {
}
/// getPHIInstruction - Return the designated PHI instruction.
+///
const CodeGenInstruction &CodeGenTarget::getPHIInstruction() const {
Record *PHI = getInstructionSet()->getValueAsDef("PHIInst");
std::map<std::string, CodeGenInstruction>::const_iterator I =
@@ -197,6 +198,13 @@ const CodeGenInstruction &CodeGenTarget::getPHIInstruction() const {
return I->second;
}
+/// isLittleEndianEncoding - Return whether this target encodes its instruction
+/// in little-endian format, i.e. bits laid out in the order [0..n]
+///
+bool CodeGenTarget::isLittleEndianEncoding() const {
+ return getInstructionSet()->getValueAsBit("isLittleEndianEncoding");
+}
+
CodeGenInstruction::CodeGenInstruction(Record *R, const std::string &AsmStr)
: TheDef(R), AsmString(AsmStr) {
Name = R->getValueAsString("Name");
@@ -250,6 +258,7 @@ CodeGenInstruction::CodeGenInstruction(Record *R, const std::string &AsmStr)
/// getOperandNamed - Return the index of the operand with the specified
/// non-empty name. If the instruction does not have an operand with the
/// specified name, throw an exception.
+///
unsigned CodeGenInstruction::getOperandNamed(const std::string &Name) const {
assert(!Name.empty() && "Cannot search for operand with no name!");
for (unsigned i = 0, e = OperandList.size(); i != e; ++i)
diff --git a/utils/TableGen/CodeGenTarget.h b/utils/TableGen/CodeGenTarget.h
index 9b338d88c9..d74e8872a3 100644
--- a/utils/TableGen/CodeGenTarget.h
+++ b/utils/TableGen/CodeGenTarget.h
@@ -96,6 +96,10 @@ public:
/// getPHIInstruction - Return the designated PHI instruction.
///
const CodeGenInstruction &getPHIInstruction() const;
+
+ /// isLittleEndianEncoding - are instruction bit patterns defined as [0..n]?
+ ///
+ bool isLittleEndianEncoding() const;
};
} // End llvm namespace