Skip to content

Commit 02e9ebd

Browse files
committed
move wrapper definition to SemaHLSL
- this struct needs to be accessible to both `Sema` and `Parse` and since `Parse` depends on `Sema` then we need to have it be included from there, so as to not introduce a circular dependency
1 parent 67eb653 commit 02e9ebd

File tree

3 files changed

+18
-18
lines changed

3 files changed

+18
-18
lines changed

clang/include/clang/Parse/ParseHLSLRootSignature.h

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "clang/Basic/DiagnosticParse.h"
1818
#include "clang/Lex/LexHLSLRootSignature.h"
1919
#include "clang/Lex/Preprocessor.h"
20+
#include "clang/Sema/SemaHLSL.h"
2021

2122
#include "llvm/ADT/SmallVector.h"
2223
#include "llvm/ADT/StringRef.h"
@@ -26,21 +27,6 @@
2627
namespace clang {
2728
namespace hlsl {
2829

29-
// Introduce a wrapper struct around the underlying RootElement. This structure
30-
// will retain extra clang diagnostic information that is not available in llvm.
31-
struct RootSignatureElement {
32-
RootSignatureElement(SourceLocation Loc,
33-
llvm::hlsl::rootsig::RootElement Element)
34-
: Loc(Loc), Element(Element) {}
35-
36-
const llvm::hlsl::rootsig::RootElement &getElement() const { return Element; }
37-
const SourceLocation &getLocation() const { return Loc; }
38-
39-
private:
40-
SourceLocation Loc;
41-
llvm::hlsl::rootsig::RootElement Element;
42-
};
43-
4430
class RootSignatureParser {
4531
public:
4632
RootSignatureParser(llvm::dxbc::RootSignatureVersion Version,

clang/include/clang/Sema/SemaHLSL.h

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,23 @@ class Scope;
3333
class VarDecl;
3434

3535
namespace hlsl {
36-
struct RootSignatureElement;
37-
}
36+
37+
// Introduce a wrapper struct around the underlying RootElement. This structure
38+
// will retain extra clang diagnostic information that is not available in llvm.
39+
struct RootSignatureElement {
40+
RootSignatureElement(SourceLocation Loc,
41+
llvm::hlsl::rootsig::RootElement Element)
42+
: Loc(Loc), Element(Element) {}
43+
44+
const llvm::hlsl::rootsig::RootElement &getElement() const { return Element; }
45+
const SourceLocation &getLocation() const { return Loc; }
46+
47+
private:
48+
SourceLocation Loc;
49+
llvm::hlsl::rootsig::RootElement Element;
50+
};
51+
52+
} // namespace hlsl
3853

3954
using llvm::dxil::ResourceClass;
4055

clang/lib/Sema/SemaHLSL.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
#include "clang/Basic/SourceLocation.h"
2929
#include "clang/Basic/Specifiers.h"
3030
#include "clang/Basic/TargetInfo.h"
31-
#include "clang/Parse/ParseHLSLRootSignature.h"
3231
#include "clang/Sema/Initialization.h"
3332
#include "clang/Sema/Lookup.h"
3433
#include "clang/Sema/ParsedAttr.h"

0 commit comments

Comments
 (0)