Skip to content

Commit

Permalink
Revert "[llvm-(min-)tblgen] Avoid redundant source compilation (llvm#…
Browse files Browse the repository at this point in the history
…114494)"

This reverts commit f6cb569.

Buildbot failures such as https://lab.llvm.org/buildbot/#/builders/89/builds/13541:
```
/usr/bin/ld: utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/ARMTargetDefEmitter.cpp.o: undefined reference to symbol '_ZN4llvm23EnableABIBreakingChecksE'
/usr/bin/ld: /home/tcwg-buildbot/worker/flang-aarch64-libcxx/build/./lib/libLLVMSupport.so.20.0git: error adding symbols: DSO missing from command line
```

Going to investigate.
  • Loading branch information
Meinersbur committed Jan 2, 2025
1 parent f6cb569 commit 06b6161
Show file tree
Hide file tree
Showing 12 changed files with 20 additions and 71 deletions.
File renamed without changes.
File renamed without changes.
7 changes: 0 additions & 7 deletions llvm/utils/TableGen/Basic/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,8 @@ set(LLVM_LINK_COMPONENTS
)

add_llvm_library(LLVMTableGenBasic OBJECT EXCLUDE_FROM_ALL DISABLE_LLVM_LINK_LLVM_DYLIB
ARMTargetDefEmitter.cpp
Attributes.cpp
CodeGenIntrinsics.cpp
DirectiveEmitter.cpp
IntrinsicEmitter.cpp
RISCVTargetDefEmitter.cpp
SDNodeProperties.cpp
TableGen.cpp
VTEmitter.cpp
)

# Users may include its headers as "Basic/*.h"
Expand Down
13 changes: 0 additions & 13 deletions llvm/utils/TableGen/Basic/TableGen.h

This file was deleted.

25 changes: 16 additions & 9 deletions llvm/utils/TableGen/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,20 @@ add_subdirectory(Basic)
# code needed by the backends.
add_subdirectory(Common)

set(LLVM_LINK_COMPONENTS Support)

# llvm-min-tablegen only contains a subset of backends necessary to
# build llvm/include. It must not depend on TableGenCommon, as
# TableGenCommon depends on this already to generate things such as
# ValueType definitions.
# Sources included in both, llvm-min-tblgen and llvm-tblgen, must be included
# into LLVMTableGenBasic to avoid redundant compilation and problems with build
# caches.
# At least one source file must be included directly to avoid CMake problems.
# E.g. CMake derives which linker to use from the types of sources added.
add_tablegen(llvm-min-tblgen LLVM_HEADERS
llvm-min-tblgen.cpp
TableGen.cpp
ARMTargetDefEmitter.cpp
Attributes.cpp
DirectiveEmitter.cpp
IntrinsicEmitter.cpp
RISCVTargetDefEmitter.cpp
VTEmitter.cpp
$<TARGET_OBJECTS:obj.LLVMTableGenBasic>

PARTIAL_SOURCES_INTENDED
Expand All @@ -29,8 +32,10 @@ set(LLVM_LINK_COMPONENTS
add_tablegen(llvm-tblgen LLVM
DESTINATION "${LLVM_TOOLS_INSTALL_DIR}"
EXPORT LLVM
ARMTargetDefEmitter.cpp
AsmMatcherEmitter.cpp
AsmWriterEmitter.cpp
Attributes.cpp
CallingConvEmitter.cpp
CodeEmitterGen.cpp
CodeGenMapTable.cpp
Expand All @@ -43,6 +48,7 @@ add_tablegen(llvm-tblgen LLVM
DecoderEmitter.cpp
DFAEmitter.cpp
DFAPacketizerEmitter.cpp
DirectiveEmitter.cpp
DisassemblerEmitter.cpp
DXILEmitter.cpp
ExegesisEmitter.cpp
Expand All @@ -51,15 +57,18 @@ add_tablegen(llvm-tblgen LLVM
GlobalISelEmitter.cpp
InstrDocsEmitter.cpp
InstrInfoEmitter.cpp
llvm-tblgen.cpp
IntrinsicEmitter.cpp
MacroFusionPredicatorEmitter.cpp
OptionParserEmitter.cpp
OptionRSTEmitter.cpp
PseudoLoweringEmitter.cpp
RegisterBankEmitter.cpp
RegisterInfoEmitter.cpp
RISCVTargetDefEmitter.cpp
SearchableTableEmitter.cpp
SubtargetEmitter.cpp
TableGen.cpp
VTEmitter.cpp
WebAssemblyDisassemblerEmitter.cpp
X86InstrMappingEmitter.cpp
X86DisassemblerTables.cpp
Expand All @@ -70,8 +79,6 @@ add_tablegen(llvm-tblgen LLVM
$<TARGET_OBJECTS:obj.LLVMTableGenBasic>
$<TARGET_OBJECTS:obj.LLVMTableGenCommon>

PARTIAL_SOURCES_INTENDED

DEPENDS
intrinsics_gen # via llvm-min-tablegen
)
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
//
//===----------------------------------------------------------------------===//

#include "CodeGenIntrinsics.h"
#include "SequenceToOffsetTable.h"
#include "Basic/CodeGenIntrinsics.h"
#include "Basic/SequenceToOffsetTable.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@
//
//===----------------------------------------------------------------------===//
//
// This file contains the global defintions (mostly command line parameters)
// shared between llvm-tblgen and llvm-min-tblgen.
// This file contains the main function for LLVM's TableGen.
//
//===----------------------------------------------------------------------===//

#include "TableGen.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/InitLLVM.h"
Expand Down Expand Up @@ -76,7 +74,7 @@ static TableGen::Emitter::Opt X[] = {
{"print-sets", printSets, "Print expanded sets for testing DAG exprs"},
};

int tblgen_main(int argc, char **argv) {
int main(int argc, char **argv) {
InitLLVM X(argc, argv);
cl::ParseCommandLineOptions(argc, argv);

Expand Down
File renamed without changes.
18 changes: 0 additions & 18 deletions llvm/utils/TableGen/llvm-min-tblgen.cpp

This file was deleted.

18 changes: 0 additions & 18 deletions llvm/utils/TableGen/llvm-tblgen.cpp

This file was deleted.

0 comments on commit 06b6161

Please sign in to comment.