diff options
| author | Reid Spencer <rspencer@reidspencer.com> | 2006-11-28 07:28:14 +0000 |
|---|---|---|
| committer | Reid Spencer <rspencer@reidspencer.com> | 2006-11-28 07:28:14 +0000 |
| commit | d47017990b0a1defc24e6a0e1a38953b5d170429 (patch) | |
| tree | 0dc72e243197c1063f3c65f2d1899fb91674e91f /llvm/lib/AsmParser/ParserInternals.h | |
| parent | 59fe2d89aea7fc9a9d137b69c4bf4c862ae7356c (diff) | |
| download | bcm5719-llvm-d47017990b0a1defc24e6a0e1a38953b5d170429.tar.gz bcm5719-llvm-d47017990b0a1defc24e6a0e1a38953b5d170429.zip | |
Implement signedness caching for values, value lists, constants and
constant lists. This is just an internal change to the parser in
preparation for some backwards compatibility code that is to follow.
This will allow things like "uint 4000000000" to retain the unsignedness
of the integer constant as the value moves through the parser. In the
future, all integer types will be signless but parsing "uint" and friends
will be retained for backwards compatibility.
llvm-svn: 31964
Diffstat (limited to 'llvm/lib/AsmParser/ParserInternals.h')
| -rw-r--r-- | llvm/lib/AsmParser/ParserInternals.h | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/llvm/lib/AsmParser/ParserInternals.h b/llvm/lib/AsmParser/ParserInternals.h index 87c6af7b4a3..604057c9ba0 100644 --- a/llvm/lib/AsmParser/ParserInternals.h +++ b/llvm/lib/AsmParser/ParserInternals.h @@ -227,21 +227,30 @@ enum Signedness { isSignless }; -/// This structure is used to keep track of the signedness of the obsolete +/// This type is used to keep track of the signedness of the obsolete /// integer types. Instead of creating an llvm::Type directly, the Lexer will /// create instances of TypeInfo which retains the signedness indication so /// it can be used by the parser for upgrade decisions. -/// For example if "uint" is encountered then the type will be set "int32" -/// and the "signedness" will be "isUnsigned". If the type is not obsolete -/// then "signedness" will be "isSignless". +/// For example if "uint" is encountered then the "first" field will be set +/// to "int32" and the "second" field will be set to "isUnsigned". If the +/// type is not obsolete then "second" will be set to "isSignless". struct TypeInfo { - llvm::PATypeHolder *type; + llvm::PATypeHolder* type; Signedness signedness; }; +/// This type is used to keep track of the signedness of values. Instead +/// of creating llvm::Value directly, the parser will create ValueInfo which +/// associates a Value* with a Signedness indication. struct ValueInfo { - std::vector<llvm::Value*> valuelist; - std::vector<Signedness> signlist; + llvm::Value* val; + Signedness signedness; +}; + +/// This type is used to keep track of the signedness of constants. +struct ConstInfo { + llvm::Constant *cnst; + Signedness signedness; }; #endif |

