Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Datalog IR; Translate AuthLogic to DLIR #261

Merged
merged 48 commits into from
Feb 10, 2022
Merged

Conversation

aferr
Copy link
Collaborator

@aferr aferr commented Jan 7, 2022

This is a port of the datalog ir referred to as
DLIR
and the compiler pass that translates auth logic AST nodes into DLIR
here
from the rust implementations into CPP.

src/ir/auth_logic/ast.h Outdated Show resolved Hide resolved
src/ir/auth_logic/lowering_ast_datalog.h Outdated Show resolved Hide resolved
src/ir/auth_logic/lowering_ast_datalog.h Outdated Show resolved Hide resolved
src/ir/auth_logic/lowering_ast_datalog.h Outdated Show resolved Hide resolved
src/ir/auth_logic/lowering_ast_datalog.h Outdated Show resolved Hide resolved
src/ir/auth_logic/datalog_ir.h Outdated Show resolved Hide resolved
src/ir/auth_logic/datalog_ir.h Outdated Show resolved Hide resolved
src/ir/auth_logic/datalog_ir.h Outdated Show resolved Hide resolved
src/ir/auth_logic/lowering_ast_datalog.h Outdated Show resolved Hide resolved
src/ir/auth_logic/lowering_ast_datalog.h Outdated Show resolved Hide resolved
@aferr aferr requested a review from markww January 17, 2022 16:59
@aferr
Copy link
Collaborator Author

aferr commented Jan 17, 2022

@markww now it might be a good point to do a re-review just at the is this good C++ level and not so much at the does this algorithm make sense level (I'll add better comments to justify the second one later). See what you think of the way variants are visited (in particular that an accessor to the variant is added back in). Also I think I needed to add more const references to iterate over vectors... maybe some of these can actually be eliminated somehow, though?

src/ir/auth_logic/ast.h Show resolved Hide resolved
src/ir/auth_logic/ast.h Outdated Show resolved Hide resolved
src/ir/auth_logic/ast.h Show resolved Hide resolved
src/ir/auth_logic/ast.h Outdated Show resolved Hide resolved
src/ir/auth_logic/ast.h Outdated Show resolved Hide resolved
src/ir/auth_logic/datalog_ir.h Outdated Show resolved Hide resolved
src/ir/auth_logic/lowering_ast_datalog.h Outdated Show resolved Hide resolved
src/ir/auth_logic/lowering_ast_datalog.h Outdated Show resolved Hide resolved
src/ir/auth_logic/lowering_ast_datalog.h Outdated Show resolved Hide resolved
@aferr aferr requested review from markww and bgogul January 19, 2022 14:05
src/ir/auth_logic/ast.h Outdated Show resolved Hide resolved
@aferr aferr changed the title [WIP] Datalog IR; Translate AuthLogic to DLIR Datalog IR; Translate AuthLogic to DLIR Jan 19, 2022
src/ir/auth_logic/ast.h Outdated Show resolved Hide resolved
src/ir/auth_logic/datalog_ir.h Outdated Show resolved Hide resolved
src/ir/auth_logic/lowering_ast_datalog.h Outdated Show resolved Hide resolved
src/ir/auth_logic/lowering_ast_datalog.h Outdated Show resolved Hide resolved
src/ir/auth_logic/lowering_ast_datalog.h Outdated Show resolved Hide resolved
src/ir/auth_logic/lowering_ast_datalog.h Outdated Show resolved Hide resolved
src/ir/auth_logic/lowering_ast_datalog.h Outdated Show resolved Hide resolved
src/ir/auth_logic/lowering_ast_datalog.h Outdated Show resolved Hide resolved
src/ir/auth_logic/lowering_ast_datalog.h Outdated Show resolved Hide resolved
src/ir/auth_logic/lowering_ast_datalog.h Outdated Show resolved Hide resolved
@aferr aferr force-pushed the lowering-to-datalog@aferr branch 2 times, most recently from 83c21e2 to ba64572 Compare January 20, 2022 09:22
@aferr aferr requested a review from bgogul January 25, 2022 13:06
Copy link
Collaborator

@bgogul bgogul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a lot of code without tests, but I understand that you want to iterate. :) Address the comments when you get a chance. We will do iterate once more and get this in.

src/ir/auth_logic/ast.h Show resolved Hide resolved
src/ir/auth_logic/datalog_ir.h Show resolved Hide resolved
src/ir/auth_logic/lowering_ast_datalog.h Outdated Show resolved Hide resolved
src/ir/auth_logic/lowering_ast_datalog.h Outdated Show resolved Hide resolved
src/ir/auth_logic/lowering_ast_datalog.h Outdated Show resolved Hide resolved
src/ir/auth_logic/lowering_ast_datalog.h Outdated Show resolved Hide resolved
src/ir/auth_logic/lowering_ast_datalog.h Outdated Show resolved Hide resolved
src/ir/auth_logic/lowering_ast_datalog.cc Outdated Show resolved Hide resolved
src/ir/auth_logic/lowering_ast_datalog.cc Outdated Show resolved Hide resolved
src/ir/auth_logic/lowering_ast_datalog.cc Outdated Show resolved Hide resolved
Andrew Ferraiuolo added 2 commits February 7, 2022 13:21
@aferr aferr requested a review from bgogul February 7, 2022 13:30
Copy link
Collaborator

@bgogul bgogul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some more code refactoring suggestions. Also, some of the changes (like copyright change) don't seem to be in the PR.

src/ir/auth_logic/ast.h Show resolved Hide resolved
src/ir/auth_logic/datalog_ir.h Outdated Show resolved Hide resolved
src/ir/auth_logic/lowering_ast_datalog.cc Outdated Show resolved Hide resolved
src/ir/auth_logic/lowering_ast_datalog.h Outdated Show resolved Hide resolved
src/ir/auth_logic/lowering_ast_datalog.cc Outdated Show resolved Hide resolved
src/ir/auth_logic/move_append.h Outdated Show resolved Hide resolved
src/ir/auth_logic/lowering_ast_datalog.cc Outdated Show resolved Hide resolved
src/ir/auth_logic/lowering_ast_datalog.cc Outdated Show resolved Hide resolved
src/ir/auth_logic/lowering_ast_datalog.h Outdated Show resolved Hide resolved
src/ir/auth_logic/lowering_ast_datalog.cc Show resolved Hide resolved
@aferr
Copy link
Collaborator Author

aferr commented Feb 9, 2022

@bgogul opened issue #346

@aferr aferr requested a review from bgogul February 9, 2022 14:55
Copy link
Collaborator

@bgogul bgogul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good modulo some more comments.

src/ir/auth_logic/lowering_ast_datalog.cc Show resolved Hide resolved
src/ir/auth_logic/lowering_ast_datalog.cc Outdated Show resolved Hide resolved
src/ir/auth_logic/lowering_ast_datalog.cc Outdated Show resolved Hide resolved
src/ir/auth_logic/lowering_ast_datalog.cc Outdated Show resolved Hide resolved
src/ir/auth_logic/lowering_ast_datalog.cc Outdated Show resolved Hide resolved
src/ir/auth_logic/lowering_ast_datalog.cc Outdated Show resolved Hide resolved
src/ir/auth_logic/lowering_ast_datalog.cc Outdated Show resolved Hide resolved
@aferr aferr merged commit 55573ec into main Feb 10, 2022
@aferr aferr deleted the lowering-to-datalog@aferr branch February 10, 2022 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants