clang 23.0.0git
CGHLSLRuntime.h
Go to the documentation of this file.
1//===----- CGHLSLRuntime.h - Interface to HLSL Runtimes -----*- C++ -*-===//
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 provides an abstract class for HLSL code generation. Concrete
10// subclasses of this implement code generation for specific HLSL
11// runtime libraries.
12//
13//===----------------------------------------------------------------------===//
14
15#ifndef LLVM_CLANG_LIB_CODEGEN_CGHLSLRUNTIME_H
16#define LLVM_CLANG_LIB_CODEGEN_CGHLSLRUNTIME_H
17
18#include "Address.h"
19#include "clang/AST/Attr.h"
20#include "clang/AST/Decl.h"
23#include "llvm/ADT/DenseMap.h"
24#include "llvm/ADT/SmallVector.h"
25#include "llvm/ADT/StringRef.h"
26#include "llvm/Frontend/HLSL/HLSLResource.h"
27#include "llvm/IR/IRBuilder.h"
28#include "llvm/IR/Intrinsics.h"
29#include "llvm/IR/IntrinsicsDirectX.h"
30#include "llvm/IR/IntrinsicsSPIRV.h"
31
32#include <optional>
33#include <vector>
34
35// A function generator macro for picking the right intrinsic
36// for the target backend
37#define GENERATE_HLSL_INTRINSIC_FUNCTION(FunctionName, IntrinsicPostfix) \
38 llvm::Intrinsic::ID get##FunctionName##Intrinsic() { \
39 llvm::Triple::ArchType Arch = getArch(); \
40 switch (Arch) { \
41 case llvm::Triple::dxil: \
42 return llvm::Intrinsic::dx_##IntrinsicPostfix; \
43 case llvm::Triple::spirv: \
44 return llvm::Intrinsic::spv_##IntrinsicPostfix; \
45 default: \
46 llvm_unreachable("Intrinsic " #IntrinsicPostfix \
47 " not supported by target architecture"); \
48 } \
49 }
50
51using ResourceClass = llvm::dxil::ResourceClass;
52
53namespace llvm {
54class GlobalVariable;
55class Function;
56class StructType;
57class Metadata;
58} // namespace llvm
59
60namespace clang {
61class NamedDecl;
62class VarDecl;
63class ParmVarDecl;
64class InitListExpr;
65class HLSLBufferDecl;
67class HLSLVkBindingAttr;
68class HLSLResourceBindingAttr;
69class Type;
70class RecordType;
71class DeclContext;
72class HLSLPackOffsetAttr;
74
75class FunctionDecl;
76
77namespace CodeGen {
78
79class CodeGenModule;
80class CodeGenFunction;
81class LValue;
82
85
86public:
87 static const uint32_t Unspecified = ~0U;
88
89 /// Iterates over all declarations in the HLSL buffer and based on the
90 /// packoffset or register(c#) annotations it fills outs the Offsets vector
91 /// with the user-specified layout offsets. The buffer offsets can be
92 /// specified 2 ways: 1. declarations in cbuffer {} block can have a
93 /// packoffset annotation (translates to HLSLPackOffsetAttr) 2. default
94 /// constant buffer declarations at global scope can have register(c#)
95 /// annotations (translates to HLSLResourceBindingAttr with RegisterType::C)
96 /// It is not guaranteed that all declarations in a buffer have an annotation.
97 /// For those where it is not specified a `~0U` value is added to the Offsets
98 /// vector. In the final layout these declarations will be placed at the end
99 /// of the HLSL buffer after all of the elements with specified offset.
100 static CGHLSLOffsetInfo fromDecl(const HLSLBufferDecl &BufDecl);
101
102 /// Comparison function for offsets received from `operator[]` suitable for
103 /// use in a `stable_sort`. This will order implicit bindings after explicit
104 /// offsets.
105 static bool compareOffsets(uint32_t LHS, uint32_t RHS) { return LHS < RHS; }
106
107 /// Get the given offset, or `~0U` if there is no offset for the member.
108 uint32_t operator[](size_t I) const {
109 if (Offsets.empty())
110 return Unspecified;
111 return Offsets[I];
112 }
113
114 bool empty() const { return Offsets.empty(); }
115};
116
118public:
119 //===----------------------------------------------------------------------===//
120 // Start of reserved area for HLSL intrinsic getters.
121 //===----------------------------------------------------------------------===//
122
128 GENERATE_HLSL_INTRINSIC_FUNCTION(FlattenedThreadIdInGroup,
129 flattened_thread_id_in_group)
135 GENERATE_HLSL_INTRINSIC_FUNCTION(Saturate, saturate)
139 GENERATE_HLSL_INTRINSIC_FUNCTION(ThreadId, thread_id)
140 GENERATE_HLSL_INTRINSIC_FUNCTION(GroupThreadId, thread_id_in_group)
141 GENERATE_HLSL_INTRINSIC_FUNCTION(GroupId, group_id)
145 GENERATE_HLSL_INTRINSIC_FUNCTION(Dot4AddI8Packed, dot4add_i8packed)
146 GENERATE_HLSL_INTRINSIC_FUNCTION(Dot4AddU8Packed, dot4add_u8packed)
147 GENERATE_HLSL_INTRINSIC_FUNCTION(WaveActiveAllEqual, wave_all_equal)
148 GENERATE_HLSL_INTRINSIC_FUNCTION(WaveActiveAllTrue, wave_all)
149 GENERATE_HLSL_INTRINSIC_FUNCTION(WaveActiveAnyTrue, wave_any)
150 GENERATE_HLSL_INTRINSIC_FUNCTION(WaveActiveBitOr, wave_reduce_or)
151 GENERATE_HLSL_INTRINSIC_FUNCTION(WaveActiveBitXor, wave_reduce_xor)
152 GENERATE_HLSL_INTRINSIC_FUNCTION(WaveActiveBitAnd, wave_reduce_and)
153 GENERATE_HLSL_INTRINSIC_FUNCTION(WaveActiveMax, wave_reduce_max)
154 GENERATE_HLSL_INTRINSIC_FUNCTION(WaveActiveUMax, wave_reduce_umax)
155 GENERATE_HLSL_INTRINSIC_FUNCTION(WaveActiveMin, wave_reduce_min)
156 GENERATE_HLSL_INTRINSIC_FUNCTION(WaveActiveUMin, wave_reduce_umin)
157 GENERATE_HLSL_INTRINSIC_FUNCTION(WaveActiveCountBits, wave_active_countbits)
158 GENERATE_HLSL_INTRINSIC_FUNCTION(WaveIsFirstLane, wave_is_first_lane)
159 GENERATE_HLSL_INTRINSIC_FUNCTION(WaveGetLaneCount, wave_get_lane_count)
160 GENERATE_HLSL_INTRINSIC_FUNCTION(WaveReadLaneAt, wave_readlane)
161 GENERATE_HLSL_INTRINSIC_FUNCTION(QuadReadAcrossX, quad_read_across_x)
162 GENERATE_HLSL_INTRINSIC_FUNCTION(QuadReadAcrossY, quad_read_across_y)
163 GENERATE_HLSL_INTRINSIC_FUNCTION(FirstBitUHigh, firstbituhigh)
164 GENERATE_HLSL_INTRINSIC_FUNCTION(FirstBitSHigh, firstbitshigh)
165 GENERATE_HLSL_INTRINSIC_FUNCTION(FirstBitLow, firstbitlow)
169
170 GENERATE_HLSL_INTRINSIC_FUNCTION(CreateResourceGetBasePointer,
171 resource_getbasepointer)
172 GENERATE_HLSL_INTRINSIC_FUNCTION(CreateResourceGetPointer,
173 resource_getpointer)
175 GENERATE_HLSL_INTRINSIC_FUNCTION(SampleClamp, resource_sample_clamp)
176 GENERATE_HLSL_INTRINSIC_FUNCTION(SampleBias, resource_samplebias)
177 GENERATE_HLSL_INTRINSIC_FUNCTION(SampleBiasClamp, resource_samplebias_clamp)
178 GENERATE_HLSL_INTRINSIC_FUNCTION(SampleGrad, resource_samplegrad)
179 GENERATE_HLSL_INTRINSIC_FUNCTION(SampleGradClamp, resource_samplegrad_clamp)
180 GENERATE_HLSL_INTRINSIC_FUNCTION(SampleLevel, resource_samplelevel)
181 GENERATE_HLSL_INTRINSIC_FUNCTION(SampleCmp, resource_samplecmp)
182 GENERATE_HLSL_INTRINSIC_FUNCTION(SampleCmpClamp, resource_samplecmp_clamp)
183 GENERATE_HLSL_INTRINSIC_FUNCTION(SampleCmpLevelZero,
184 resource_samplecmplevelzero)
185 GENERATE_HLSL_INTRINSIC_FUNCTION(Gather, resource_gather)
186 GENERATE_HLSL_INTRINSIC_FUNCTION(GatherCmp, resource_gather_cmp)
187 GENERATE_HLSL_INTRINSIC_FUNCTION(CreateHandleFromBinding,
188 resource_handlefrombinding)
189 GENERATE_HLSL_INTRINSIC_FUNCTION(CreateHandleFromImplicitBinding,
190 resource_handlefromimplicitbinding)
191 GENERATE_HLSL_INTRINSIC_FUNCTION(NonUniformResourceIndex,
192 resource_nonuniformindex)
193 GENERATE_HLSL_INTRINSIC_FUNCTION(BufferUpdateCounter, resource_updatecounter)
194 GENERATE_HLSL_INTRINSIC_FUNCTION(AllMemoryBarrier, all_memory_barrier)
195 GENERATE_HLSL_INTRINSIC_FUNCTION(AllMemoryBarrierWithGroupSync,
196 all_memory_barrier_with_group_sync)
197 GENERATE_HLSL_INTRINSIC_FUNCTION(DeviceMemoryBarrier, device_memory_barrier)
198 GENERATE_HLSL_INTRINSIC_FUNCTION(DeviceMemoryBarrierWithGroupSync,
199 device_memory_barrier_with_group_sync)
200 GENERATE_HLSL_INTRINSIC_FUNCTION(GroupMemoryBarrier, group_memory_barrier)
201 GENERATE_HLSL_INTRINSIC_FUNCTION(GroupMemoryBarrierWithGroupSync,
202 group_memory_barrier_with_group_sync)
203 GENERATE_HLSL_INTRINSIC_FUNCTION(GetDimensionsX, resource_getdimensions_x)
204 GENERATE_HLSL_INTRINSIC_FUNCTION(GetDimensionsXY, resource_getdimensions_xy)
205 GENERATE_HLSL_INTRINSIC_FUNCTION(GetDimensionsLevelsXY,
206 resource_getdimensions_levels_xy)
207 GENERATE_HLSL_INTRINSIC_FUNCTION(LoadLevel, resource_load_level)
208 GENERATE_HLSL_INTRINSIC_FUNCTION(CalculateLod, resource_calculate_lod)
209 GENERATE_HLSL_INTRINSIC_FUNCTION(CalculateLodUnclamped,
210 resource_calculate_lod_unclamped)
211 GENERATE_HLSL_INTRINSIC_FUNCTION(DdxCoarse, ddx_coarse)
212 GENERATE_HLSL_INTRINSIC_FUNCTION(DdyCoarse, ddy_coarse)
213 GENERATE_HLSL_INTRINSIC_FUNCTION(DdxFine, ddx_fine)
214 GENERATE_HLSL_INTRINSIC_FUNCTION(DdyFine, ddy_fine)
215
216 //===----------------------------------------------------------------------===//
217 // End of reserved area for HLSL intrinsic getters.
218 //===----------------------------------------------------------------------===//
219
220protected:
222
223 llvm::Value *emitSystemSemanticLoad(llvm::IRBuilder<> &B,
224 const FunctionDecl *FD, llvm::Type *Type,
225 const clang::DeclaratorDecl *Decl,
226 HLSLAppliedSemanticAttr *Semantic,
227 std::optional<unsigned> Index);
228
229 void emitSystemSemanticStore(llvm::IRBuilder<> &B, llvm::Value *Source,
230 const clang::DeclaratorDecl *Decl,
231 HLSLAppliedSemanticAttr *Semantic,
232 std::optional<unsigned> Index);
233
234 llvm::Value *handleScalarSemanticLoad(llvm::IRBuilder<> &B,
235 const FunctionDecl *FD,
236 llvm::Type *Type,
237 const clang::DeclaratorDecl *Decl,
238 HLSLAppliedSemanticAttr *Semantic);
239
240 void handleScalarSemanticStore(llvm::IRBuilder<> &B, const FunctionDecl *FD,
241 llvm::Value *Source,
242 const clang::DeclaratorDecl *Decl,
243 HLSLAppliedSemanticAttr *Semantic);
244
245 std::pair<llvm::Value *, specific_attr_iterator<HLSLAppliedSemanticAttr>>
247 llvm::IRBuilder<> &B, const FunctionDecl *FD, llvm::Type *Type,
248 const clang::DeclaratorDecl *Decl,
249 specific_attr_iterator<HLSLAppliedSemanticAttr> begin,
250 specific_attr_iterator<HLSLAppliedSemanticAttr> end);
251
252 specific_attr_iterator<HLSLAppliedSemanticAttr> handleStructSemanticStore(
253 llvm::IRBuilder<> &B, const FunctionDecl *FD, llvm::Value *Source,
254 const clang::DeclaratorDecl *Decl,
255 specific_attr_iterator<HLSLAppliedSemanticAttr> AttrBegin,
256 specific_attr_iterator<HLSLAppliedSemanticAttr> AttrEnd);
257
258 std::pair<llvm::Value *, specific_attr_iterator<HLSLAppliedSemanticAttr>>
259 handleSemanticLoad(llvm::IRBuilder<> &B, const FunctionDecl *FD,
261 specific_attr_iterator<HLSLAppliedSemanticAttr> begin,
262 specific_attr_iterator<HLSLAppliedSemanticAttr> end);
263
264 specific_attr_iterator<HLSLAppliedSemanticAttr>
265 handleSemanticStore(llvm::IRBuilder<> &B, const FunctionDecl *FD,
266 llvm::Value *Source, const clang::DeclaratorDecl *Decl,
267 specific_attr_iterator<HLSLAppliedSemanticAttr> AttrBegin,
268 specific_attr_iterator<HLSLAppliedSemanticAttr> AttrEnd);
269
270public:
272 virtual ~CGHLSLRuntime() {}
273
274 llvm::Type *convertHLSLSpecificType(const Type *T,
275 const CGHLSLOffsetInfo &OffsetInfo);
276 llvm::Type *convertHLSLSpecificType(const Type *T) {
278 }
279
281
282 void addBuffer(const HLSLBufferDecl *D);
284 void finishCodeGen();
285
286 void setHLSLEntryAttributes(const FunctionDecl *FD, llvm::Function *Fn);
287
288 void emitEntryFunction(const FunctionDecl *FD, llvm::Function *Fn);
289 void setHLSLFunctionAttributes(const FunctionDecl *FD, llvm::Function *Fn);
290 void handleGlobalVarDefinition(const VarDecl *VD, llvm::GlobalVariable *Var);
291
292 llvm::Instruction *getConvergenceToken(llvm::BasicBlock &BB);
293
294 llvm::StructType *getHLSLBufferLayoutType(const RecordType *LayoutStructTy);
295 void addHLSLBufferLayoutType(const RecordType *LayoutStructTy,
296 llvm::StructType *LayoutTy);
298
299 std::optional<LValue>
301 CodeGenFunction &CGF);
302 bool emitResourceArrayCopy(LValue &LHS, Expr *RHSExpr, CodeGenFunction &CGF);
303
304 std::optional<LValue> emitBufferArraySubscriptExpr(
305 const ArraySubscriptExpr *E, CodeGenFunction &CGF,
306 llvm::function_ref<llvm::Value *(bool Promote)> EmitIdxAfterBase);
307
309 CodeGenFunction &CGF);
310
311 bool emitBufferCopy(CodeGenFunction &CGF, Address DestPtr, Address SrcPtr,
312 QualType CType);
313
315 std::optional<LValue> emitResourceMemberExpr(CodeGenFunction &CGF,
316 const MemberExpr *E);
317
318private:
319 void emitBufferGlobalsAndMetadata(const HLSLBufferDecl *BufDecl,
320 llvm::GlobalVariable *BufGV,
321 const CGHLSLOffsetInfo &OffsetInfo);
322 void initializeBufferFromBinding(const HLSLBufferDecl *BufDecl,
323 llvm::GlobalVariable *GV);
324 void initializeBufferFromBinding(const HLSLBufferDecl *BufDecl,
325 llvm::GlobalVariable *GV,
326 HLSLResourceBindingAttr *RBA);
327
328 llvm::Value *emitSPIRVUserSemanticLoad(llvm::IRBuilder<> &B, llvm::Type *Type,
330 HLSLAppliedSemanticAttr *Semantic,
331 std::optional<unsigned> Index);
332 llvm::Value *emitDXILUserSemanticLoad(llvm::IRBuilder<> &B, llvm::Type *Type,
333 HLSLAppliedSemanticAttr *Semantic,
334 std::optional<unsigned> Index);
335 llvm::Value *emitUserSemanticLoad(llvm::IRBuilder<> &B, llvm::Type *Type,
337 HLSLAppliedSemanticAttr *Semantic,
338 std::optional<unsigned> Index);
339
340 void emitSPIRVUserSemanticStore(llvm::IRBuilder<> &B, llvm::Value *Source,
342 HLSLAppliedSemanticAttr *Semantic,
343 std::optional<unsigned> Index);
344 void emitDXILUserSemanticStore(llvm::IRBuilder<> &B, llvm::Value *Source,
345 HLSLAppliedSemanticAttr *Semantic,
346 std::optional<unsigned> Index);
347 void emitUserSemanticStore(llvm::IRBuilder<> &B, llvm::Value *Source,
349 HLSLAppliedSemanticAttr *Semantic,
350 std::optional<unsigned> Index);
351
352 llvm::Triple::ArchType getArch();
353
354 llvm::DenseMap<const clang::RecordType *, llvm::StructType *> LayoutTypes;
355 unsigned SPIRVLastAssignedInputSemanticLocation = 0;
356 unsigned SPIRVLastAssignedOutputSemanticLocation = 0;
357};
358
359} // namespace CodeGen
360} // namespace clang
361
362#endif
Defines enum values for all the target-independent builtin functions.
#define GENERATE_HLSL_INTRINSIC_FUNCTION(FunctionName, IntrinsicPostfix)
llvm::dxil::ResourceClass ResourceClass
Defines helper utilities for supporting the HLSL runtime environment.
__DEVICE__ bool isnan(float __x)
Test for a NaN.
__DEVICE__ bool isinf(float __x)
Test for infinity value (+ve or -ve) .
__DEVICE__ double rsqrt(double __a)
ArraySubscriptExpr - [C99 6.5.2.1] Array Subscripting.
Definition Expr.h:2724
Like RawAddress, an abstract representation of an aligned address, but the pointer contained in this ...
Definition Address.h:128
static const uint32_t Unspecified
static bool compareOffsets(uint32_t LHS, uint32_t RHS)
Comparison function for offsets received from operator[] suitable for use in a stable_sort.
static CGHLSLOffsetInfo fromDecl(const HLSLBufferDecl &BufDecl)
Iterates over all declarations in the HLSL buffer and based on the packoffset or register(c#) annotat...
uint32_t operator[](size_t I) const
Get the given offset, or ~0U if there is no offset for the member.
llvm::Instruction * getConvergenceToken(llvm::BasicBlock &BB)
void setHLSLEntryAttributes(const FunctionDecl *FD, llvm::Function *Fn)
specific_attr_iterator< HLSLAppliedSemanticAttr > handleSemanticStore(llvm::IRBuilder<> &B, const FunctionDecl *FD, llvm::Value *Source, const clang::DeclaratorDecl *Decl, specific_attr_iterator< HLSLAppliedSemanticAttr > AttrBegin, specific_attr_iterator< HLSLAppliedSemanticAttr > AttrEnd)
llvm::StructType * getHLSLBufferLayoutType(const RecordType *LayoutStructTy)
void emitEntryFunction(const FunctionDecl *FD, llvm::Function *Fn)
void handleGlobalVarDefinition(const VarDecl *VD, llvm::GlobalVariable *Var)
void emitSystemSemanticStore(llvm::IRBuilder<> &B, llvm::Value *Source, const clang::DeclaratorDecl *Decl, HLSLAppliedSemanticAttr *Semantic, std::optional< unsigned > Index)
std::pair< llvm::Value *, specific_attr_iterator< HLSLAppliedSemanticAttr > > handleStructSemanticLoad(llvm::IRBuilder<> &B, const FunctionDecl *FD, llvm::Type *Type, const clang::DeclaratorDecl *Decl, specific_attr_iterator< HLSLAppliedSemanticAttr > begin, specific_attr_iterator< HLSLAppliedSemanticAttr > end)
std::optional< LValue > emitResourceMemberExpr(CodeGenFunction &CGF, const MemberExpr *E)
specific_attr_iterator< HLSLAppliedSemanticAttr > handleStructSemanticStore(llvm::IRBuilder<> &B, const FunctionDecl *FD, llvm::Value *Source, const clang::DeclaratorDecl *Decl, specific_attr_iterator< HLSLAppliedSemanticAttr > AttrBegin, specific_attr_iterator< HLSLAppliedSemanticAttr > AttrEnd)
llvm::Value * handleScalarSemanticLoad(llvm::IRBuilder<> &B, const FunctionDecl *FD, llvm::Type *Type, const clang::DeclaratorDecl *Decl, HLSLAppliedSemanticAttr *Semantic)
void addHLSLBufferLayoutType(const RecordType *LayoutStructTy, llvm::StructType *LayoutTy)
GENERATE_HLSL_INTRINSIC_FUNCTION(FlattenedThreadIdInGroup, flattened_thread_id_in_group) GENERATE_HLSL_INTRINSIC_FUNCTION(CreateResourceGetBasePointer
void handleScalarSemanticStore(llvm::IRBuilder<> &B, const FunctionDecl *FD, llvm::Value *Source, const clang::DeclaratorDecl *Decl, HLSLAppliedSemanticAttr *Semantic)
std::pair< llvm::Value *, specific_attr_iterator< HLSLAppliedSemanticAttr > > handleSemanticLoad(llvm::IRBuilder<> &B, const FunctionDecl *FD, llvm::Type *Type, const clang::DeclaratorDecl *Decl, specific_attr_iterator< HLSLAppliedSemanticAttr > begin, specific_attr_iterator< HLSLAppliedSemanticAttr > end)
CGHLSLRuntime(CodeGenModule &CGM)
std::optional< LValue > emitBufferArraySubscriptExpr(const ArraySubscriptExpr *E, CodeGenFunction &CGF, llvm::function_ref< llvm::Value *(bool Promote)> EmitIdxAfterBase)
std::optional< LValue > emitResourceArraySubscriptExpr(const ArraySubscriptExpr *E, CodeGenFunction &CGF)
void addRootSignature(const HLSLRootSignatureDecl *D)
bool emitResourceArrayCopy(LValue &LHS, Expr *RHSExpr, CodeGenFunction &CGF)
LValue emitBufferMemberExpr(CodeGenFunction &CGF, const MemberExpr *E)
bool emitBufferCopy(CodeGenFunction &CGF, Address DestPtr, Address SrcPtr, QualType CType)
llvm::Type * convertHLSLSpecificType(const Type *T)
llvm::Type * convertHLSLSpecificType(const Type *T, const CGHLSLOffsetInfo &OffsetInfo)
llvm::Value * emitSystemSemanticLoad(llvm::IRBuilder<> &B, const FunctionDecl *FD, llvm::Type *Type, const clang::DeclaratorDecl *Decl, HLSLAppliedSemanticAttr *Semantic, std::optional< unsigned > Index)
RawAddress createBufferMatrixTempAddress(const LValue &LV, SourceLocation Loc, CodeGenFunction &CGF)
void addBuffer(const HLSLBufferDecl *D)
void setHLSLFunctionAttributes(const FunctionDecl *FD, llvm::Function *Fn)
void emitInitListOpaqueValues(CodeGenFunction &CGF, InitListExpr *E)
CodeGenFunction - This class organizes the per-function state that is used while generating LLVM code...
This class organizes the cross-function state that is used while generating LLVM code.
LValue - This represents an lvalue references.
Definition CGValue.h:183
An abstract representation of an aligned address.
Definition Address.h:42
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
Definition DeclBase.h:1462
Represents a ValueDecl that came out of a declarator.
Definition Decl.h:780
This represents one expression.
Definition Expr.h:112
Represents a function declaration or definition.
Definition Decl.h:2018
HLSLBufferDecl - Represent a cbuffer or tbuffer declaration.
Definition Decl.h:5212
Describes an C or C++ initializer list.
Definition Expr.h:5302
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
Definition Expr.h:3367
This represents a decl that may have a name.
Definition Decl.h:274
Represents a parameter to a function.
Definition Decl.h:1808
A (possibly-)qualified type.
Definition TypeBase.h:937
Encodes a location in the source.
The base class of the type hierarchy.
Definition TypeBase.h:1875
Represents a variable declaration or definition.
Definition Decl.h:924
specific_attr_iterator - Iterates over a subrange of an AttrVec, only providing attributes that are o...
@ Type
The l-value was considered opaque, so the alignment was determined from a type.
Definition CGValue.h:155
@ Decl
The l-value was an access to a declared entity or something equivalently strong, like the address of ...
Definition CGValue.h:146
The JSON file list parser is used to communicate input to InstallAPI.
Diagnostic wrappers for TextAPI types for error reporting.
Definition Dominators.h:30
float __ovld __cnfn step(float, float)
Returns 0.0 if x < edge, otherwise it returns 1.0.
float __ovld __cnfn sign(float)
Returns 1.0 if x > 0, -0.0 if x = -0.0, +0.0 if x = +0.0, or -1.0 if x < 0.
float __ovld __cnfn radians(float)
Converts degrees to radians, i.e.
float __ovld __cnfn degrees(float)
Converts radians to degrees, i.e.
int __ovld __cnfn all(char)
Returns 1 if the most significant bit in all components of x is set; otherwise returns 0.
float __ovld __cnfn normalize(float)
Returns a vector in the same direction as p but with a length of 1.
int __ovld __cnfn any(char)
Returns 1 if the most significant bit in any component of x is set; otherwise returns 0.
float4 __ovld __cnfn cross(float4, float4)
Returns the cross product of p0.xyz and p1.xyz.