Skip to content

Commit 8bb3b14

Browse files
committed
[TensorSpec] Avoid JSON.h include (NFC)
Instead forward declare the two classes that are referenced.
1 parent 9048150 commit 8bb3b14

File tree

4 files changed

+9
-2
lines changed

4 files changed

+9
-2
lines changed

llvm/include/llvm/Analysis/TensorSpec.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,17 @@
1313

1414
#include "llvm/ADT/StringMap.h"
1515
#include "llvm/IR/LLVMContext.h"
16-
#include "llvm/Support/JSON.h"
1716

1817
#include <memory>
1918
#include <optional>
2019
#include <vector>
2120

2221
namespace llvm {
22+
namespace json {
23+
class OStream;
24+
class Value;
25+
} // namespace json
26+
2327
/// TensorSpec encapsulates the specification of a tensor: its dimensions, or
2428
/// "shape" (row-major), its type (see TensorSpec::getDataType specializations
2529
/// for supported types), its name and port (see "TensorFlow: Large-Scale

llvm/lib/CodeGen/MLRegAllocEvictAdvisor.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "llvm/Analysis/MLModelRunner.h"
1818
#include "llvm/CodeGen/MachineBasicBlock.h"
1919
#include "llvm/CodeGen/SlotIndexes.h"
20+
#include <map>
2021

2122
using namespace llvm;
2223

llvm/lib/LTO/ThinLTOCodeGenerator.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
#include "llvm/Support/Debug.h"
4646
#include "llvm/Support/Error.h"
4747
#include "llvm/Support/FileSystem.h"
48+
#include "llvm/Support/FormatVariadic.h"
4849
#include "llvm/Support/Path.h"
4950
#include "llvm/Support/SHA1.h"
5051
#include "llvm/Support/SmallVectorMemoryBuffer.h"

llvm/unittests/Analysis/TensorSpecTest.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
//===----------------------------------------------------------------------===//
88

99
#include "llvm/Analysis/TensorSpec.h"
10+
#include "llvm/Support/JSON.h"
1011
#include "llvm/Support/Path.h"
1112
#include "llvm/Support/SourceMgr.h"
1213
#include "llvm/Testing/Support/SupportHelpers.h"
@@ -65,4 +66,4 @@ TEST(TensorSpecTest, PrintValueForDebug) {
6566
EXPECT_EQ(tensorValueToString(reinterpret_cast<const char *>(Values.data()),
6667
TensorSpec::createSpec<int32_t>("name", {2})),
6768
"1,3");
68-
}
69+
}

0 commit comments

Comments
 (0)