Skip to content

Commit 80bd6ae

Browse files
zahiraamMeinersbur
authored andcommitted
On Windows build, making the /bigobj flag global , instead of passing it per file.
To avoid having this flag be passed in per/file manner, we are instead passing it globally. This fixes this bug: https://bugs.llvm.org/show_bug.cgi?id=46733 Reviewed-by: aaron.ballman, beanz, meinersbur Differential Revision: https://reviews.llvm.org/D84038
1 parent 9cf98d2 commit 80bd6ae

File tree

10 files changed

+4
-52
lines changed

10 files changed

+4
-52
lines changed

clang/lib/ASTMatchers/Dynamic/CMakeLists.txt

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,6 @@ set(LLVM_LINK_COMPONENTS
33
Support
44
)
55

6-
# The registry source file ends up generating a lot of sections for each
7-
# matcher. Each matcher appears to get a vtable and several methods. Each
8-
# method needs .text, .pdata, .xdata, and .debug sections, adding to the
9-
# section multiplier. By default MSVC has a 2^16 limit on the number of
10-
# sections in an object file, and this needs more than that.
11-
if (MSVC)
12-
set_source_files_properties(Registry.cpp PROPERTIES COMPILE_FLAGS /bigobj)
13-
endif()
14-
156
add_clang_library(clangDynamicASTMatchers
167
Diagnostics.cpp
178
Marshallers.cpp

clang/lib/CodeGen/CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,6 @@ set(LLVM_LINK_COMPONENTS
2626
TransformUtils
2727
)
2828

29-
if (MSVC)
30-
set_source_files_properties(CodeGenModule.cpp PROPERTIES COMPILE_FLAGS /bigobj)
31-
endif()
32-
3329
add_clang_library(clangCodeGen
3430
BackendUtil.cpp
3531
CGAtomic.cpp

clang/lib/Sema/CMakeLists.txt

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,6 @@ set(LLVM_LINK_COMPONENTS
33
Support
44
)
55

6-
if (MSVC)
7-
set_source_files_properties(SemaDeclAttr.cpp PROPERTIES COMPILE_FLAGS /bigobj)
8-
set_source_files_properties(SemaExpr.cpp PROPERTIES COMPILE_FLAGS /bigobj)
9-
set_source_files_properties(SemaExprCXX.cpp PROPERTIES COMPILE_FLAGS /bigobj)
10-
set_source_files_properties(SemaTemplate.cpp PROPERTIES COMPILE_FLAGS /bigobj)
11-
set_source_files_properties(SemaTemplateDeduction.cpp PROPERTIES COMPILE_FLAGS /bigobj)
12-
set_source_files_properties(SemaOpenMP.cpp PROPERTIES COMPILE_FLAGS /bigobj)
13-
endif()
14-
156
clang_tablegen(OpenCLBuiltins.inc -gen-clang-opencl-builtins
167
SOURCE OpenCLBuiltins.td
178
TARGET ClangOpenCLBuiltinsImpl

clang/unittests/AST/CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ set(LLVM_LINK_COMPONENTS
33
Support
44
)
55

6-
if (MSVC)
7-
set_source_files_properties(ASTImporterTest.cpp PROPERTIES COMPILE_FLAGS /bigobj)
8-
endif()
96

107
add_clang_unittest(ASTTests
118
ASTContextParentMapTest.cpp

clang/unittests/ASTMatchers/CMakeLists.txt

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,6 @@ set(LLVM_LINK_COMPONENTS
33
Support
44
)
55

6-
# By default MSVC has a 2^16 limit on the number of sections in an object file,
7-
# and this needs more than that.
8-
if (MSVC)
9-
set_source_files_properties(InternalASTMatchersTest.cpp PROPERTIES COMPILE_FLAGS /bigobj)
10-
set_source_files_properties(NodeMatchersTest.cpp PROPERTIES COMPILE_FLAGS /bigobj)
11-
set_source_files_properties(NarrowingMatchersTest.cpp PROPERTIES COMPILE_FLAGS /bigobj)
12-
set_source_files_properties(ASTTraversalMatchersTest.cpp PROPERTIES COMPILE_FLAGS /bigobj)
13-
endif()
14-
156
add_clang_unittest(ASTMatchersTests
167
ASTMatchersInternalTest.cpp
178
ASTMatchersNodeTest.cpp

clang/unittests/Tooling/CMakeLists.txt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,6 @@ set(LLVM_LINK_COMPONENTS
44
Support
55
)
66

7-
# By default MSVC has a 2^16 limit on the number of sections in an object file,
8-
# and this needs more than that.
9-
if (MSVC)
10-
set_source_files_properties(RecursiveASTVisitorTest.cpp PROPERTIES COMPILE_FLAGS /bigobj)
11-
set_source_files_properties(RecursiveASTVisitorTestExprVisitor.cpp PROPERTIES COMPILE_FLAGS /bigobj)
12-
set_source_files_properties(RecursiveASTVisitorTests/Callbacks.cpp PROPERTIES COMPILE_FLAGS /bigobj)
13-
set_source_files_properties(SourceCodeTest.cpp PROPERTIES COMPILE_FLAGS /bigobj)
14-
endif()
157

168
add_clang_unittest(ToolingTests
179
ASTSelectionTest.cpp

lldb/source/API/CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,6 @@ if(PYTHON_RPATH)
126126
set_property(TARGET liblldb APPEND PROPERTY BUILD_RPATH "${PYTHON_RPATH}")
127127
endif()
128128

129-
if (MSVC)
130-
set_source_files_properties(SBReproducer.cpp PROPERTIES COMPILE_FLAGS /bigobj)
131-
endif()
132129

133130
if(lldb_python_wrapper)
134131
add_dependencies(liblldb swig_wrapper)

llvm/cmake/modules/HandleLLVMOptions.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,10 @@ if( MSVC )
473473
endif()
474474
endif()
475475
endif()
476+
# By default MSVC has a 2^16 limit on the number of sections in an object file,
477+
# but in many objects files need more than that. This flag is to increase the
478+
# number of sections.
479+
append("/bigobj" CMAKE_CXX_FLAGS)
476480
endif( MSVC )
477481

478482
# Warnings-as-errors handling for GCC-compatible compilers:

llvm/lib/Passes/CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
if (MSVC)
2-
set_source_files_properties(PassBuilder.cpp PROPERTIES COMPILE_FLAGS /bigobj)
3-
endif()
4-
51
add_llvm_component_library(LLVMPasses
62
PassBuilder.cpp
73
PassPlugin.cpp

mlir/lib/Dialect/SPIRV/CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
if (MSVC)
2-
set_source_files_properties(SPIRVDialect.cpp PROPERTIES COMPILE_FLAGS /bigobj)
3-
endif()
41

52
set(LLVM_TARGET_DEFINITIONS SPIRVCanonicalization.td)
63
mlir_tablegen(SPIRVCanonicalization.inc -gen-rewriters)

0 commit comments

Comments
 (0)