1285163Sdim//===-- SlotMapping.h - Slot number mapping for unnamed values --*- C++ -*-===//
2285163Sdim//
3353358Sdim// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4353358Sdim// See https://llvm.org/LICENSE.txt for license information.
5353358Sdim// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6285163Sdim//
7285163Sdim//===----------------------------------------------------------------------===//
8285163Sdim//
9285163Sdim// This file contains the declaration of the SlotMapping struct.
10285163Sdim//
11285163Sdim//===----------------------------------------------------------------------===//
12285163Sdim
13285163Sdim#ifndef LLVM_ASMPARSER_SLOTMAPPING_H
14285163Sdim#define LLVM_ASMPARSER_SLOTMAPPING_H
15285163Sdim
16296417Sdim#include "llvm/ADT/StringMap.h"
17285163Sdim#include "llvm/IR/TrackingMDRef.h"
18285163Sdim#include <map>
19285163Sdim#include <vector>
20285163Sdim
21285163Sdimnamespace llvm {
22285163Sdim
23285163Sdimclass GlobalValue;
24296417Sdimclass Type;
25285163Sdim
26296417Sdim/// This struct contains the mappings from the slot numbers to unnamed metadata
27296417Sdim/// nodes, global values and types. It also contains the mapping for the named
28296417Sdim/// types.
29296417Sdim/// It can be used to save the parsing state of an LLVM IR module so that the
30296417Sdim/// textual references to the values in the module can be parsed outside of the
31296417Sdim/// module's source.
32285163Sdimstruct SlotMapping {
33285163Sdim  std::vector<GlobalValue *> GlobalValues;
34285163Sdim  std::map<unsigned, TrackingMDNodeRef> MetadataNodes;
35296417Sdim  StringMap<Type *> NamedTypes;
36296417Sdim  std::map<unsigned, Type *> Types;
37285163Sdim};
38285163Sdim
39285163Sdim} // end namespace llvm
40285163Sdim
41285163Sdim#endif
42