LLVM  14.0.0git
DIAFrameData.cpp
Go to the documentation of this file.
1 //===- DIAFrameData.cpp - DIA impl. of IPDBFrameData -------------- 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 
12 
13 using namespace llvm::pdb;
14 
15 DIAFrameData::DIAFrameData(CComPtr<IDiaFrameData> DiaFrameData)
16  : FrameData(DiaFrameData) {}
17 
18 template <typename ArgType>
19 ArgType
20 PrivateGetDIAValue(IDiaFrameData *FrameData,
21  HRESULT (__stdcall IDiaFrameData::*Method)(ArgType *)) {
22  ArgType Value;
23  if (S_OK == (FrameData->*Method)(&Value))
24  return static_cast<ArgType>(Value);
25 
26  return ArgType();
27 }
28 
30  return PrivateGetDIAValue(FrameData, &IDiaFrameData::get_addressOffset);
31 }
32 
34  return PrivateGetDIAValue(FrameData, &IDiaFrameData::get_addressSection);
35 }
36 
38  return PrivateGetDIAValue(FrameData, &IDiaFrameData::get_lengthBlock);
39 }
40 
41 std::string DIAFrameData::getProgram() const {
42  return invokeBstrMethod(*FrameData, &IDiaFrameData::get_program);
43 }
44 
46  return PrivateGetDIAValue(FrameData,
47  &IDiaFrameData::get_relativeVirtualAddress);
48 }
49 
51  return PrivateGetDIAValue(FrameData, &IDiaFrameData::get_virtualAddress);
52 }
invokeBstrMethod
std::string invokeBstrMethod(Obj &Object, HRESULT(__stdcall Obj::*Func)(BSTR *))
Definition: DIAUtils.h:16
PrivateGetDIAValue
ArgType PrivateGetDIAValue(IDiaFrameData *FrameData, HRESULT(__stdcall IDiaFrameData::*Method)(ArgType *))
Definition: DIAFrameData.cpp:20
DIAUtils.h
llvm::pdb::DIAFrameData::getAddressSection
uint32_t getAddressSection() const override
Definition: DIAFrameData.cpp:33
llvm::pdb::DIAFrameData::getProgram
std::string getProgram() const override
Definition: DIAFrameData.cpp:41
llvm::pdb::DIAFrameData::getLengthBlock
uint32_t getLengthBlock() const override
Definition: DIAFrameData.cpp:37
llvm::pdb::DIAFrameData::getAddressOffset
uint32_t getAddressOffset() const override
Definition: DIAFrameData.cpp:29
llvm::pdb
Definition: ConcreteSymbolEnumerator.h:20
uint64_t
llvm::pdb::DIAFrameData::getRelativeVirtualAddress
uint32_t getRelativeVirtualAddress() const override
Definition: DIAFrameData.cpp:45
DIASession.h
llvm::pdb::DIAFrameData::getVirtualAddress
uint64_t getVirtualAddress() const override
Definition: DIAFrameData.cpp:50
uint32_t
DIAFrameData.h
llvm::pdb::DIAFrameData::DIAFrameData
DIAFrameData(CComPtr< IDiaFrameData > DiaFrameData)
Definition: DIAFrameData.cpp:15
llvm::TargetStackID::Value
Value
Definition: TargetFrameLowering.h:27