From 04c9a93fddf330e236c89681152a4ef0b51ad877 Mon Sep 17 00:00:00 2001 From: Thomas Fransham Date: Wed, 14 Aug 2024 16:57:47 +0100 Subject: [PATCH] [LLVM] Fix missing includes for function declarations that will be needed for explicit symbol visibility (#103900) In multiple source files function definitions never sees there declaration in a header because its never included causing linker errors when explicit symbol visibility macros\dllexport are added to the declarations. Most of these were originally found by @tstellar in https://github.com/llvm/llvm-project/pull/67502 TargetRegistry.h is needed in MCExternalSymbolizer.cpp for createMCSymbolizer Analysis/Passes.h is needed in LazyValueInfo.cpp and RegionInfo.cpp for createLazyValueInfoPassin and createRegionInfoPass Transforms/Scalar.h is needed in SpeculativeExecution.cpp for createSpeculativeExecutionPass --- llvm/lib/Analysis/LazyValueInfo.cpp | 1 + llvm/lib/Analysis/RegionInfo.cpp | 1 + llvm/lib/MC/MCDisassembler/MCExternalSymbolizer.cpp | 1 + llvm/lib/Transforms/Scalar/SpeculativeExecution.cpp | 1 + 4 files changed, 4 insertions(+) diff --git a/llvm/lib/Analysis/LazyValueInfo.cpp b/llvm/lib/Analysis/LazyValueInfo.cpp index 310a7eafc815004..47d3dac73083ee4 100644 --- a/llvm/lib/Analysis/LazyValueInfo.cpp +++ b/llvm/lib/Analysis/LazyValueInfo.cpp @@ -17,6 +17,7 @@ #include "llvm/Analysis/AssumptionCache.h" #include "llvm/Analysis/ConstantFolding.h" #include "llvm/Analysis/InstructionSimplify.h" +#include "llvm/Analysis/Passes.h" #include "llvm/Analysis/TargetLibraryInfo.h" #include "llvm/Analysis/ValueLattice.h" #include "llvm/Analysis/ValueTracking.h" diff --git a/llvm/lib/Analysis/RegionInfo.cpp b/llvm/lib/Analysis/RegionInfo.cpp index 9be23a374eca5ae..15257b4a9a926f3 100644 --- a/llvm/lib/Analysis/RegionInfo.cpp +++ b/llvm/lib/Analysis/RegionInfo.cpp @@ -15,6 +15,7 @@ #ifndef NDEBUG #include "llvm/Analysis/RegionPrinter.h" #endif +#include "llvm/Analysis/Passes.h" #include "llvm/Analysis/RegionInfoImpl.h" #include "llvm/Config/llvm-config.h" #include "llvm/IR/Function.h" diff --git a/llvm/lib/MC/MCDisassembler/MCExternalSymbolizer.cpp b/llvm/lib/MC/MCDisassembler/MCExternalSymbolizer.cpp index e3f4cdd21557e28..52cf1ff1376d08b 100644 --- a/llvm/lib/MC/MCDisassembler/MCExternalSymbolizer.cpp +++ b/llvm/lib/MC/MCDisassembler/MCExternalSymbolizer.cpp @@ -10,6 +10,7 @@ #include "llvm/MC/MCContext.h" #include "llvm/MC/MCExpr.h" #include "llvm/MC/MCInst.h" +#include "llvm/MC/TargetRegistry.h" #include "llvm/Support/raw_ostream.h" #include diff --git a/llvm/lib/Transforms/Scalar/SpeculativeExecution.cpp b/llvm/lib/Transforms/Scalar/SpeculativeExecution.cpp index ed9c1828ce06a22..6e1bb892f620185 100644 --- a/llvm/lib/Transforms/Scalar/SpeculativeExecution.cpp +++ b/llvm/lib/Transforms/Scalar/SpeculativeExecution.cpp @@ -71,6 +71,7 @@ #include "llvm/InitializePasses.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" +#include "llvm/Transforms/Scalar.h" using namespace llvm;