19#include "llvm/ADT/DenseSet.h"
20#include "llvm/ADT/STLExtras.h"
21#include "llvm/ADT/SmallString.h"
22#include "llvm/ADT/StringRef.h"
23#include "llvm/Bitstream/BitCodes.h"
24#include "llvm/Bitstream/BitstreamReader.h"
25#include "llvm/Support/FileSystem.h"
26#include "llvm/Support/raw_ostream.h"
34class AbbreviationMap {
35 llvm::DenseMap<unsigned, unsigned> Abbrevs;
39 void set(
unsigned recordID,
unsigned abbrevID) {
40 assert(!Abbrevs.contains(recordID) &&
"Abbreviation already set.");
41 Abbrevs[recordID] = abbrevID;
44 unsigned get(
unsigned recordID) {
45 assert(Abbrevs.contains(recordID) &&
"Abbreviation not set.");
46 return Abbrevs[recordID];
59 SDiagsRenderer(SDiagsWriter &Writer,
const LangOptions &LangOpts,
63 ~SDiagsRenderer()
override {}
87typedef llvm::DenseMap<unsigned, unsigned> AbbrevLookup;
91 AbbrevLookup FileLookup;
92 AbbrevLookup CategoryLookup;
93 AbbrevLookup DiagFlagLookup;
96 SDiagsMerger(SDiagsWriter &Writer) : Writer(Writer) {}
98 std::error_code mergeRecordsFromFile(
const char *
File) {