clang 17.0.0git
Go to the documentation of this file.
1//===- SemaHLSL.cpp - Semantic Analysis for HLSL constructs ---------------===//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
8// This implements Semantic Analysis for HLSL constructs.
11#include "clang/Sema/Sema.h"
13using namespace clang;
15Decl *Sema::ActOnStartHLSLBuffer(Scope *BufferScope, bool CBuffer,
16 SourceLocation KwLoc, IdentifierInfo *Ident,
17 SourceLocation IdentLoc,
18 SourceLocation LBrace) {
19 // For anonymous namespace, take the location of the left brace.
20 DeclContext *LexicalParent = getCurLexicalContext();
22 Context, LexicalParent, CBuffer, KwLoc, Ident, IdentLoc, LBrace);
24 PushOnScopeChains(Result, BufferScope);
25 PushDeclContext(BufferScope, Result);
27 return Result;
31 auto *BufDecl = cast<HLSLBufferDecl>(Dcl);
32 BufDecl->setRBraceLoc(RBrace);
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
Definition: DeclBase.h:1393
Decl - This represents one declaration (or definition), e.g.
Definition: DeclBase.h:83
HLSLBufferDecl - Represent a cbuffer or tbuffer declaration.
Definition: Decl.h:4780
static HLSLBufferDecl * Create(ASTContext &C, DeclContext *LexicalParent, bool CBuffer, SourceLocation KwLoc, IdentifierInfo *ID, SourceLocation IDLoc, SourceLocation LBrace)
Definition: Decl.cpp:5325
One of these records is kept for each identifier that is lexed.
Scope - A scope is a transient data structure that is used while parsing the program.
Definition: Scope.h:41
ASTContext & Context
Definition: Sema.h:407
void PushOnScopeChains(NamedDecl *D, Scope *S, bool AddToContext=true)
Add this decl to the scope shadowed decl chains.
Definition: SemaDecl.cpp:1537
Decl * ActOnStartHLSLBuffer(Scope *BufferScope, bool CBuffer, SourceLocation KwLoc, IdentifierInfo *Ident, SourceLocation IdentLoc, SourceLocation LBrace)
Definition: SemaHLSL.cpp:15
DeclContext * getCurLexicalContext() const
Definition: Sema.h:13801
void ActOnFinishHLSLBuffer(Decl *Dcl, SourceLocation RBrace)
Definition: SemaHLSL.cpp:30
void PushDeclContext(Scope *S, DeclContext *DC)
Set the current declaration context until it gets popped.
Definition: SemaDecl.cpp:1344
void PopDeclContext()
Definition: SemaDecl.cpp:1351
Encodes a location in the source.
@ Result
The result type of a method or function.