Bindings: Add support for scoped enums
ClosedPublic

Authored by bruns on Aug 17 2018, 7:07 PM.

Details

Summary

Keep the enum intact by emitting the class keyword in case the enum is
scoped.
Use the complete enum scope for parameter values, the enclosing scope is
only correct to use for unscoped enums.
The python Cursor.is_scoped_enum() method has been added with LLVM/Clang
version 5.0.

BUG: 397154

Test Plan

build kcoreaddons

Diff Detail

Repository
R240 Extra CMake Modules
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
bruns created this revision.Aug 17 2018, 7:07 PM
Restricted Application added projects: Frameworks, Build System. · View Herald TranscriptAug 17 2018, 7:07 PM
Restricted Application added subscribers: kde-buildsystem, kde-frameworks-devel. · View Herald Transcript
bruns requested review of this revision.Aug 17 2018, 7:07 PM
mpyne added a subscriber: mpyne.Aug 18 2018, 6:27 PM
mpyne added a comment.Aug 18 2018, 6:32 PM

LGTM but then I don't use the Python bindings. Have you already tried the kcoreaddons build to see if this makes it work where it had failed before?

bruns added a comment.Aug 18 2018, 7:42 PM

Compilation succeeds again, and the generated code looks sane. I have not actually tested it, though.

mpyne added a comment.Aug 22 2018, 3:05 AM

As long as older versions of LLVM result in the Python binding generation step being skipped completely (we already check for libclang in the find-package for this, right?), I don't think the dependency increase is a problem.

bruns planned changes to this revision.Aug 22 2018, 3:06 AM

Ok, then I will update the requirements in the clang check.

bruns updated this revision to Diff 40250.Aug 22 2018, 8:01 PM
bruns edited the summary of this revision. (Show Details)

Update minimum LLVM version in CMake check

mpyne accepted this revision.Aug 25 2018, 1:56 AM

LGTM and there's been plenty of time for a NAK. I say let's commit.

This revision is now accepted and ready to land.Aug 25 2018, 1:56 AM
This revision was automatically updated to reflect the committed changes.