Skip to content

Commit

Permalink
Use BuildCStyleCastExpr for casting
Browse files Browse the repository at this point in the history
  • Loading branch information
PetroZarytskyi committed Feb 27, 2024
1 parent 3daf229 commit 5099340
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/Differentiator/ReverseModeVisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,8 @@ Expr* getArraySizeExpr(const ArrayType* AT, ASTContext& context,
++i) {
auto* overloadParam = overloadParams[i];
auto* gradientParam = gradientParams[i];
auto* init = m_Sema.ImpCastExprToType(BuildDeclRef(overloadParam), gradientParam->getType(), clang::CK_BitCast).get();
TypeSourceInfo* typeInfo = m_Context.getTrivialTypeSourceInfo(gradientParam->getType());
auto* init = m_Sema.BuildCStyleCastExpr(noLoc, typeInfo, noLoc, BuildDeclRef(overloadParam)).get();

auto* gradientVD =
BuildGlobalVarDecl(gradientParam->getType(), gradientParam->getName(),
Expand Down

0 comments on commit 5099340

Please sign in to comment.