[llvm] 76bc1ed - [AA] Take account of C++23's stricter rules for forward declarations (NFC) (#109416)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 20 13:56:43 PDT 2024
Author: Jonathan Tanner
Date: 2024-09-20T22:56:40+02:00
New Revision: 76bc1eddb2cf8b6cc073649ade21b59bbed438a2
URL: https://github.com/llvm/llvm-project/commit/76bc1eddb2cf8b6cc073649ade21b59bbed438a2
DIFF: https://github.com/llvm/llvm-project/commit/76bc1eddb2cf8b6cc073649ade21b59bbed438a2.diff
LOG: [AA] Take account of C++23's stricter rules for forward declarations (NFC) (#109416)
C++23 has stricter rules for forward declarations around
std::unique_ptr, this means that the inline declaration of the
constructor was failing under clang in C++23 mode, switching to an
out-of-line definition of the constructor fixes this.
This was fairly major impact as it blocked inclusion of a lot of headers
under clang in C++23 mode.
Fixes #106597.
Added:
Modified:
llvm/include/llvm/Analysis/AliasAnalysis.h
llvm/lib/Analysis/AliasAnalysis.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/Analysis/AliasAnalysis.h b/llvm/include/llvm/Analysis/AliasAnalysis.h
index 1990172116582b..9c6084d2d9deeb 100644
--- a/llvm/include/llvm/Analysis/AliasAnalysis.h
+++ b/llvm/include/llvm/Analysis/AliasAnalysis.h
@@ -315,7 +315,7 @@ class AAResults {
public:
// Make these results default constructable and movable. We have to spell
// these out because MSVC won't synthesize them.
- AAResults(const TargetLibraryInfo &TLI) : TLI(TLI) {}
+ AAResults(const TargetLibraryInfo &TLI);
AAResults(AAResults &&Arg);
~AAResults();
diff --git a/llvm/lib/Analysis/AliasAnalysis.cpp b/llvm/lib/Analysis/AliasAnalysis.cpp
index 9f529fde55c20f..d90bb213f4208b 100644
--- a/llvm/lib/Analysis/AliasAnalysis.cpp
+++ b/llvm/lib/Analysis/AliasAnalysis.cpp
@@ -73,6 +73,8 @@ static cl::opt<bool> EnableAATrace("aa-trace", cl::Hidden, cl::init(false));
static const bool EnableAATrace = false;
#endif
+AAResults::AAResults(const TargetLibraryInfo &TLI) : TLI(TLI) {}
+
AAResults::AAResults(AAResults &&Arg)
: TLI(Arg.TLI), AAs(std::move(Arg.AAs)), AADeps(std::move(Arg.AADeps)) {}
More information about the llvm-commits
mailing list