LLVM: include/llvm/AsmParser/NumberedValues.h Source File (original) (raw)
Go to the documentation of this file.
1
2
3
4
5
6
7
8
9#ifndef LLVM_ASMPARSER_NUMBEREDVALUES_H
10#define LLVM_ASMPARSER_NUMBEREDVALUES_H
11
13
14namespace llvm {
15
16
17
20 unsigned NextUnusedID = 0;
21
22public:
23 unsigned getNext() const { return NextUnusedID; }
24 T get(unsigned ID) const { return Vals.lookup(ID); }
26 assert(ID >= NextUnusedID && "Invalid value ID");
27 Vals.insert({ID, V});
28 NextUnusedID = ID + 1;
29 }
30};
31
32}
33
34#endif
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This file defines the DenseMap class.
Mapping from value ID to value, which also remembers what the next unused ID is.
Definition NumberedValues.h:18
T get(unsigned ID) const
Definition NumberedValues.h:24
unsigned getNext() const
Definition NumberedValues.h:23
void add(unsigned ID, T V)
Definition NumberedValues.h:25
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
This is an optimization pass for GlobalISel generic memory operations.