Make ID Parsing More Flexible
authorDavid Greene <greened@obbligato.org>
Wed, 19 Oct 2011 13:04:20 +0000 (13:04 +0000)
committerDavid Greene <greened@obbligato.org>
Wed, 19 Oct 2011 13:04:20 +0000 (13:04 +0000)
commitf3744a0cf9f622e0879a80c1fdcb0f6072e5a6c3
tree632cd0c6b6e7b717091cf32b44d223a90fc65bab
parente338565757bfcfe9d762751c976684f66954fb45
Make ID Parsing More Flexible

Add a mode control to value and ID parsers.  The two modes are:

- Parse a value.  Expect the parsed ID to map to an existing object.

- Parse a name.  Expect the parsed ID to not map to any existing object.

The first is used when parsing an identifier to be looked up, for
example a record field or template argument.  The second is used for
parsing declarations.  Paste functionality implies that declarations
can contain arbitrary expressions so we need to be able to call into
the general value parser to parse declarations with paste operators.
So we need a way to parse a value-like thing without expecting that
the result will map to some existing object.  This parse mode provides
that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142519 91177308-0d34-0410-b5e6-96231b3b80d8
lib/TableGen/TGParser.cpp
lib/TableGen/TGParser.h