summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorDavid Greene <greened@obbligato.org>2011-08-10 18:27:45 +0000
committerDavid Greene <greened@obbligato.org>2011-08-10 18:27:45 +0000
commit0b18d59435a7c01a433ac69845e6d8e1ad66ce8b (patch)
treec7475fe1d4a0157ad02788e8183d82fd1585ef35 /utils
parent7cb3dcb927a8f8a872cdf309f78cd80e197d2f14 (diff)
downloadllvm-0b18d59435a7c01a433ac69845e6d8e1ad66ce8b.tar.gz
llvm-0b18d59435a7c01a433ac69845e6d8e1ad66ce8b.tar.bz2
llvm-0b18d59435a7c01a433ac69845e6d8e1ad66ce8b.tar.xz
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
Diffstat (limited to 'utils')
-rw-r--r--utils/TableGen/Record.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/utils/TableGen/Record.h b/utils/TableGen/Record.h
index a8ab8001c9..802eaedac0 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