[llvm-commits] [SignlessTypes] CVS: llvm/lib/AsmParser/llvmAsmParser.y

Reid Spencer reid at x10sys.com
Sun Oct 22 16:26:40 PDT 2006



Changes in directory llvm/lib/AsmParser:

llvmAsmParser.y updated: 1.266.2.6 -> 1.266.2.7
---
Log message:

Improve documentation for the opcode conversion function.


---
Diffs of the changes:  (+7 -1)

 llvmAsmParser.y |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletion(-)


Index: llvm/lib/AsmParser/llvmAsmParser.y
diff -u llvm/lib/AsmParser/llvmAsmParser.y:1.266.2.6 llvm/lib/AsmParser/llvmAsmParser.y:1.266.2.7
--- llvm/lib/AsmParser/llvmAsmParser.y:1.266.2.6	Sun Oct 22 03:59:00 2006
+++ llvm/lib/AsmParser/llvmAsmParser.y	Sun Oct 22 18:26:26 2006
@@ -813,7 +813,13 @@
   return Ty;
 }
 
-// This function is
+// This template function is used to obtain the correct opcode for an 
+// instruction when an obsolete opcode is encountered. The OpcodeInfo template
+// keeps track of the opcode and the "obsolete" flag. These are generated by
+// the lexer and obsolete will be true when the lexer encounters the token for
+// an obsolete opcode. For example, "div" was replaced by [usf]div but we need
+// to maintain backwards compatibility for asm files that still have the "div"
+// instruction. This function handles converting div -> [usf]div appropriately.
 template <class EnumKind>
 static void sanitizeOpCode(OpcodeInfo<EnumKind> &OI, const PATypeHolder& Ty) {
   if (OI.obsolete) {






More information about the llvm-commits mailing list