/Users/buildslave/jenkins/workspace/coverage/llvm-project/clang/lib/Sema/SemaHLSL.cpp
Line | Count | Source |
1 | | //===- SemaHLSL.cpp - Semantic Analysis for HLSL constructs ---------------===// |
2 | | // |
3 | | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
4 | | // See https://llvm.org/LICENSE.txt for license information. |
5 | | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
6 | | // |
7 | | //===----------------------------------------------------------------------===// |
8 | | // This implements Semantic Analysis for HLSL constructs. |
9 | | //===----------------------------------------------------------------------===// |
10 | | |
11 | | #include "clang/Sema/Sema.h" |
12 | | |
13 | | using namespace clang; |
14 | | |
15 | | Decl *Sema::ActOnStartHLSLBuffer(Scope *BufferScope, bool CBuffer, |
16 | | SourceLocation KwLoc, IdentifierInfo *Ident, |
17 | | SourceLocation IdentLoc, |
18 | 39 | SourceLocation LBrace) { |
19 | | // For anonymous namespace, take the location of the left brace. |
20 | 39 | DeclContext *LexicalParent = getCurLexicalContext(); |
21 | 39 | HLSLBufferDecl *Result = HLSLBufferDecl::Create( |
22 | 39 | Context, LexicalParent, CBuffer, KwLoc, Ident, IdentLoc, LBrace); |
23 | | |
24 | 39 | PushOnScopeChains(Result, BufferScope); |
25 | 39 | PushDeclContext(BufferScope, Result); |
26 | | |
27 | 39 | return Result; |
28 | 39 | } |
29 | | |
30 | 39 | void Sema::ActOnFinishHLSLBuffer(Decl *Dcl, SourceLocation RBrace) { |
31 | 39 | auto *BufDecl = cast<HLSLBufferDecl>(Dcl); |
32 | 39 | BufDecl->setRBraceLoc(RBrace); |
33 | 39 | PopDeclContext(); |
34 | 39 | } |