[llvm-commits] [llvm] r142494 - /llvm/trunk/include/llvm/TableGen/Record.h

David Greene greened at obbligato.org
Wed Oct 19 06:02:22 PDT 2011


Author: greened
Date: Wed Oct 19 08:02:22 2011
New Revision: 142494

URL: http://llvm.org/viewvc/llvm-project?rev=142494&view=rev
Log:
Add Init Accessors

Add a couple of utility functions to get at the name init and return
the name init as a string.  This will be used for paste functionality.

Modified:
    llvm/trunk/include/llvm/TableGen/Record.h

Modified: llvm/trunk/include/llvm/TableGen/Record.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/TableGen/Record.h?rev=142494&r1=142493&r2=142494&view=diff
==============================================================================
--- llvm/trunk/include/llvm/TableGen/Record.h (original)
+++ llvm/trunk/include/llvm/TableGen/Record.h Wed Oct 19 08:02:22 2011
@@ -1345,6 +1345,10 @@
   RecordVal(const std::string &N, RecTy *T, unsigned P);
 
   const std::string &getName() const;
+  const Init *getNameInit() const { return Name; }
+  std::string getNameInitAsString() const {
+    return getNameInit()->getAsUnquotedString();
+  }
 
   unsigned getPrefix() const { return Prefix; }
   RecTy *getType() const { return Ty; }





More information about the llvm-commits mailing list