clang 23.0.0git
HLSLResource.cpp
Go to the documentation of this file.
1//===--- HLSLResource.cpp - Helper routines for HLSL resources -----------===//
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//
9// This file provides shared routines to help analyze HLSL resources and
10// their bindings during Sema and CodeGen.
11//
12//===----------------------------------------------------------------------===//
13
15#include "clang/AST/Decl.h"
16#include "clang/AST/DeclCXX.h"
17#include "clang/AST/Type.h"
18
19using namespace clang;
20
21namespace clang {
22namespace hlsl {
23
25 pushName(N, FieldDelim);
26 Name.append(BaseClassDelim);
27}
28
29void EmbeddedResourceNameBuilder::pushName(llvm::StringRef N,
30 llvm::StringRef Delim) {
31 Offsets.push_back(Name.size());
32 if (!Name.empty() && !Name.ends_with(BaseClassDelim))
33 Name.append(Delim);
34 Name.append(N);
35}
36
38 llvm::raw_svector_ostream OS(Name);
39 Offsets.push_back(Name.size());
40 OS << ArrayIndexDelim;
41 OS << Index;
42}
43
44} // namespace hlsl
45} // namespace clang
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate....
C Language Family Type Representation.
The JSON file list parser is used to communicate input to InstallAPI.