Conversation
Add the remaining faithful Expr Ignore* accessors (IgnoreImpCasts, IgnoreCasts, IgnoreImplicitAsWritten, IgnoreParenImpCasts, IgnoreParenCasts, IgnoreParenLValueCasts, IgnoreParenBaseCasts), surface LambdaExpr.CallOperator/IsMutable, add CXXRewrittenBinaryOperator.IsReversed with a CXCursor.IsReversed bridge, and add Type.IsCharType/IsMatrixType plus MemberPointerType.IsMemberFunctionPointer/IsMemberDataPointer. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A managed-only follow-up to #794 that surfaces additional Clang C++ AST API on the high-level managed layer (
sources/ClangSharp/) using only interop bridges already present in the released package. Nosources/libClangSharp/changes. Every addition mirrors clang 21.1.8 (llvmorg-21.1.8) exactly.Expr(Cursors/Exprs/Expr.cs)Adds the remaining
Ignore*accessors, composing single-step funcs that mirrorIgnoreExpr.hand the composition inExpr.cpp:IgnoreImpCasts—IgnoreExprNodes(IgnoreImplicitCastsSingleStep)IgnoreCasts—IgnoreExprNodes(IgnoreCastsSingleStep)IgnoreImplicitAsWritten—IgnoreExprNodes(IgnoreImplicitAsWrittenSingleStep)IgnoreParenImpCasts—IgnoreExprNodes(IgnoreParensSingleStep, IgnoreImplicitCastsExtraSingleStep)IgnoreParenCasts—IgnoreExprNodes(IgnoreParensSingleStep, IgnoreCastsSingleStep)IgnoreParenLValueCasts—IgnoreExprNodes(IgnoreParensSingleStep, IgnoreLValueCastsSingleStep)IgnoreParenBaseCasts—IgnoreExprNodes(IgnoreParensSingleStep, IgnoreBaseCastsSingleStep)Adds the matching single-step funcs and a two-func
IgnoreExprNodesoverload that appliesfn1thenfn2per fixed-point step (mirroringdetail::IgnoreExprNodesImpl).LambdaExpr(Cursors/Exprs/LambdaExpr.cs)CallOperator— mirrorsLambdaExpr::getCallOperator()(getLambdaClass()->getLambdaCallOperator()). The releasedCursor_getLambdaCallOperatordispatches on the closureCXXRecordDecl, not theLambdaExprcursor, so this routes throughType.AsCXXRecordDecl.IsMutable— mirrorsLambdaExpr::isMutable()(!getCallOperator()->isConst()).CXXRewrittenBinaryOperator(Cursors/Exprs/CXXRewrittenBinaryOperator.cs)IsReversed— mirrorsCXXRewrittenBinaryOperator::isReversed(), via a newCXCursor.IsReversedinterop helper over the already-releasedclangsharp_Cursor_getIsReversedbridge.Type(Types/Type.cs)IsCharType— mirrorsType::isCharType()(BuiltinTypeofChar_U/UChar/Char_S/SChar).IsMatrixType— mirrorsType::isMatrixType()(CanonicalType is MatrixType).MemberPointerType(Types/MemberPointerType.cs)IsMemberFunctionPointer— mirrorsMemberPointerType::isMemberFunctionPointer()(PointeeType->isFunctionProtoType()).IsMemberDataPointer— mirrorsMemberPointerType::isMemberDataPointer()(negation).Tests
ExprTest.cscoveringLambdaExpr.CallOperator/IsMutable, theIgnore*family, and reversed vs. spaceship-rewrittenCXXRewrittenBinaryOperator.IsReversed(-std=c++20).TypeTest.cscases forIsCharType,IsMatrixType(-fenable-matrix), andIsMemberFunctionPointer/IsMemberDataPointer.Deferred to a native change
Typepredicates (isScalarType,isArithmeticType,isFloatingType,isRealFloatingType,isAggregateType,isObjectType,hasPointerRepresentation,hasIntegerRepresentation,hasFloatingRepresentation) — spec-faithfulness needs data not cleanly available managed-side.LambdaExpr.CaptureDefault—getLambdaCaptureDefaultisn't in the released package.Expr.IgnoreParenNoopCasts— requiresASTContext.PredefinedExprsub-step ofIgnoreParensSingleStep— the releasedCursor_getIsTransparentonly coversTypedefNameDecl/InitListExpr, notPredefinedExpr::isTransparent(). The existing shippedIgnoreParensalready omits it; the newIgnoreParen*accessors reuse the same single-step and inherit that one pre-existing divergence.