Skip to content

Commit 113ad43

Browse files
nikicAlexisPerry
authored andcommitted
[HLSLResource] Don't include Metadata.h (NFC)
This is only used for a single assert, so move it out of line. This avoids a dependency on Metadata.h from large parts of clang.
1 parent b58a62c commit 113ad43

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

llvm/include/llvm/Frontend/HLSL/HLSLResource.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
#ifndef LLVM_FRONTEND_HLSL_HLSLRESOURCE_H
1414
#define LLVM_FRONTEND_HLSL_HLSLRESOURCE_H
1515

16-
#include "llvm/IR/Metadata.h"
1716
#include "llvm/Support/DXILABI.h"
1817

1918
namespace llvm {
2019
class GlobalVariable;
20+
class MDNode;
2121

2222
namespace hlsl {
2323

@@ -38,10 +38,7 @@ class FrontendResource {
3838
MDNode *Entry;
3939

4040
public:
41-
FrontendResource(MDNode *E) : Entry(E) {
42-
assert(Entry->getNumOperands() == 6 && "Unexpected metadata shape");
43-
}
44-
41+
FrontendResource(MDNode *E);
4542
FrontendResource(GlobalVariable *GV, ResourceKind RK, ElementType ElTy,
4643
bool IsROV, uint32_t ResIndex, uint32_t Space);
4744

llvm/lib/Frontend/HLSL/HLSLResource.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ uint32_t FrontendResource::getSpace() {
5151
->getLimitedValue();
5252
}
5353

54+
FrontendResource::FrontendResource(MDNode *E) : Entry(E) {
55+
assert(Entry->getNumOperands() == 6 && "Unexpected metadata shape");
56+
}
57+
5458
FrontendResource::FrontendResource(GlobalVariable *GV, ResourceKind RK,
5559
ElementType ElTy, bool IsROV,
5660
uint32_t ResIndex, uint32_t Space) {

0 commit comments

Comments
 (0)