[PATCH] D141858: [clang][Interp] Fix Pointer::toAPValue() for expressions
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGf63138d44429: [clang][Interp] Fix Pointer::toAPValue() for expressions (authored by tbaeder). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141858/new/ https://reviews.llvm.org/D141858 Files: clang/lib/AST/Interp/Pointer.cpp Index: clang/lib/AST/Interp/Pointer.cpp === --- clang/lib/AST/Interp/Pointer.cpp +++ clang/lib/AST/Interp/Pointer.cpp @@ -103,6 +103,10 @@ if (isUnknownSizeArray()) { IsOnePastEnd = false; Offset = CharUnits::Zero(); +} else if (Desc->asExpr()) { + // Pointer pointing to a an expression. + IsOnePastEnd = false; + Offset = CharUnits::Zero(); } else { // TODO: compute the offset into the object. Offset = CharUnits::Zero(); Index: clang/lib/AST/Interp/Pointer.cpp === --- clang/lib/AST/Interp/Pointer.cpp +++ clang/lib/AST/Interp/Pointer.cpp @@ -103,6 +103,10 @@ if (isUnknownSizeArray()) { IsOnePastEnd = false; Offset = CharUnits::Zero(); +} else if (Desc->asExpr()) { + // Pointer pointing to a an expression. + IsOnePastEnd = false; + Offset = CharUnits::Zero(); } else { // TODO: compute the offset into the object. Offset = CharUnits::Zero(); ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D141858: [clang][Interp] Fix Pointer::toAPValue() for expressions
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. LG given that other test coverage exists for this. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141858/new/ https://reviews.llvm.org/D141858 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D141858: [clang][Interp] Fix Pointer::toAPValue() for expressions
tbaeder added a comment. It's a bit involved since without working `MaterializeTemporaryExpr`s, this code is a no-op, but without this code, the MTEs don't properly work, usually. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141858/new/ https://reviews.llvm.org/D141858 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D141858: [clang][Interp] Fix Pointer::toAPValue() for expressions
aaron.ballman added a comment. Test coverage? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141858/new/ https://reviews.llvm.org/D141858 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D141858: [clang][Interp] Fix Pointer::toAPValue() for expressions
tbaeder added a comment. Ping CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141858/new/ https://reviews.llvm.org/D141858 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D141858: [clang][Interp] Fix Pointer::toAPValue() for expressions
tbaeder added a comment. Ping CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141858/new/ https://reviews.llvm.org/D141858 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D141858: [clang][Interp] Fix Pointer::toAPValue() for expressions
tbaeder updated this revision to Diff 489581. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141858/new/ https://reviews.llvm.org/D141858 Files: clang/lib/AST/Interp/Pointer.cpp Index: clang/lib/AST/Interp/Pointer.cpp === --- clang/lib/AST/Interp/Pointer.cpp +++ clang/lib/AST/Interp/Pointer.cpp @@ -105,6 +105,10 @@ if (isUnknownSizeArray()) { IsOnePastEnd = false; Offset = CharUnits::Zero(); +} else if (Desc->asExpr()) { + // Pointer pointing to a an expression. + IsOnePastEnd = false; + Offset = CharUnits::Zero(); } else { // TODO: compute the offset into the object. Offset = CharUnits::Zero(); Index: clang/lib/AST/Interp/Pointer.cpp === --- clang/lib/AST/Interp/Pointer.cpp +++ clang/lib/AST/Interp/Pointer.cpp @@ -105,6 +105,10 @@ if (isUnknownSizeArray()) { IsOnePastEnd = false; Offset = CharUnits::Zero(); +} else if (Desc->asExpr()) { + // Pointer pointing to a an expression. + IsOnePastEnd = false; + Offset = CharUnits::Zero(); } else { // TODO: compute the offset into the object. Offset = CharUnits::Zero(); ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D141858: [clang][Interp] Fix Pointer::toAPValue() for expressions
tbaeder created this revision. tbaeder added reviewers: aaron.ballman, erichkeane, tahonermann, shafik. Herald added a project: All. tbaeder requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. This is now relevant because we generate pointers for expressions more often, since `MaterializeTemporaryExpr`s work. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D141858 Files: clang/lib/AST/Interp/Pointer.cpp Index: clang/lib/AST/Interp/Pointer.cpp === --- clang/lib/AST/Interp/Pointer.cpp +++ clang/lib/AST/Interp/Pointer.cpp @@ -105,6 +105,10 @@ if (isUnknownSizeArray()) { IsOnePastEnd = false; Offset = CharUnits::Zero(); +} else if (getFieldDesc()->asExpr()) { + // Pointer pointing to a an expression. + IsOnePastEnd = false; + Offset = CharUnits::Zero(); } else { // TODO: compute the offset into the object. Offset = CharUnits::Zero(); Index: clang/lib/AST/Interp/Pointer.cpp === --- clang/lib/AST/Interp/Pointer.cpp +++ clang/lib/AST/Interp/Pointer.cpp @@ -105,6 +105,10 @@ if (isUnknownSizeArray()) { IsOnePastEnd = false; Offset = CharUnits::Zero(); +} else if (getFieldDesc()->asExpr()) { + // Pointer pointing to a an expression. + IsOnePastEnd = false; + Offset = CharUnits::Zero(); } else { // TODO: compute the offset into the object. Offset = CharUnits::Zero(); ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits