[llvm] 0903d99 - [NFC][ObjectSizeOffset] Add template stuff for Visual Studio
Bill Wendling via llvm-commits
llvm-commits at lists.llvm.org
Sun Jan 7 03:39:46 PST 2024
Author: Bill Wendling
Date: 2024-01-07T03:39:18-08:00
New Revision: 0903d992cc961281a0bffc8704796f27f8c2e696
URL: https://github.com/llvm/llvm-project/commit/0903d992cc961281a0bffc8704796f27f8c2e696
DIFF: https://github.com/llvm/llvm-project/commit/0903d992cc961281a0bffc8704796f27f8c2e696.diff
LOG: [NFC][ObjectSizeOffset] Add template stuff for Visual Studio
Visual Studio needs the class template stuff.
C:\llvm\include\llvm/Analysis/MemoryBuiltins.h(217): error C2990: 'llvm::SizeOffsetType': non-class template has already been declared as a class template
C:\llvm\include\llvm/Analysis/MemoryBuiltins.h(193): note: see declaration of 'llvm::SizeOffsetType'
Added:
Modified:
llvm/include/llvm/Analysis/MemoryBuiltins.h
Removed:
################################################################################
diff --git a/llvm/include/llvm/Analysis/MemoryBuiltins.h b/llvm/include/llvm/Analysis/MemoryBuiltins.h
index d080a5956a4d8b..7df0b041926884 100644
--- a/llvm/include/llvm/Analysis/MemoryBuiltins.h
+++ b/llvm/include/llvm/Analysis/MemoryBuiltins.h
@@ -214,7 +214,7 @@ template <typename T, class C> class SizeOffsetType {
/// SizeOffsetAPInt - Used by \p ObjectSizeOffsetVisitor, which works with
/// \p APInts.
class SizeOffsetAPInt : public SizeOffsetType<APInt, SizeOffsetAPInt> {
- friend class SizeOffsetType;
+ template <typename T, class C> friend class SizeOffsetType;
static bool known(APInt V) { return V.getBitWidth() > 1; }
public:
@@ -276,7 +276,7 @@ class ObjectSizeOffsetVisitor
/// \p Values.
class SizeOffsetWeakTrackingVH;
class SizeOffsetValue : public SizeOffsetType<Value *, SizeOffsetValue> {
- friend class SizeOffsetType;
+ template <typename T, class C> friend class SizeOffsetType;
static bool known(Value *V) { return V != nullptr; }
public:
@@ -289,7 +289,7 @@ class SizeOffsetValue : public SizeOffsetType<Value *, SizeOffsetValue> {
/// \p DenseMap.
class SizeOffsetWeakTrackingVH
: public SizeOffsetType<WeakTrackingVH, SizeOffsetWeakTrackingVH> {
- friend class SizeOffsetType;
+ template <typename T, class C> friend class SizeOffsetType;
static bool known(WeakTrackingVH V) { return V.pointsToAliveValue(); }
public:
More information about the llvm-commits
mailing list