Skip to content
This repository was archived by the owner on Feb 5, 2019. It is now read-only.

Commit 0fac2fc

Browse files
authored
Merge pull request #121 from mati865/gcc8_backport
Backport GCC 8 fixes
2 parents 0368490 + 6755452 commit 0fac2fc

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

cmake/modules/HandleLLVMOptions.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,11 @@ if (LLVM_ENABLE_WARNINGS AND (LLVM_COMPILER_IS_GCC_COMPATIBLE OR CLANG_CL))
579579
append_if(USE_NO_UNINITIALIZED "-Wno-uninitialized" CMAKE_CXX_FLAGS)
580580
append_if(USE_NO_MAYBE_UNINITIALIZED "-Wno-maybe-uninitialized" CMAKE_CXX_FLAGS)
581581

582+
# Disable -Wclass-memaccess, a C++-only warning from GCC 8 that fires on
583+
# LLVM's ADT classes.
584+
check_cxx_compiler_flag("-Wclass-memaccess" CXX_SUPPORTS_CLASS_MEMACCESS_FLAG)
585+
append_if(CXX_SUPPORTS_CLASS_MEMACCESS_FLAG "-Wno-class-memaccess" CMAKE_CXX_FLAGS)
586+
582587
# Check if -Wnon-virtual-dtor warns even though the class is marked final.
583588
# If it does, don't add it. So it won't be added on clang 3.4 and older.
584589
# This also catches cases when -Wnon-virtual-dtor isn't supported by

include/llvm/IR/GlobalValue.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -110,18 +110,12 @@ class GlobalValue : public Constant {
110110
unsigned IsDSOLocal : 1;
111111

112112
private:
113-
friend class Constant;
114-
115-
void maybeSetDsoLocal() {
116-
if (hasLocalLinkage() ||
117-
(!hasDefaultVisibility() && !hasExternalWeakLinkage()))
118-
setDSOLocal(true);
119-
}
120-
121113
// Give subclasses access to what otherwise would be wasted padding.
122114
// (17 + 4 + 2 + 2 + 2 + 3 + 1 + 1) == 32.
123115
unsigned SubClassData : GlobalValueSubClassDataBits;
124116

117+
friend class Constant;
118+
125119
void destroyConstantImpl();
126120
Value *handleOperandChangeImpl(Value *From, Value *To);
127121

@@ -149,6 +143,12 @@ class GlobalValue : public Constant {
149143
llvm_unreachable("Fully covered switch above!");
150144
}
151145

146+
void maybeSetDsoLocal() {
147+
if (hasLocalLinkage() ||
148+
(!hasDefaultVisibility() && !hasExternalWeakLinkage()))
149+
setDSOLocal(true);
150+
}
151+
152152
protected:
153153
/// The intrinsic ID for this subclass (which must be a Function).
154154
///

0 commit comments

Comments
 (0)