-
Notifications
You must be signed in to change notification settings - Fork 94
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
[CIR][CIRGen] Handle __extension__ keyword #421
Conversation
The repro-case
Compilation of this test fails with
|
✅ With the latest revision this PR passed the C/C code formatter. |
5bbc8ec
to
c6e4682
Compare
mlir::Value VisitUnaryExtension(const UnaryOperator *E) { | ||
llvm_unreachable("NYI"); | ||
TestAndClearIgnoreResultAssign(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This diverges from the original clang CodeGen. Could you add some explanation regarding this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't), because it is my mistake. I fixed this
4e069c6
to
79d4dc7
Compare
@lanza just rebased and this has the side effect of breaking GH PR workflow, making it impossible to review, apologies. Please rebase! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, mostly good! Some inline comments.
int foo(void) { return __extension__ 0b101010; } | ||
|
||
//CHECK: cir.func @foo() -> !s32i extra( {inline = #cir.inline<no>, optnone = #cir.optnone} ) { | ||
//CHECK-NEXT: %0 = cir.alloca !s32i, cir.ptr <!s32i>, ["__retval"] {alignment = 4 : i64} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor nitpicks here:
- The file name is misspelled, should be
gnu-extension
. - Use FileCheck regexes for MLIR values, for example:
%[[addr:.*]] = cir.alloca !s32i, cir.ptr <!s32i>,
%[[const:.*]] = cir.const(#cir.int<42> : !s32i) : !s32i
cir.store %[[const]], %[[addr]] : !s32i, cir.ptr <!s32i>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, got it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Support \_\_extension\_\_ keyword in CIRGen
Support \_\_extension\_\_ keyword in CIRGen
Support \_\_extension\_\_ keyword in CIRGen
Support \_\_extension\_\_ keyword in CIRGen
Support \_\_extension\_\_ keyword in CIRGen
Support \_\_extension\_\_ keyword in CIRGen
Support __extension__ keyword in CIRGen