1//===- ELF AttributeParser.h - ELF Attribute Parser -------------*- 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#ifndef LLVM_SUPPORT_ELFATTRIBUTEPARSER_H
10#define LLVM_SUPPORT_ELFATTRIBUTEPARSER_H
11
12#include "llvm/ADT/ArrayRef.h"
13#include "llvm/ADT/StringRef.h"
14#include "llvm/Support/Error.h"
15
16namespace llvm {
17
18class ELFAttributeParser {
19public:
20 virtual ~ELFAttributeParser() {}
21
22 virtual Error parse(ArrayRef<uint8_t> Section, llvm::endianness Endian) {
23 return llvm::Error::success();
24 }
25 virtual std::optional<unsigned>
26 getAttributeValue(StringRef BuildAttrSubsectionName, unsigned Tag) const {
27 return std::nullopt;
28 }
29 virtual std::optional<unsigned> getAttributeValue(unsigned Tag) const {
30 return std::nullopt;
31 }
32 virtual std::optional<StringRef>
33 getAttributeString(StringRef BuildAttrSubsectionName, unsigned Tag) const {
34 return std::nullopt;
35 }
36 virtual std::optional<StringRef> getAttributeString(unsigned Tag) const {
37 return std::nullopt;
38 }
39};
40
41} // namespace llvm
42#endif // LLVM_SUPPORT_ELFATTRIBUTEPARSER_H
43

Provided by KDAB

Privacy Policy
Update your C++ knowledge – Modern C++11/14/17 Training
Find out more

source code of llvm/include/llvm/Support/ELFAttributeParser.h