]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/lib/DebugInfo/CodeView/TypeIndex.cpp
Merge llvm, clang, lld, lldb, compiler-rt and libc++ r303571, and update
[FreeBSD/FreeBSD.git] / contrib / llvm / lib / DebugInfo / CodeView / TypeIndex.cpp
1 //===-- TypeIndex.cpp - CodeView type index ---------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #include "llvm/DebugInfo/CodeView/TypeIndex.h"
11
12 #include "llvm/DebugInfo/CodeView/TypeCollection.h"
13 #include "llvm/Support/ScopedPrinter.h"
14
15 using namespace llvm;
16 using namespace llvm::codeview;
17
18 void llvm::codeview::printTypeIndex(ScopedPrinter &Printer, StringRef FieldName,
19                                     TypeIndex TI, TypeCollection &Types) {
20   StringRef TypeName;
21   if (!TI.isNoneType())
22     TypeName = Types.getTypeName(TI);
23   if (!TypeName.empty())
24     Printer.printHex(FieldName, TypeName, TI.getIndex());
25   else
26     Printer.printHex(FieldName, TI.getIndex());
27 }