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

[CIR][CIRGen][Bugfix] Fix source location in ctors #415

Merged
merged 2 commits into from
Jan 31, 2024

Conversation

YazZz1k
Copy link
Contributor

@YazZz1k YazZz1k commented Jan 23, 2024

No description provided.

@YazZz1k
Copy link
Contributor Author

YazZz1k commented Jan 23, 2024

Bug reproduction
repro.cpp:

struct e { e(int); };
e *g = new e(0);

reproduction line ("-fno-exceptions" is used to hide the NIY error connected with exceptions )

clang++ -fclangir-enable -fno-exceptions repro.cpp -S -o repro.s

fails with the assertion

clang: /home/huawei/cir/repo/van/llvm-project/clang/lib/CIR/CodeGen/CIRGenFunction.h:786: cir::RValue cir::CIRGenFunction::buildCall(const cir::CIRGenFunctionInfo&, const cir::CIRGenCallee&, cir::ReturnValueSlot, const cir::CallArgList&, mlir::cir::CallOp*, bool): Assertion `currSrcLoc && "source location must have been set"' failed.

This PR fixes the bug described above

Copy link
Member

@Lancern Lancern left a comment

Choose a reason for hiding this comment

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

The fix LGTM. Please consider adding a test for this change in some file under clang/test/CIR/CodeGen.

@YazZz1k
Copy link
Contributor Author

YazZz1k commented Jan 24, 2024

test was added

Copy link
Member

@Lancern Lancern left a comment

Choose a reason for hiding this comment

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

LGTM.

@lanza lanza force-pushed the main branch 2 times, most recently from 4e069c6 to 79d4dc7 Compare January 29, 2024 23:34
@bcardosolopes
Copy link
Member

@lanza just rebased and this has the side effect of breaking GH PR workflow, making it impossible to review, apologies. Please rebase!

@YazZz1k YazZz1k force-pushed the cpp-118 branch 3 times, most recently from 1114330 to f46b672 Compare January 31, 2024 12:34
Copy link
Member

@bcardosolopes bcardosolopes left a comment

Choose a reason for hiding this comment

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

LGTM

@bcardosolopes bcardosolopes merged commit 57cc970 into llvm:main Jan 31, 2024
6 checks passed
eZWALT pushed a commit to eZWALT/clangir that referenced this pull request Mar 24, 2024
eZWALT pushed a commit to eZWALT/clangir that referenced this pull request Apr 29, 2024
bruteforceboy pushed a commit to bruteforceboy/clangir that referenced this pull request Oct 2, 2024
Hugobros3 pushed a commit to shady-gang/clangir that referenced this pull request Oct 2, 2024
keryell pushed a commit to keryell/clangir that referenced this pull request Oct 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants