mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-12 06:06:32 +00:00
Add operator< to ValID's so that they can be put in map's
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@757 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
b4d22f9952
commit
8c9c586768
@ -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;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user