summarylogtreecommitdiffstats
path: root/clang_11.patch
blob: 922aaf9f0738486871b0373a885fb7ebd879b433 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
diff --git a/Engine/Source/Editor/UnrealEd/Public/Layers/LayersSubsystem.h b/Engine/Source/Editor/UnrealEd/Public/Layers/LayersSubsystem.h
index 7fbded01fbb..80e507524f7 100644
--- a/Engine/Source/Editor/UnrealEd/Public/Layers/LayersSubsystem.h
+++ b/Engine/Source/Editor/UnrealEd/Public/Layers/LayersSubsystem.h
@@ -41,7 +41,7 @@ namespace ELayersAction
 }
 
 UCLASS()
-class UNREALED_API ULayersSubsystem : public UEditorSubsystem
+class UNREALED_API ULayersSubsystem final : public UEditorSubsystem
 {
 	GENERATED_BODY()
 
diff --git a/Engine/Source/Programs/UnrealBuildTool/Platform/Linux/LinuxToolChain.cs b/Engine/Source/Programs/UnrealBuildTool/Platform/Linux/LinuxToolChain.cs
index 1f856d789be..b4ffbeb2950 100644
--- a/Engine/Source/Programs/UnrealBuildTool/Platform/Linux/LinuxToolChain.cs
+++ b/Engine/Source/Programs/UnrealBuildTool/Platform/Linux/LinuxToolChain.cs
@@ -592,6 +592,12 @@ namespace UnrealBuildTool
 			}
 
 			Result += " -Wall -Werror";
+			
+			if(CompilerVersionGreaterOrEqual(11,0,0))
+			{
+				//instantiate templates once and reuse at compilation. Approximately 30% faster compile times
+				Result += " -fpch-instantiate-templates";
+			}
 
 			if (!CompileEnvironment.Architecture.StartsWith("x86_64") && !CompileEnvironment.Architecture.StartsWith("i686"))
 			{
diff --git a/Engine/Source/Runtime/Core/Public/GenericPlatform/GenericPlatformCriticalSection.h b/Engine/Source/Runtime/Core/Public/GenericPlatform/GenericPlatformCriticalSection.h
index 82dbd7f0c21..639a7cdcca7 100644
--- a/Engine/Source/Runtime/Core/Public/GenericPlatform/GenericPlatformCriticalSection.h
+++ b/Engine/Source/Runtime/Core/Public/GenericPlatform/GenericPlatformCriticalSection.h
@@ -39,6 +39,7 @@ template<class CriticalSection>
 class TGenericPlatformRWLock
 {
 public:
+	
 	FORCEINLINE TGenericPlatformRWLock()
 	{
 	}
diff --git a/Engine/Source/Runtime/Core/Public/HAL/PThreadCriticalSection.h b/Engine/Source/Runtime/Core/Public/HAL/PThreadCriticalSection.h
index ff9c2e10bb5..3f547f1ea0b 100644
--- a/Engine/Source/Runtime/Core/Public/HAL/PThreadCriticalSection.h
+++ b/Engine/Source/Runtime/Core/Public/HAL/PThreadCriticalSection.h
@@ -66,6 +66,11 @@ public:
 	{
 		pthread_mutex_unlock(&Mutex);
 	}
+	
+	FORCEINLINE pthread_mutex_t GetMutex() const
+	{
+		return this->Mutex;
+	}
 
 private:
 	FPThreadsCriticalSection(const FPThreadsCriticalSection&);
diff --git a/Engine/Source/Runtime/Core/Public/UObject/WeakObjectPtrTemplates.h b/Engine/Source/Runtime/Core/Public/UObject/WeakObjectPtrTemplates.h
index f2d367b57bd..771c337a209 100644
--- a/Engine/Source/Runtime/Core/Public/UObject/WeakObjectPtrTemplates.h
+++ b/Engine/Source/Runtime/Core/Public/UObject/WeakObjectPtrTemplates.h
@@ -382,4 +382,4 @@ void CopyFromWeakArray(DestArrayType& Dest, const SourceArrayType& Src)
 			Dest.Add(Value);
 		}
 	}
-}
\ No newline at end of file
+}
diff --git a/Engine/Source/Runtime/Foliage/Private/ProceduralFoliageSpawner.cpp b/Engine/Source/Runtime/Foliage/Private/ProceduralFoliageSpawner.cpp
index d6ffcf228cf..04e2ef2a316 100644
--- a/Engine/Source/Runtime/Foliage/Private/ProceduralFoliageSpawner.cpp
+++ b/Engine/Source/Runtime/Foliage/Private/ProceduralFoliageSpawner.cpp
@@ -80,7 +80,7 @@ const UProceduralFoliageTile* UProceduralFoliageSpawner::GetRandomTile(int32 X,
 		HashStream.Initialize(Y);
 		const double YRand = HashStream.FRand();
 		
-		const int32 RandomNumber = (RAND_MAX * XRand / (YRand + 0.01));
+		const int32 RandomNumber = (static_cast<double>(RAND_MAX) * XRand / (YRand + 0.01));
 		const int32 Idx = FMath::Clamp(RandomNumber % PrecomputedTiles.Num(), 0, PrecomputedTiles.Num() - 1);
 		return PrecomputedTiles[Idx].Get();
 	}
diff --git a/Engine/Source/ThirdParty/FBX/2020.1.1/include/fbxsdk/scene/geometry/fbxlayer.h b/Engine/Source/ThirdParty/FBX/2020.1.1/include/fbxsdk/scene/geometry/fbxlayer.h
index 42d703fb8a8..1619c09c79b 100644
--- a/Engine/Source/ThirdParty/FBX/2020.1.1/include/fbxsdk/scene/geometry/fbxlayer.h
+++ b/Engine/Source/ThirdParty/FBX/2020.1.1/include/fbxsdk/scene/geometry/fbxlayer.h
@@ -461,7 +461,7 @@ public:
       *	                                 deleted when the pointer is released or the object is destroyed. At the moment of 
       *                                  release or destruction, the values in this buffer are copied back into this object.
 	  */
-	template <class T> inline T* GetLocked(T*, ELockMode pLockMode=eReadWriteLock) {T v; return (T*)GetLocked(pLockMode, FbxTypeOf(v)); }
+	template <class T> inline T* GetLocked(T*, ELockMode pLockMode=eReadWriteLock) {T v = T(); return (T*)GetLocked(pLockMode, FbxTypeOf(v)); }
 
 	/** Unlock the data buffer.
 	  * \param pDataPtr                  The buffer to be released.