Add a new Record::getValueAsCode method to mirror the other getValueAs*
methods.  Use it to simplify some code.

llvm-svn: 23336
diff --git a/llvm/utils/TableGen/Record.h b/llvm/utils/TableGen/Record.h
index 4ca0890..edd875a 100644
--- a/llvm/utils/TableGen/Record.h
+++ b/llvm/utils/TableGen/Record.h
@@ -1023,6 +1023,12 @@
   /// the value is not the right type.
   ///
   DagInit *getValueAsDag(const std::string &FieldName) const;
+  
+  /// getValueAsCode - This method looks up the specified field and returns
+  /// its value as the string data in a CodeInit, throwing an exception if the
+  /// field does not exist or if the value is not a code object.
+  ///
+  std::string getValueAsCode(const std::string &FieldName) const;
 };
 
 std::ostream &operator<<(std::ostream &OS, const Record &R);