diff options
Diffstat (limited to 'llvm/lib/Bytecode/Writer/SlotCalculator.h')
-rw-r--r-- | llvm/lib/Bytecode/Writer/SlotCalculator.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/lib/Bytecode/Writer/SlotCalculator.h b/llvm/lib/Bytecode/Writer/SlotCalculator.h index 353a97a1d1a..f44540c4c5e 100644 --- a/llvm/lib/Bytecode/Writer/SlotCalculator.h +++ b/llvm/lib/Bytecode/Writer/SlotCalculator.h @@ -87,7 +87,14 @@ public: return ModuleTypeLevel; } - TypePlane &getPlane(unsigned Plane); + TypePlane &getPlane(unsigned Plane) { + // Okay we are just returning an entry out of the main Table. Make sure the + // plane exists and return it. + if (Plane >= Table.size()) + Table.resize(Plane+1); + return Table[Plane]; + } + TypeList& getTypes() { return Types; } /// incorporateFunction/purgeFunction - If you'd like to deal with a function, |