[llvm-commits] CVS: llvm/utils/TableGen/CodeGenTarget.cpp CodeGenTarget.h

Misha Brukman brukman at cs.uiuc.edu
Wed Oct 13 22:50:54 PDT 2004



Changes in directory llvm/utils/TableGen:

CodeGenTarget.cpp updated: 1.24 -> 1.25
CodeGenTarget.h updated: 1.13 -> 1.14
---
Log message:

* Add option to read isLittleEndianEncoding for InstrInfo classes
* Doxygen-ify some function comments


---
Diffs of the changes:  (+13 -0)

Index: llvm/utils/TableGen/CodeGenTarget.cpp
diff -u llvm/utils/TableGen/CodeGenTarget.cpp:1.24 llvm/utils/TableGen/CodeGenTarget.cpp:1.25
--- llvm/utils/TableGen/CodeGenTarget.cpp:1.24	Sun Oct  3 14:34:31 2004
+++ llvm/utils/TableGen/CodeGenTarget.cpp	Thu Oct 14 00:50:43 2004
@@ -188,6 +188,7 @@
 }
 
 /// 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 @@
   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 @@
 /// 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)


Index: llvm/utils/TableGen/CodeGenTarget.h
diff -u llvm/utils/TableGen/CodeGenTarget.h:1.13 llvm/utils/TableGen/CodeGenTarget.h:1.14
--- llvm/utils/TableGen/CodeGenTarget.h:1.13	Fri Aug 20 23:05:00 2004
+++ llvm/utils/TableGen/CodeGenTarget.h	Thu Oct 14 00:50:43 2004
@@ -96,6 +96,10 @@
   /// 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






More information about the llvm-commits mailing list