mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-13 02:21:45 +00:00
400d3261a0
The goal of this change is to clean up some of the code surrounding HLSL using CXXThisExpr as a non-pointer l-value. This change cleans up a bunch of assumptions and inconsistencies around how the type of `this` is handled through the AST and code generation. This change is be mostly NFC for HLSL, and completely NFC for other language modes. This change introduces a new member to query for the this object's type and seeks to clarify the normal usages of the this type. With the introudction of HLSL to clang, CXXThisExpr may now be an l-value and behave like a reference type rather than C++'s normal method of it being an r-value of pointer type. With this change there are now three ways in which a caller might need to query the type of `this`: * The type of the `CXXThisExpr` * The type of the object `this` referrs to * The type of the implicit (or explicit) `this` argument This change codifies those three ways you may need to query respectively as: * CXXMethodDecl::getThisType() * CXXMethodDecl::getThisObjectType() * CXXMethodDecl::getThisArgType() This change then revisits all uses of `getThisType()`, and in cases where the only use was to resolve the pointee type, it replaces the call with `getThisObjectType()`. In other cases it evaluates whether the desired returned type is the type of the `this` expr, or the type of the `this` function argument. The `this` expr type is used for creating additional expr AST nodes and for member lookup, while the argument type is used mostly for code generation. Additionally some cases that used `getThisType` in simple queries could be substituted for `getThisObjectType`. Since `getThisType` is implemented in terms of `getThisObjectType` calling the later should be more efficient if the former isn't needed. Reviewed By: aaron.ballman, bogner Differential Revision: https://reviews.llvm.org/D159247 |
||
---|---|---|
.. | ||
builtins | ||
semantics | ||
basic_types.hlsl | ||
basic-target.c | ||
buffer-array-operator.hlsl | ||
cbuf_in_namespace.hlsl | ||
cbuf.hlsl | ||
disable_opt.hlsl | ||
entry.hlsl | ||
float3.hlsl | ||
GlobalConstructorFunction.hlsl | ||
GlobalConstructorLib.hlsl | ||
GlobalConstructors.hlsl | ||
GlobalDestructors.hlsl | ||
group_shared.hlsl | ||
half.hlsl | ||
lit.local.cfg | ||
no_int_promotion.hlsl | ||
shader_type_attr.hlsl | ||
sret_output.hlsl | ||
static_global_and_function_in_cb.hlsl | ||
this-assignment-overload.hlsl | ||
this-assignment.hlsl | ||
this-reference.hlsl | ||
validator_version.hlsl |