1 //===-- DIERef.cpp ----------------------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #include "DIERef.h"
10 #include "llvm/Support/Format.h"
11 
12 void llvm::format_provider<DIERef>::format(const DIERef &ref, raw_ostream &OS,
13                                            StringRef Style) {
14   if (ref.dwo_num())
15     OS << format_hex_no_prefix(*ref.dwo_num(), 8) << "/";
16   OS << (ref.section() == DIERef::DebugInfo ? "INFO" : "TYPE");
17   OS << "/" << format_hex_no_prefix(ref.die_offset(), 8);
18 }
19