diff options
author | Chris Lattner <sabre@nondot.org> | 2004-10-16 18:17:13 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-10-16 18:17:13 +0000 |
commit | 16710e9574c6750d3cb7788cc4ab78bc9e970d9a (patch) | |
tree | a7d06b1f9f95c02e660b80897ef43c03cbf64696 /lib/AsmParser/ParserInternals.h | |
parent | c17edbdeeb1e117f7e6364abe9afbfbd768d7869 (diff) |
Parse undef and unreachable
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17053 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AsmParser/ParserInternals.h')
-rw-r--r-- | lib/AsmParser/ParserInternals.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/AsmParser/ParserInternals.h b/lib/AsmParser/ParserInternals.h index 9fdc8e66f8..98ea0341c6 100644 --- a/lib/AsmParser/ParserInternals.h +++ b/lib/AsmParser/ParserInternals.h @@ -72,7 +72,7 @@ static inline void ThrowException(const std::string &message, struct ValID { enum { NumberVal, NameVal, ConstSIntVal, ConstUIntVal, ConstFPVal, ConstNullVal, - ConstantVal, + ConstUndefVal, ConstantVal, } Type; union { @@ -108,6 +108,10 @@ struct ValID { ValID D; D.Type = ConstNullVal; return D; } + static ValID createUndef() { + ValID D; D.Type = ConstUndefVal; return D; + } + static ValID create(Constant *Val) { ValID D; D.Type = ConstantVal; D.ConstantValue = Val; return D; } @@ -130,6 +134,7 @@ struct ValID { case NameVal : return Name; case ConstFPVal : return ftostr(ConstPoolFP); case ConstNullVal : return "null"; + case ConstUndefVal : return "undef"; case ConstUIntVal : case ConstSIntVal : return std::string("%") + itostr(ConstPool64); case ConstantVal: @@ -152,6 +157,7 @@ struct ValID { case ConstUIntVal: return UConstPool64 < V.UConstPool64; case ConstFPVal: return ConstPoolFP < V.ConstPoolFP; case ConstNullVal: return false; + case ConstUndefVal: return false; case ConstantVal: return ConstantValue < V.ConstantValue; default: assert(0 && "Unknown value type!"); return false; } |