From bd23e21c7b84e3b14a373c3b11a19cfb9c6327fa Mon Sep 17 00:00:00 2001 From: Fabroce de Gans Date: Wed, 10 Dec 2025 12:52:50 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=8D=92=20Add=20more=20missing=20`LLVM=5FA?= =?UTF-8?q?BI`=20annotations=20(llvm#168765)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch updates various LLVM headers to properly add the `LLVM_ABI` and `LLVM_ABI_FOR_TEST` annotations ot build LLVM as a DLL on Windows. This effort is tracked in swiftlang/swift#85241. --- llvm/include/llvm/CAS/ActionCache.h | 2 +- .../llvm/CAS/BuiltinUnifiedCASDatabases.h | 1 + llvm/include/llvm/CAS/ObjectStore.h | 3 ++- llvm/lib/Transforms/Vectorize/VPlan.h | 26 +++++++++---------- 4 files changed, 17 insertions(+), 15 deletions(-) diff --git a/llvm/include/llvm/CAS/ActionCache.h b/llvm/include/llvm/CAS/ActionCache.h index 9ebcd6b27dd1a..d2348189cfff5 100644 --- a/llvm/include/llvm/CAS/ActionCache.h +++ b/llvm/include/llvm/CAS/ActionCache.h @@ -33,7 +33,7 @@ class CacheKey { // To do that, ActionCache need to be able to rehash the key into the index, // which then `getOrCompute` method can be used to avoid multiple calls to // has function. - CacheKey(const CASID &ID); + LLVM_ABI CacheKey(const CASID &ID); LLVM_ABI_FOR_TEST CacheKey(const ObjectProxy &Proxy); CacheKey(const ObjectStore &CAS, const ObjectRef &Ref); diff --git a/llvm/include/llvm/CAS/BuiltinUnifiedCASDatabases.h b/llvm/include/llvm/CAS/BuiltinUnifiedCASDatabases.h index aa6db7d056189..780cd88df9f26 100644 --- a/llvm/include/llvm/CAS/BuiltinUnifiedCASDatabases.h +++ b/llvm/include/llvm/CAS/BuiltinUnifiedCASDatabases.h @@ -51,6 +51,7 @@ enum class ValidationResult { /// was invalid but has been cleared, \c Skipped if validation is not needed, /// or an \c Error if validation cannot be performed or if the data is left /// in an invalid state because \p AllowRecovery is false. +LLVM_ABI Expected validateOnDiskUnifiedCASDatabasesIfNeeded( StringRef Path, bool CheckHash, bool AllowRecovery, bool ForceValidation, std::optional LLVMCasBinary); diff --git a/llvm/include/llvm/CAS/ObjectStore.h b/llvm/include/llvm/CAS/ObjectStore.h index 05efa1de7f80b..88367a0ef252e 100644 --- a/llvm/include/llvm/CAS/ObjectStore.h +++ b/llvm/include/llvm/CAS/ObjectStore.h @@ -312,7 +312,8 @@ class ObjectStore { /// Import object from another CAS. This will import the full tree from the /// other CAS. - Expected importObject(ObjectStore &Upstream, ObjectRef Other); + LLVM_ABI Expected importObject(ObjectStore &Upstream, + ObjectRef Other); /// Print the ObjectStore internals for debugging purpose. virtual void print(raw_ostream &) const {} diff --git a/llvm/lib/Transforms/Vectorize/VPlan.h b/llvm/lib/Transforms/Vectorize/VPlan.h index 9684d57676594..56b6b4cc269f7 100644 --- a/llvm/lib/Transforms/Vectorize/VPlan.h +++ b/llvm/lib/Transforms/Vectorize/VPlan.h @@ -850,7 +850,7 @@ class VPIRFlags { #if !defined(NDEBUG) /// Returns true if the set flags are valid for \p Opcode. - bool flagsValidForOpcode(unsigned Opcode) const; + LLVM_ABI_FOR_TEST bool flagsValidForOpcode(unsigned Opcode) const; #endif #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) @@ -1448,11 +1448,11 @@ class VPWidenCastRecipe : public VPRecipeWithIRFlags, public VPIRMetadata { VP_CLASSOF_IMPL(VPDef::VPWidenCastSC) /// Produce widened copies of the cast. - void execute(VPTransformState &State) override; + LLVM_ABI_FOR_TEST void execute(VPTransformState &State) override; /// Return the cost of this VPWidenCastRecipe. - InstructionCost computeCost(ElementCount VF, - VPCostContext &Ctx) const override; + LLVM_ABI_FOR_TEST InstructionCost + computeCost(ElementCount VF, VPCostContext &Ctx) const override; #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) /// Print the recipe. @@ -1521,11 +1521,11 @@ class VPWidenIntrinsicRecipe : public VPRecipeWithIRFlags, public VPIRMetadata { VP_CLASSOF_IMPL(VPDef::VPWidenIntrinsicSC) /// Produce a widened version of the vector intrinsic. - void execute(VPTransformState &State) override; + LLVM_ABI_FOR_TEST void execute(VPTransformState &State) override; /// Return the cost of this vector intrinsic. - InstructionCost computeCost(ElementCount VF, - VPCostContext &Ctx) const override; + LLVM_ABI_FOR_TEST InstructionCost + computeCost(ElementCount VF, VPCostContext &Ctx) const override; /// Return the ID of the intrinsic. Intrinsic::ID getVectorIntrinsicID() const { return VectorIntrinsicID; } @@ -3082,11 +3082,11 @@ struct VPWidenLoadEVLRecipe final : public VPWidenMemoryRecipe, public VPValue { VPValue *getEVL() const { return getOperand(1); } /// Generate the wide load or gather. - void execute(VPTransformState &State) override; + LLVM_ABI_FOR_TEST void execute(VPTransformState &State) override; /// Return the cost of this VPWidenLoadEVLRecipe. - InstructionCost computeCost(ElementCount VF, - VPCostContext &Ctx) const override; + LLVM_ABI_FOR_TEST InstructionCost + computeCost(ElementCount VF, VPCostContext &Ctx) const override; #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) /// Print the recipe. @@ -3166,11 +3166,11 @@ struct VPWidenStoreEVLRecipe final : public VPWidenMemoryRecipe { VPValue *getEVL() const { return getOperand(2); } /// Generate the wide store or scatter. - void execute(VPTransformState &State) override; + LLVM_ABI_FOR_TEST void execute(VPTransformState &State) override; /// Return the cost of this VPWidenStoreEVLRecipe. - InstructionCost computeCost(ElementCount VF, - VPCostContext &Ctx) const override; + LLVM_ABI_FOR_TEST InstructionCost + computeCost(ElementCount VF, VPCostContext &Ctx) const override; #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) /// Print the recipe.