-
Notifications
You must be signed in to change notification settings - Fork 145
[CIR][CodeGen] Support static references to temporaries #872
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
Merged
bcardosolopes
merged 5 commits into
users/lanza/sprmain.circodegen-support-static-references-to-temporaries
from
users/lanza/sprcircodegen-support-static-references-to-temporaries
Oct 8, 2024
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Created using spr 1.3.5
lanza
commented
Sep 20, 2024
lanza
commented
Sep 20, 2024
bcardosolopes
requested changes
Sep 20, 2024
✅ With the latest revision this PR passed the C/C++ code formatter. |
You can test this locally with the following command:git-clang-format --diff 3ec8a752d50d2027969786b903423f2e059d20c9 f40fdeacc750aac5edcea206ae2a076ceb8d9b51 --extensions h,cpp -- clang/test/CIR/CodeGen/tempref.cpp clang/lib/CIR/CodeGen/CIRGenCXX.cpp clang/lib/CIR/CodeGen/CIRGenCXXABI.h clang/lib/CIR/CodeGen/CIRGenDeclCXX.cpp clang/lib/CIR/CodeGen/CIRGenExpr.cpp clang/lib/CIR/CodeGen/CIRGenItaniumCXXABI.cpp clang/lib/CIR/CodeGen/CIRGenModule.cpp clang/lib/CIR/CodeGen/CIRGenModule.h clang/test/CIR/CodeGen/temporaries.cpp View the diff from clang-format here.diff --git a/clang/lib/CIR/CodeGen/CIRGenCXXABI.h b/clang/lib/CIR/CodeGen/CIRGenCXXABI.h
index d88bbbb3b8..7b0acae564 100644
--- a/clang/lib/CIR/CodeGen/CIRGenCXXABI.h
+++ b/clang/lib/CIR/CodeGen/CIRGenCXXABI.h
@@ -170,8 +170,7 @@ public:
/// \param Dtor - a function taking a single pointer argument
/// \param Addr - a pointer to pass to the destructor function.
virtual void registerGlobalDtor(CIRGenFunction &CGF, const VarDecl *D,
- mlir::cir::FuncOp dtor,
- mlir::Value Addr) = 0;
+ mlir::cir::FuncOp dtor, mlir::Value Addr) = 0;
virtual size_t getSrcArgforCopyCtor(const CXXConstructorDecl *,
FunctionArgList &Args) const = 0;
diff --git a/clang/lib/CIR/CodeGen/CIRGenDeclCXX.cpp b/clang/lib/CIR/CodeGen/CIRGenDeclCXX.cpp
index 12c0e8ec2e..d508668533 100644
--- a/clang/lib/CIR/CodeGen/CIRGenDeclCXX.cpp
+++ b/clang/lib/CIR/CodeGen/CIRGenDeclCXX.cpp
@@ -51,4 +51,3 @@ void CIRGenModule::buildCXXGlobalVarDeclInitFunc(const VarDecl *D,
buildCXXGlobalVarDeclInit(D, Addr, PerformInit);
}
-
diff --git a/clang/lib/CIR/CodeGen/CIRGenExpr.cpp b/clang/lib/CIR/CodeGen/CIRGenExpr.cpp
index d73483fee5..5cf2e27b0d 100644
--- a/clang/lib/CIR/CodeGen/CIRGenExpr.cpp
+++ b/clang/lib/CIR/CodeGen/CIRGenExpr.cpp
@@ -1955,7 +1955,7 @@ LValue CIRGenFunction::buildCastLValue(const CastExpr *E) {
LValue LV = buildLValue(E->getSubExpr());
// Propagate the volatile qualifier to LValue, if exists in E.
if (E->changesVolatileQualification())
- llvm_unreachable("NYI");
+ llvm_unreachable("NYI");
if (LV.isSimple()) {
Address V = LV.getAddress();
if (V.isValid()) {
diff --git a/clang/lib/CIR/CodeGen/CIRGenItaniumCXXABI.cpp b/clang/lib/CIR/CodeGen/CIRGenItaniumCXXABI.cpp
index f6d53f6715..d83d827e69 100644
--- a/clang/lib/CIR/CodeGen/CIRGenItaniumCXXABI.cpp
+++ b/clang/lib/CIR/CodeGen/CIRGenItaniumCXXABI.cpp
@@ -173,8 +173,7 @@ public:
bool Delegating, Address This,
QualType ThisTy) override;
void registerGlobalDtor(CIRGenFunction &CGF, const VarDecl *D,
- mlir::cir::FuncOp dtor,
- mlir::Value Addr) override;
+ mlir::cir::FuncOp dtor, mlir::Value Addr) override;
virtual void buildRethrow(CIRGenFunction &CGF, bool isNoReturn) override;
virtual void buildThrow(CIRGenFunction &CGF, const CXXThrowExpr *E) override;
CatchTypeInfo
|
@lanza some formatting errors still |
Fixed before you replied :p |
Created using spr 1.3.5
Created using spr 1.3.5
bcardosolopes
approved these changes
Oct 8, 2024
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
3718d2d
into
users/lanza/sprmain.circodegen-support-static-references-to-temporaries
6 checks passed
lanza
added a commit
that referenced
this pull request
Oct 11, 2024
keryell
pushed a commit
to keryell/clangir
that referenced
this pull request
Oct 19, 2024
lanza
added a commit
that referenced
this pull request
Nov 5, 2024
lanza
added a commit
that referenced
this pull request
Mar 18, 2025
xlauko
pushed a commit
to trailofbits/instafix-llvm
that referenced
this pull request
Mar 28, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.