Coverage Report

Created: 2024-01-17 10:31

/src/llvm-project/clang/lib/Sema/SemaHLSL.cpp
Line
Count
Source (jump to first uncovered line)
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
0
                                 SourceLocation LBrace) {
19
  // For anonymous namespace, take the location of the left brace.
20
0
  DeclContext *LexicalParent = getCurLexicalContext();
21
0
  HLSLBufferDecl *Result = HLSLBufferDecl::Create(
22
0
      Context, LexicalParent, CBuffer, KwLoc, Ident, IdentLoc, LBrace);
23
24
0
  PushOnScopeChains(Result, BufferScope);
25
0
  PushDeclContext(BufferScope, Result);
26
27
0
  return Result;
28
0
}
29
30
0
void Sema::ActOnFinishHLSLBuffer(Decl *Dcl, SourceLocation RBrace) {
31
0
  auto *BufDecl = cast<HLSLBufferDecl>(Dcl);
32
0
  BufDecl->setRBraceLoc(RBrace);
33
0
  PopDeclContext();
34
0
}