summaryrefslogtreecommitdiffstats
path: root/gnu/llvm/lib/DebugInfo/PDB/PDBSymbolFunc.cpp
diff options
context:
space:
mode:
authorpatrick <patrick@openbsd.org>2020-08-03 15:06:44 +0000
committerpatrick <patrick@openbsd.org>2020-08-03 15:06:44 +0000
commitb64793999546ed8adebaeebd9d8345d18db8927d (patch)
tree4357c27b561d73b0e089727c6ed659f2ceff5f47 /gnu/llvm/lib/DebugInfo/PDB/PDBSymbolFunc.cpp
parentAdd support for UTF-8 DISPLAY-HINTs with octet length. For now only (diff)
downloadwireguard-openbsd-b64793999546ed8adebaeebd9d8345d18db8927d.tar.xz
wireguard-openbsd-b64793999546ed8adebaeebd9d8345d18db8927d.zip
Remove LLVM 8.0.1 files.
Diffstat (limited to 'gnu/llvm/lib/DebugInfo/PDB/PDBSymbolFunc.cpp')
-rw-r--r--gnu/llvm/lib/DebugInfo/PDB/PDBSymbolFunc.cpp112
1 files changed, 0 insertions, 112 deletions
diff --git a/gnu/llvm/lib/DebugInfo/PDB/PDBSymbolFunc.cpp b/gnu/llvm/lib/DebugInfo/PDB/PDBSymbolFunc.cpp
deleted file mode 100644
index 75063cb3e7f..00000000000
--- a/gnu/llvm/lib/DebugInfo/PDB/PDBSymbolFunc.cpp
+++ /dev/null
@@ -1,112 +0,0 @@
-//===- PDBSymbolFunc.cpp - --------------------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/DebugInfo/PDB/PDBSymbolFunc.h"
-
-#include "llvm/DebugInfo/PDB/ConcreteSymbolEnumerator.h"
-#include "llvm/DebugInfo/PDB/IPDBEnumChildren.h"
-#include "llvm/DebugInfo/PDB/IPDBSession.h"
-#include "llvm/DebugInfo/PDB/PDBSymDumper.h"
-#include "llvm/DebugInfo/PDB/PDBSymbolData.h"
-#include "llvm/DebugInfo/PDB/PDBSymbolTypeFunctionSig.h"
-#include "llvm/DebugInfo/PDB/PDBTypes.h"
-
-#include <unordered_set>
-#include <utility>
-#include <vector>
-
-using namespace llvm;
-using namespace llvm::pdb;
-
-namespace {
-class FunctionArgEnumerator : public IPDBEnumChildren<PDBSymbolData> {
-public:
- typedef ConcreteSymbolEnumerator<PDBSymbolData> ArgEnumeratorType;
-
- FunctionArgEnumerator(const IPDBSession &PDBSession,
- const PDBSymbolFunc &PDBFunc)
- : Session(PDBSession), Func(PDBFunc) {
- // Arguments can appear multiple times if they have live range
- // information, so we only take the first occurrence.
- std::unordered_set<std::string> SeenNames;
- auto DataChildren = Func.findAllChildren<PDBSymbolData>();
- while (auto Child = DataChildren->getNext()) {
- if (Child->getDataKind() == PDB_DataKind::Param) {
- std::string Name = Child->getName();
- if (SeenNames.find(Name) != SeenNames.end())
- continue;
- Args.push_back(std::move(Child));
- SeenNames.insert(Name);
- }
- }
- reset();
- }
-
- uint32_t getChildCount() const override { return Args.size(); }
-
- std::unique_ptr<PDBSymbolData>
- getChildAtIndex(uint32_t Index) const override {
- if (Index >= Args.size())
- return nullptr;
-
- return Session.getConcreteSymbolById<PDBSymbolData>(
- Args[Index]->getSymIndexId());
- }
-
- std::unique_ptr<PDBSymbolData> getNext() override {
- if (CurIter == Args.end())
- return nullptr;
- const auto &Result = **CurIter;
- ++CurIter;
- return Session.getConcreteSymbolById<PDBSymbolData>(Result.getSymIndexId());
- }
-
- void reset() override { CurIter = Args.empty() ? Args.end() : Args.begin(); }
-
-private:
- typedef std::vector<std::unique_ptr<PDBSymbolData>> ArgListType;
- const IPDBSession &Session;
- const PDBSymbolFunc &Func;
- ArgListType Args;
- ArgListType::const_iterator CurIter;
-};
-}
-
-std::unique_ptr<IPDBEnumChildren<PDBSymbolData>>
-PDBSymbolFunc::getArguments() const {
- return llvm::make_unique<FunctionArgEnumerator>(Session, *this);
-}
-
-void PDBSymbolFunc::dump(PDBSymDumper &Dumper) const { Dumper.dump(*this); }
-
-bool PDBSymbolFunc::isDestructor() const {
- std::string Name = getName();
- if (Name.empty())
- return false;
- if (Name[0] == '~')
- return true;
- if (Name == "__vecDelDtor")
- return true;
- return false;
-}
-
-std::unique_ptr<IPDBEnumLineNumbers> PDBSymbolFunc::getLineNumbers() const {
- auto Len = RawSymbol->getLength();
- return Session.findLineNumbersByAddress(RawSymbol->getVirtualAddress(),
- Len ? Len : 1);
-}
-
-uint32_t PDBSymbolFunc::getCompilandId() const {
- if (auto Lines = getLineNumbers()) {
- if (auto FirstLine = Lines->getNext()) {
- return FirstLine->getCompilandId();
- }
- }
- return 0;
-}