blob: c85756c43e4792f03d74a093c1a5cac1f43cde46 [file] [log] [blame]
Zachary Turner21473f72015-02-08 00:29:29 +00001//===- PDBSymbolExe.cpp - ---------------------------------------*- C++ -*-===//
2//
Chandler Carruth2946cd72019-01-19 08:50:56 +00003// 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
Zachary Turner21473f72015-02-08 00:29:29 +00006//
7//===----------------------------------------------------------------------===//
8
Zachary Turner52c9f882015-02-14 03:53:56 +00009#include "llvm/DebugInfo/PDB/PDBSymbolExe.h"
10
Zachary Turner9a818ad2015-02-22 22:03:38 +000011#include "llvm/DebugInfo/PDB/PDBSymDumper.h"
Zachary Turnerc883a8c2017-04-12 23:18:21 +000012#include "llvm/DebugInfo/PDB/PDBSymbolTypePointer.h"
Zachary Turner21473f72015-02-08 00:29:29 +000013
Zachary Turner52c9f882015-02-14 03:53:56 +000014#include <utility>
15
Zachary Turner21473f72015-02-08 00:29:29 +000016using namespace llvm;
Zachary Turnerec28fc32016-05-04 20:32:13 +000017using namespace llvm::pdb;
Zachary Turner21473f72015-02-08 00:29:29 +000018
Zachary Turnerb52d08d2015-03-01 06:51:29 +000019void PDBSymbolExe::dump(PDBSymDumper &Dumper) const { Dumper.dump(*this); }
Zachary Turnerc883a8c2017-04-12 23:18:21 +000020
21uint32_t PDBSymbolExe::getPointerByteSize() const {
22 auto Pointer = findOneChild<PDBSymbolTypePointer>();
23 if (Pointer)
24 return Pointer->getLength();
25
26 if (getMachineType() == PDB_Machine::x86)
27 return 4;
28 return 8;
29}