DIERef.cpp revision 355940
1239281Sgonzo//===-- DIERef.cpp ----------------------------------------------*- C++ -*-===//
2239281Sgonzo//
3239281Sgonzo// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4239281Sgonzo// See https://llvm.org/LICENSE.txt for license information.
5239281Sgonzo// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6239281Sgonzo//
7239281Sgonzo//===----------------------------------------------------------------------===//
8239281Sgonzo
9239281Sgonzo#include "DIERef.h"
10239281Sgonzo#include "llvm/Support/Format.h"
11239281Sgonzo
12239281Sgonzovoid llvm::format_provider<DIERef>::format(const DIERef &ref, raw_ostream &OS,
13239281Sgonzo                                           StringRef Style) {
14239281Sgonzo  if (ref.dwo_num())
15239281Sgonzo    OS << format_hex_no_prefix(*ref.dwo_num(), 8) << "/";
16239281Sgonzo  OS << (ref.section() == DIERef::DebugInfo ? "INFO" : "TYPE");
17239281Sgonzo  OS << "/" << format_hex_no_prefix(ref.die_offset(), 8);
18239281Sgonzo}
19239281Sgonzo