Skip to content

Commit eb48702

Browse files
committed
fix comments
1 parent 105e6dd commit eb48702

File tree

5 files changed

+6
-27
lines changed

5 files changed

+6
-27
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

mlir/test/lit.cfg.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,3 +375,6 @@ def have_host_jit_feature_support(feature_name):
375375

376376
if config.arm_emulator_executable:
377377
config.available_features.add("arm-emulator")
378+
379+
if sys.version_info >= (3, 11):
380+
config.available_features.add("python-ge-311")

mlir/test/python/ir/auto_location.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# RUN: %PYTHON %s | FileCheck %s
2-
2+
# REQUIRES: python-ge-311
33
import gc
44
from contextlib import contextmanager
55

mlir/test/python/lit.local.cfg

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,3 @@ config.environment["ASAN_OPTIONS"] = "detect_leaks=0"
22
if not config.enable_bindings_python:
33
config.unsupported = True
44
config.excludes.add("python_test_ops.td")
5-
6-
import sys
7-
if sys.version_info >= (3, 11):
8-
config.available_features.add("python-ge-311")

0 commit comments

Comments
 (0)