From c2d31347ea06c768045e7c503ef0188e0e5356de Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Thu, 28 May 2020 14:01:51 -0400 Subject: WIP: ASTBuilder (#1358) * Compiles. * Small tidy up around session/ASTBuilder. * Tests are now passing. * Fix Visual Studio project. * Fix using new X to use builder when protectedness of Ctor is not enough. Substitute->substitute * Add some missing ast nodes created outside of ASTBuilder. * Compile time check that ASTBuilder is making an AST type. * Moced findClasInfo and findSyntaxClass (essentially the same thing) to SharedASTBuilder from Session. --- source/slang/slang-reflection.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source/slang/slang-reflection.cpp') diff --git a/source/slang/slang-reflection.cpp b/source/slang/slang-reflection.cpp index 1316efa5d..23d006b3f 100644 --- a/source/slang/slang-reflection.cpp +++ b/source/slang/slang-reflection.cpp @@ -489,7 +489,10 @@ SLANG_API SlangReflectionUserAttribute* spReflectionType_FindUserAttributeByName if (!type) return 0; if (auto declRefType = as(type)) { - return findUserAttributeByName(declRefType->getSession(), declRefType->declRef.getDecl(), name); + ASTBuilder* astBuilder = declRefType->getASTBuilder(); + auto globalSession = astBuilder->getGlobalSession(); + + return findUserAttributeByName(globalSession, declRefType->declRef.getDecl(), name); } return 0; } -- cgit v1.2.3