diff options
| author | Chris Lattner <sabre@nondot.org> | 2001-10-13 06:37:47 +0000 | 
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2001-10-13 06:37:47 +0000 | 
| commit | 930f610ea55198697b92b2915d85e00ca01ec2aa (patch) | |
| tree | 02920d4dba66946ff0105792e748ae33f64ea6d0 /llvm/lib | |
| parent | fc4c5040aa39b0762768ef74941ae3f5f89d2200 (diff) | |
| download | bcm5719-llvm-930f610ea55198697b92b2915d85e00ca01ec2aa.tar.gz bcm5719-llvm-930f610ea55198697b92b2915d85e00ca01ec2aa.zip | |
Add operator< to ValID's so that they can be put in map's
llvm-svn: 757
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/AsmParser/ParserInternals.h | 14 | 
1 files changed, 14 insertions, 0 deletions
| diff --git a/llvm/lib/AsmParser/ParserInternals.h b/llvm/lib/AsmParser/ParserInternals.h index b00a35281fb..6abe6083f0d 100644 --- a/llvm/lib/AsmParser/ParserInternals.h +++ b/llvm/lib/AsmParser/ParserInternals.h @@ -130,6 +130,20 @@ struct ValID {        abort();      }    } + +  bool operator<(const ValID &V) const { +    if (Type != V.Type) return Type < V.Type; +    switch (Type) { +    case NumberVal:     return Num < V.Num; +    case ConstStringVal: +    case NameVal:       return strcmp(Name, V.Name) < 0; +    case ConstSIntVal:  return ConstPool64  < V.ConstPool64; +    case ConstUIntVal:  return UConstPool64 < V.UConstPool64; +    case ConstFPVal:    return ConstPoolFP  < V.ConstPoolFP; +    case ConstNullVal:  return false; +    default:  assert(0 && "Unknown value type!"); return false; +    } +  }  }; | 

