Skip to content

Commit 1557818

Browse files
authored
Revert "[llvm-(min-)tblgen] Avoid redundant source compilation (#114494)"
This reverts commit f6cb569.
1 parent f6cb569 commit 1557818

12 files changed

+20
-71
lines changed

llvm/utils/TableGen/Basic/CMakeLists.txt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,8 @@ set(LLVM_LINK_COMPONENTS
99
)
1010

1111
add_llvm_library(LLVMTableGenBasic OBJECT EXCLUDE_FROM_ALL DISABLE_LLVM_LINK_LLVM_DYLIB
12-
ARMTargetDefEmitter.cpp
13-
Attributes.cpp
1412
CodeGenIntrinsics.cpp
15-
DirectiveEmitter.cpp
16-
IntrinsicEmitter.cpp
17-
RISCVTargetDefEmitter.cpp
1813
SDNodeProperties.cpp
19-
TableGen.cpp
20-
VTEmitter.cpp
2114
)
2215

2316
# Users may include its headers as "Basic/*.h"

llvm/utils/TableGen/Basic/TableGen.h

Lines changed: 0 additions & 13 deletions
This file was deleted.

llvm/utils/TableGen/CMakeLists.txt

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,20 @@ add_subdirectory(Basic)
55
# code needed by the backends.
66
add_subdirectory(Common)
77

8+
set(LLVM_LINK_COMPONENTS Support)
9+
810
# llvm-min-tablegen only contains a subset of backends necessary to
911
# build llvm/include. It must not depend on TableGenCommon, as
1012
# TableGenCommon depends on this already to generate things such as
1113
# ValueType definitions.
12-
# Sources included in both, llvm-min-tblgen and llvm-tblgen, must be included
13-
# into LLVMTableGenBasic to avoid redundant compilation and problems with build
14-
# caches.
15-
# At least one source file must be included directly to avoid CMake problems.
16-
# E.g. CMake derives which linker to use from the types of sources added.
1714
add_tablegen(llvm-min-tblgen LLVM_HEADERS
18-
llvm-min-tblgen.cpp
15+
TableGen.cpp
16+
ARMTargetDefEmitter.cpp
17+
Attributes.cpp
18+
DirectiveEmitter.cpp
19+
IntrinsicEmitter.cpp
20+
RISCVTargetDefEmitter.cpp
21+
VTEmitter.cpp
1922
$<TARGET_OBJECTS:obj.LLVMTableGenBasic>
2023

2124
PARTIAL_SOURCES_INTENDED
@@ -29,8 +32,10 @@ set(LLVM_LINK_COMPONENTS
2932
add_tablegen(llvm-tblgen LLVM
3033
DESTINATION "${LLVM_TOOLS_INSTALL_DIR}"
3134
EXPORT LLVM
35+
ARMTargetDefEmitter.cpp
3236
AsmMatcherEmitter.cpp
3337
AsmWriterEmitter.cpp
38+
Attributes.cpp
3439
CallingConvEmitter.cpp
3540
CodeEmitterGen.cpp
3641
CodeGenMapTable.cpp
@@ -43,6 +48,7 @@ add_tablegen(llvm-tblgen LLVM
4348
DecoderEmitter.cpp
4449
DFAEmitter.cpp
4550
DFAPacketizerEmitter.cpp
51+
DirectiveEmitter.cpp
4652
DisassemblerEmitter.cpp
4753
DXILEmitter.cpp
4854
ExegesisEmitter.cpp
@@ -51,15 +57,18 @@ add_tablegen(llvm-tblgen LLVM
5157
GlobalISelEmitter.cpp
5258
InstrDocsEmitter.cpp
5359
InstrInfoEmitter.cpp
54-
llvm-tblgen.cpp
60+
IntrinsicEmitter.cpp
5561
MacroFusionPredicatorEmitter.cpp
5662
OptionParserEmitter.cpp
5763
OptionRSTEmitter.cpp
5864
PseudoLoweringEmitter.cpp
5965
RegisterBankEmitter.cpp
6066
RegisterInfoEmitter.cpp
67+
RISCVTargetDefEmitter.cpp
6168
SearchableTableEmitter.cpp
6269
SubtargetEmitter.cpp
70+
TableGen.cpp
71+
VTEmitter.cpp
6372
WebAssemblyDisassemblerEmitter.cpp
6473
X86InstrMappingEmitter.cpp
6574
X86DisassemblerTables.cpp
@@ -70,8 +79,6 @@ add_tablegen(llvm-tblgen LLVM
7079
$<TARGET_OBJECTS:obj.LLVMTableGenBasic>
7180
$<TARGET_OBJECTS:obj.LLVMTableGenCommon>
7281

73-
PARTIAL_SOURCES_INTENDED
74-
7582
DEPENDS
7683
intrinsics_gen # via llvm-min-tablegen
7784
)

llvm/utils/TableGen/Basic/IntrinsicEmitter.cpp renamed to llvm/utils/TableGen/IntrinsicEmitter.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
#include "CodeGenIntrinsics.h"
14-
#include "SequenceToOffsetTable.h"
13+
#include "Basic/CodeGenIntrinsics.h"
14+
#include "Basic/SequenceToOffsetTable.h"
1515
#include "llvm/ADT/STLExtras.h"
1616
#include "llvm/ADT/SmallVector.h"
1717
#include "llvm/ADT/StringRef.h"

llvm/utils/TableGen/Basic/TableGen.cpp renamed to llvm/utils/TableGen/TableGen.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,10 @@
66
//
77
//===----------------------------------------------------------------------===//
88
//
9-
// This file contains the global defintions (mostly command line parameters)
10-
// shared between llvm-tblgen and llvm-min-tblgen.
9+
// This file contains the main function for LLVM's TableGen.
1110
//
1211
//===----------------------------------------------------------------------===//
1312

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

79-
int tblgen_main(int argc, char **argv) {
77+
int main(int argc, char **argv) {
8078
InitLLVM X(argc, argv);
8179
cl::ParseCommandLineOptions(argc, argv);
8280

llvm/utils/TableGen/llvm-min-tblgen.cpp

Lines changed: 0 additions & 18 deletions
This file was deleted.

llvm/utils/TableGen/llvm-tblgen.cpp

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)