[llvm] [llvm] annotate remaining DebugInfo library interfaces for DLL export (PR #145364)
Andrew Rogers via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 23 12:11:08 PDT 2025
https://github.com/andrurogerz updated https://github.com/llvm/llvm-project/pull/145364
>From 75b25b6e9b42ff1b5a1de98d05602b52e9ebe0f5 Mon Sep 17 00:00:00 2001
From: Andrew Rogers <andrurogerz at gmail.com>
Date: Mon, 23 Jun 2025 10:03:15 -0700
Subject: [PATCH 1/3] [llvm] auto-annotate remaining DebugInfo library
interfaces with IDS
---
llvm/include/llvm/DebugInfo/DWARF/DWARFCFIPrinter.h | 3 ++-
llvm/include/llvm/DebugInfo/DWARF/DWARFCFIProgram.h | 4 ++--
llvm/include/llvm/DebugInfo/DWARF/DWARFExpression.h | 6 +++---
.../llvm/DebugInfo/LogicalView/Core/LVSourceLanguage.h | 3 ++-
4 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFCFIPrinter.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFCFIPrinter.h
index 32e8247ac4c22..5e711b9ab35ca 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFCFIPrinter.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFCFIPrinter.h
@@ -9,6 +9,7 @@
#ifndef LLVM_DEBUGINFO_DWARF_DWARFCFIPRINTER_H
#define LLVM_DEBUGINFO_DWARF_DWARFCFIPRINTER_H
+#include "llvm/Support/Compiler.h"
#include "llvm/DebugInfo/DWARF/DWARFCFIProgram.h"
namespace llvm {
@@ -17,7 +18,7 @@ struct DIDumpOptions;
namespace dwarf {
-void printCFIProgram(const CFIProgram &P, raw_ostream &OS,
+LLVM_ABI void printCFIProgram(const CFIProgram &P, raw_ostream &OS,
const DIDumpOptions &DumpOpts, unsigned IndentLevel,
std::optional<uint64_t> Address);
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFCFIProgram.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFCFIProgram.h
index ad7358c28f16b..1d89ac3578c10 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFCFIProgram.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFCFIProgram.h
@@ -106,11 +106,11 @@ class CFIProgram {
};
/// Get the OperandType as a "const char *".
- static const char *operandTypeString(OperandType OT);
+ LLVM_ABI static const char *operandTypeString(OperandType OT);
/// Retrieve the array describing the types of operands according to the enum
/// above. This is indexed by opcode.
- static ArrayRef<OperandType[MaxOperands]> getOperandTypes();
+ LLVM_ABI static ArrayRef<OperandType[MaxOperands]> getOperandTypes();
private:
std::vector<Instruction> Instructions;
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFExpression.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFExpression.h
index 44432d3219111..1b617b13e8a70 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFExpression.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFExpression.h
@@ -186,7 +186,7 @@ class DWARFExpressionPrinter {
/// \param E to be printed
/// \param OS to this stream
/// \param GetNameForDWARFReg callback to return dwarf register name
- static void print(const DWARFExpression *E, raw_ostream &OS,
+ LLVM_ABI static void print(const DWARFExpression *E, raw_ostream &OS,
DIDumpOptions DumpOpts, DWARFUnit *U, bool IsEH = false);
/// Print the expression in a format intended to be compact and useful to a
@@ -199,7 +199,7 @@ class DWARFExpressionPrinter {
/// \param GetNameForDWARFReg callback to return dwarf register name
///
/// \returns true if the expression was successfully printed
- static bool printCompact(const DWARFExpression *E, raw_ostream &OS,
+ LLVM_ABI static bool printCompact(const DWARFExpression *E, raw_ostream &OS,
std::function<StringRef(uint64_t RegNum, bool IsEH)>
GetNameForDWARFReg = nullptr);
@@ -211,7 +211,7 @@ class DWARFExpressionPrinter {
/// \param Operands to the opcode
///
/// returns true if the Op was successfully printed
- static bool prettyPrintRegisterOp(DWARFUnit *U, raw_ostream &OS,
+ LLVM_ABI static bool prettyPrintRegisterOp(DWARFUnit *U, raw_ostream &OS,
DIDumpOptions DumpOpts, uint8_t Opcode,
ArrayRef<uint64_t> Operands);
diff --git a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVSourceLanguage.h b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVSourceLanguage.h
index 52e4aa9701e44..1890a3b39a4b4 100644
--- a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVSourceLanguage.h
+++ b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVSourceLanguage.h
@@ -14,6 +14,7 @@
#ifndef LLVM_DEBUGINFO_LOGICALVIEW_CORE_LVSOURCELANGUAGE_H
#define LLVM_DEBUGINFO_LOGICALVIEW_CORE_LVSOURCELANGUAGE_H
+#include "llvm/Support/Compiler.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/BinaryFormat/Dwarf.h"
#include "llvm/DebugInfo/CodeView/CodeView.h"
@@ -52,7 +53,7 @@ struct LVSourceLanguage {
bool isValid() const { return Language != Invalid; }
TaggedLanguage get() const { return Language; }
- StringRef getName() const;
+ LLVM_ABI StringRef getName() const;
private:
TaggedLanguage Language = Invalid;
>From ca16e05d0db42224463fd27021ae8409fdc614ff Mon Sep 17 00:00:00 2001
From: Andrew Rogers <andrurogerz at gmail.com>
Date: Mon, 23 Jun 2025 12:10:44 -0700
Subject: [PATCH 2/3] [llvm] auto-annotate remaining BinaryFormat library
interfaces with IDS
---
llvm/include/llvm/BinaryFormat/DXContainer.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/llvm/include/llvm/BinaryFormat/DXContainer.h b/llvm/include/llvm/BinaryFormat/DXContainer.h
index 56c9e53308674..45a8a1c5b4358 100644
--- a/llvm/include/llvm/BinaryFormat/DXContainer.h
+++ b/llvm/include/llvm/BinaryFormat/DXContainer.h
@@ -186,7 +186,7 @@ enum class DescriptorRangeType : uint32_t {
#include "DXContainerConstants.def"
};
-ArrayRef<EnumEntry<DescriptorRangeType>> getDescriptorRangeTypes();
+LLVM_ABI ArrayRef<EnumEntry<DescriptorRangeType>> getDescriptorRangeTypes();
#define ROOT_PARAMETER(Val, Enum) \
case Val: \
>From 6609f11321a05891aae0b0bcbdec62462db04135 Mon Sep 17 00:00:00 2001
From: Andrew Rogers <andrurogerz at gmail.com>
Date: Mon, 23 Jun 2025 10:06:23 -0700
Subject: [PATCH 3/3] [llvm] clang-format changes
---
.../llvm/DebugInfo/DWARF/DWARFCFIPrinter.h | 7 ++++---
.../llvm/DebugInfo/DWARF/DWARFExpression.h | 15 +++++++++------
.../DebugInfo/LogicalView/Core/LVSourceLanguage.h | 2 +-
3 files changed, 14 insertions(+), 10 deletions(-)
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFCFIPrinter.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFCFIPrinter.h
index 5e711b9ab35ca..4723f00a4d241 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFCFIPrinter.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFCFIPrinter.h
@@ -9,8 +9,8 @@
#ifndef LLVM_DEBUGINFO_DWARF_DWARFCFIPRINTER_H
#define LLVM_DEBUGINFO_DWARF_DWARFCFIPRINTER_H
-#include "llvm/Support/Compiler.h"
#include "llvm/DebugInfo/DWARF/DWARFCFIProgram.h"
+#include "llvm/Support/Compiler.h"
namespace llvm {
@@ -19,8 +19,9 @@ struct DIDumpOptions;
namespace dwarf {
LLVM_ABI void printCFIProgram(const CFIProgram &P, raw_ostream &OS,
- const DIDumpOptions &DumpOpts, unsigned IndentLevel,
- std::optional<uint64_t> Address);
+ const DIDumpOptions &DumpOpts,
+ unsigned IndentLevel,
+ std::optional<uint64_t> Address);
} // end namespace dwarf
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFExpression.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFExpression.h
index 1b617b13e8a70..ea414278c35d6 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFExpression.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFExpression.h
@@ -187,7 +187,8 @@ class DWARFExpressionPrinter {
/// \param OS to this stream
/// \param GetNameForDWARFReg callback to return dwarf register name
LLVM_ABI static void print(const DWARFExpression *E, raw_ostream &OS,
- DIDumpOptions DumpOpts, DWARFUnit *U, bool IsEH = false);
+ DIDumpOptions DumpOpts, DWARFUnit *U,
+ bool IsEH = false);
/// Print the expression in a format intended to be compact and useful to a
/// user, but not perfectly unambiguous, or capable of representing every
@@ -199,9 +200,10 @@ class DWARFExpressionPrinter {
/// \param GetNameForDWARFReg callback to return dwarf register name
///
/// \returns true if the expression was successfully printed
- LLVM_ABI static bool printCompact(const DWARFExpression *E, raw_ostream &OS,
- std::function<StringRef(uint64_t RegNum, bool IsEH)>
- GetNameForDWARFReg = nullptr);
+ LLVM_ABI static bool printCompact(
+ const DWARFExpression *E, raw_ostream &OS,
+ std::function<StringRef(uint64_t RegNum, bool IsEH)> GetNameForDWARFReg =
+ nullptr);
/// Pretty print a register opcode and operands.
/// \param U within the context of this Dwarf unit, if any.
@@ -212,8 +214,9 @@ class DWARFExpressionPrinter {
///
/// returns true if the Op was successfully printed
LLVM_ABI static bool prettyPrintRegisterOp(DWARFUnit *U, raw_ostream &OS,
- DIDumpOptions DumpOpts, uint8_t Opcode,
- ArrayRef<uint64_t> Operands);
+ DIDumpOptions DumpOpts,
+ uint8_t Opcode,
+ ArrayRef<uint64_t> Operands);
private:
static bool printOp(const DWARFExpression::Operation *Op, raw_ostream &OS,
diff --git a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVSourceLanguage.h b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVSourceLanguage.h
index 1890a3b39a4b4..f4ebfc914ad05 100644
--- a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVSourceLanguage.h
+++ b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVSourceLanguage.h
@@ -14,10 +14,10 @@
#ifndef LLVM_DEBUGINFO_LOGICALVIEW_CORE_LVSOURCELANGUAGE_H
#define LLVM_DEBUGINFO_LOGICALVIEW_CORE_LVSOURCELANGUAGE_H
-#include "llvm/Support/Compiler.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/BinaryFormat/Dwarf.h"
#include "llvm/DebugInfo/CodeView/CodeView.h"
+#include "llvm/Support/Compiler.h"
namespace llvm {
namespace logicalview {
More information about the llvm-commits
mailing list