diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2006-11-19 23:07:00 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2006-11-19 23:07:00 +0000 |
commit | 36699cabc5ab461f53047be6384a27fb9a7845ce (patch) | |
tree | 57172b8be35b2952faa79722ee7e63e6494877d3 /lib/AsmParser/ParserInternals.h | |
parent | b7f26289b1a1e29796a451177e9a51a7546b6b55 (diff) |
For PR950:
Retain the signedness of the old integer types in a new TypeInfo structure
so that it can be used in the grammar to implement auto-upgrade of things
that depended on signedness of types. This doesn't implement any new
functionality in the AsmParser, its just plumbing for future changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31866 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AsmParser/ParserInternals.h')
-rw-r--r-- | lib/AsmParser/ParserInternals.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/AsmParser/ParserInternals.h b/lib/AsmParser/ParserInternals.h index 9c94505bf8..c26c5f4ffb 100644 --- a/lib/AsmParser/ParserInternals.h +++ b/lib/AsmParser/ParserInternals.h @@ -217,4 +217,30 @@ typedef OpcodeInfo<llvm::Instruction::TermOps> TermOpInfo; typedef OpcodeInfo<llvm::Instruction::MemoryOps> MemOpInfo; typedef OpcodeInfo<llvm::Instruction::OtherOps> OtherOpInfo; +/// This enumeration is used to indicate if a type is signed, signless or +/// unsigned. It is used for backwards compatibility with assembly code that +/// pre-dates the signless types conversion. +enum Signedness { + isSigned, + isUnsigned, + isSignless +}; + +/// This structure 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". +struct TypeInfo { + llvm::PATypeHolder *type; + Signedness signedness; +}; + +struct ValueInfo { + std::vector<llvm::Value*> valuelist; + std::vector<Signedness> signlist; +}; + #endif |