-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[llvm] annotate remaining ExecutionEngine, Frontend, and TargetParser interfaces for DLL export #145367
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
d4a5a51
to
1a3b766
Compare
1bccb32
to
2150cb0
Compare
@llvm/pr-subscribers-hlsl Author: Andrew Rogers (andrurogerz) ChangesPurposeThis patch is one in a series of code-mods that annotate LLVM’s public interface for export. This patch annotates the remaining LLVM ExecutionEngine, Frontend, and TargetParser interfaces that were missed in, or modified since, previous patches. The annotations currently have no meaningful impact on the LLVM build; however, they are a prerequisite to support an LLVM Windows DLL (shared library) build. BackgroundThis effort is tracked in #109483. Additional context is provided in this discourse, and documentation for OverviewThese changes were generated automatically using the Interface Definition Scanner (IDS) tool, followed formatting with ValidationLocal builds and tests to validate cross-platform compatibility. This included llvm, clang, and lldb on the following configurations:
Full diff: https://github.com/llvm/llvm-project/pull/145367.diff 5 Files Affected:
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/COFF.h b/llvm/include/llvm/ExecutionEngine/Orc/COFF.h
index adc9e9e171165..42a6c85a577fa 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/COFF.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/COFF.h
@@ -13,6 +13,7 @@
#ifndef LLVM_EXECUTIONENGINE_ORC_COFF_H
#define LLVM_EXECUTIONENGINE_ORC_COFF_H
+#include "llvm/Support/Compiler.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/MemoryBuffer.h"
@@ -31,8 +32,8 @@ class COFFImportFileScanner {
public:
COFFImportFileScanner(std::set<std::string> &ImportedDynamicLibraries)
: ImportedDynamicLibraries(ImportedDynamicLibraries) {}
- Expected<bool> operator()(object::Archive &A, MemoryBufferRef MemberBuf,
- size_t Index) const;
+ LLVM_ABI Expected<bool>
+ operator()(object::Archive &A, MemoryBufferRef MemberBuf, size_t Index) const;
private:
std::set<std::string> &ImportedDynamicLibraries;
diff --git a/llvm/include/llvm/Frontend/Directive/Spelling.h b/llvm/include/llvm/Frontend/Directive/Spelling.h
index a101489603254..a13e26e88823d 100644
--- a/llvm/include/llvm/Frontend/Directive/Spelling.h
+++ b/llvm/include/llvm/Frontend/Directive/Spelling.h
@@ -10,6 +10,7 @@
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/iterator_range.h"
+#include "llvm/Support/Compiler.h"
#include <limits>
#include <tuple>
@@ -33,7 +34,8 @@ struct Spelling {
VersionRange Versions;
};
-StringRef FindName(llvm::iterator_range<const Spelling *>, unsigned Version);
+LLVM_ABI StringRef FindName(llvm::iterator_range<const Spelling *>,
+ unsigned Version);
} // namespace llvm::directive
diff --git a/llvm/include/llvm/Frontend/Driver/CodeGenOptions.h b/llvm/include/llvm/Frontend/Driver/CodeGenOptions.h
index f0168c0407884..17ba28b6de443 100644
--- a/llvm/include/llvm/Frontend/Driver/CodeGenOptions.h
+++ b/llvm/include/llvm/Frontend/Driver/CodeGenOptions.h
@@ -63,7 +63,7 @@ enum ProfileInstrKind {
};
// Default filename used for profile generation.
-std::string getDefaultProfileGenName();
+LLVM_ABI std::string getDefaultProfileGenName();
} // end namespace llvm::driver
#endif
diff --git a/llvm/include/llvm/Frontend/HLSL/HLSLRootSignatureUtils.h b/llvm/include/llvm/Frontend/HLSL/HLSLRootSignatureUtils.h
index 4769fd0559965..2f78173f9348d 100644
--- a/llvm/include/llvm/Frontend/HLSL/HLSLRootSignatureUtils.h
+++ b/llvm/include/llvm/Frontend/HLSL/HLSLRootSignatureUtils.h
@@ -97,13 +97,14 @@ class ResourceRange {
// Returns a reference to the first RangeInfo that overlaps with
// [Info.LowerBound;Info.UpperBound], or, std::nullopt if there is no overlap
- std::optional<const RangeInfo *> getOverlapping(const RangeInfo &Info) const;
+ LLVM_ABI std::optional<const RangeInfo *>
+ getOverlapping(const RangeInfo &Info) const;
// Return the mapped RangeInfo at X or nullptr if no mapping exists
- const RangeInfo *lookup(uint32_t X) const;
+ LLVM_ABI const RangeInfo *lookup(uint32_t X) const;
// Removes all entries of the ResourceRange
- void clear();
+ LLVM_ABI void clear();
// Insert the required (sub-)intervals such that the interval of [a;b] =
// [Info.LowerBound, Info.UpperBound] is covered and points to a valid
@@ -131,7 +132,7 @@ class ResourceRange {
// Returns a reference to the first RangeInfo that overlaps with
// [Info.LowerBound;Info.UpperBound], or, std::nullopt if there is no overlap
// (equivalent to getOverlapping)
- std::optional<const RangeInfo *> insert(const RangeInfo &Info);
+ LLVM_ABI std::optional<const RangeInfo *> insert(const RangeInfo &Info);
};
} // namespace rootsig
diff --git a/llvm/include/llvm/TargetParser/TargetParser.h b/llvm/include/llvm/TargetParser/TargetParser.h
index 2ea7829d668a4..9b8d1f3c31121 100644
--- a/llvm/include/llvm/TargetParser/TargetParser.h
+++ b/llvm/include/llvm/TargetParser/TargetParser.h
@@ -214,7 +214,7 @@ struct BasicSubtargetSubTypeKV {
}
};
-std::optional<llvm::StringMap<bool>>
+LLVM_ABI std::optional<llvm::StringMap<bool>>
getCPUDefaultTargetFeatures(StringRef CPU,
ArrayRef<BasicSubtargetSubTypeKV> ProcDesc,
ArrayRef<BasicSubtargetFeatureKV> ProcFeatures);
|
@compnerd, @vgvassilev one more quick one, thanks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm!
Purpose
This patch is one in a series of code-mods that annotate LLVM’s public interface for export. This patch annotates the remaining LLVM ExecutionEngine, Frontend, and TargetParser interfaces that were missed in, or modified since, previous patches. The annotations currently have no meaningful impact on the LLVM build; however, they are a prerequisite to support an LLVM Windows DLL (shared library) build.
Background
This effort is tracked in #109483. Additional context is provided in this discourse, and documentation for
LLVM_ABI
and related annotations is found in the LLVM repo here.Overview
These changes were generated automatically using the Interface Definition Scanner (IDS) tool, followed formatting with
git clang-format
.Validation
Local builds and tests to validate cross-platform compatibility. This included llvm, clang, and lldb on the following configurations: