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

Backport GCC 8 fixes #121

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions cmake/modules/HandleLLVMOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,11 @@ if (LLVM_ENABLE_WARNINGS AND (LLVM_COMPILER_IS_GCC_COMPATIBLE OR CLANG_CL))
append_if(USE_NO_UNINITIALIZED "-Wno-uninitialized" CMAKE_CXX_FLAGS)
append_if(USE_NO_MAYBE_UNINITIALIZED "-Wno-maybe-uninitialized" CMAKE_CXX_FLAGS)

# Disable -Wclass-memaccess, a C++-only warning from GCC 8 that fires on
# LLVM's ADT classes.
check_cxx_compiler_flag("-Wclass-memaccess" CXX_SUPPORTS_CLASS_MEMACCESS_FLAG)
append_if(CXX_SUPPORTS_CLASS_MEMACCESS_FLAG "-Wno-class-memaccess" CMAKE_CXX_FLAGS)

# Check if -Wnon-virtual-dtor warns even though the class is marked final.
# If it does, don't add it. So it won't be added on clang 3.4 and older.
# This also catches cases when -Wnon-virtual-dtor isn't supported by
Expand Down
16 changes: 8 additions & 8 deletions include/llvm/IR/GlobalValue.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,18 +110,12 @@ class GlobalValue : public Constant {
unsigned IsDSOLocal : 1;

private:
friend class Constant;

void maybeSetDsoLocal() {
if (hasLocalLinkage() ||
(!hasDefaultVisibility() && !hasExternalWeakLinkage()))
setDSOLocal(true);
}

// Give subclasses access to what otherwise would be wasted padding.
// (17 + 4 + 2 + 2 + 2 + 3 + 1 + 1) == 32.
unsigned SubClassData : GlobalValueSubClassDataBits;

friend class Constant;

void destroyConstantImpl();
Value *handleOperandChangeImpl(Value *From, Value *To);

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

void maybeSetDsoLocal() {
if (hasLocalLinkage() ||
(!hasDefaultVisibility() && !hasExternalWeakLinkage()))
setDSOLocal(true);
}

protected:
/// The intrinsic ID for this subclass (which must be a Function).
///
Expand Down