Skip to content

Commit 8a0ee06

Browse files
committed
fix comments
1 parent 105e6dd commit 8a0ee06

File tree

2 files changed

+2
-22
lines changed

2 files changed

+2
-22
lines changed

mlir/lib/Bindings/Python/IRCore.cpp

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2786,32 +2786,12 @@ class PyOpAttributeMap {
27862786
PyOperationRef operation;
27872787
};
27882788

2789-
// copied/borrow from
2790-
// https://github.com/python/pythoncapi-compat/blob/b541b98df1e3e5aabb5def27422a75c876f5a88a/pythoncapi_compat.h#L222
2791-
// bpo-40421 added PyFrame_GetLasti() to Python 3.11.0b1
2792-
#if PY_VERSION_HEX < 0x030b00b1 && !defined(PYPY_VERSION)
2793-
int PyFrame_GetLasti(PyFrameObject *frame) {
2794-
#if PY_VERSION_HEX >= 0x030a00a7
2795-
// bpo-27129: Since Python 3.10.0a7, f_lasti is an instruction offset,
2796-
// not a bytes offset anymore. Python uses 16-bit "wordcode" (2 bytes)
2797-
// instructions.
2798-
if (frame->f_lasti < 0) {
2799-
return -1;
2800-
}
2801-
return frame->f_lasti * 2;
2802-
#else
2803-
return frame->f_lasti;
2804-
#endif
2805-
}
2806-
#endif
2807-
28082789
constexpr size_t kMaxFrames = 512;
28092790

28102791
MlirLocation tracebackToLocation(MlirContext ctx) {
28112792
size_t framesLimit =
28122793
PyGlobals::get().getTracebackLoc().locTracebackFramesLimit();
2813-
// We use a thread_local here mostly to avoid requiring a large amount of
2814-
// space.
2794+
// Use a thread_local here to avoid requiring a large amount of space.
28152795
thread_local std::array<MlirLocation, kMaxFrames> frames;
28162796
size_t count = 0;
28172797

mlir/lib/Bindings/Python/IRModule.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
#include "Globals.h"
1515
#include "NanobindUtils.h"
16-
#include "mlir-c/Bindings/Python/Interop.h" // This is expected after nanobind.
16+
#include "mlir-c/Bindings/Python/Interop.h"
1717
#include "mlir-c/Support.h"
1818
#include "mlir/Bindings/Python/Nanobind.h"
1919

0 commit comments

Comments
 (0)