From: David Greene Date: Wed, 10 Aug 2011 18:27:45 +0000 (+0000) Subject: Add getAsUnquotedString X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=0b18d59435a7c01a433ac69845e6d8e1ad66ce8b;p=oota-llvm.git Add getAsUnquotedString Add a method to return an Init as an unquoted string. This primarily affects StringInit where we return the value without surrounding it with quotes. This is in preparation for removing the ugly #NAME# hack and replacing it with standard TabelGen operators. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137231 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/utils/TableGen/Record.h b/utils/TableGen/Record.h index a8ab8001c98..802eaedac0c 100644 --- a/utils/TableGen/Record.h +++ b/utils/TableGen/Record.h @@ -506,6 +506,11 @@ public: /// getAsString - Convert this value to a string form. virtual std::string getAsString() const = 0; + /// getAsUnquotedString - Convert this value to a string form, + /// without adding quote markers. This primaruly affects + /// StringInits where we will not surround the string value with + /// quotes. + virtual std::string getAsUnquotedString() const { return getAsString(); } /// dump - Debugging method that may be called through a debugger, just /// invokes print on stderr. @@ -757,6 +762,7 @@ public: } virtual std::string getAsString() const { return "\"" + Value + "\""; } + virtual std::string getAsUnquotedString() const { return Value; } /// resolveBitReference - This method is used to implement /// VarBitInit::resolveReferences. If the bit is able to be resolved, we