aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CGExpr.cpp
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2024-01-30 13:38:18 -0500
committerAaron Ballman <aaron@aaronballman.com>2024-01-30 13:38:18 -0500
commit201eb2b5775cf193c97c60a5eb790003a1e6bedb (patch)
treef11f41d4e2747e9737dd1c7122a771f75df3e921 /clang/lib/CodeGen/CGExpr.cpp
parent3477bcf4b94395e2c0ed77a139e54240cfe4f27d (diff)
downloadllvm-201eb2b5775cf193c97c60a5eb790003a1e6bedb.zip
llvm-201eb2b5775cf193c97c60a5eb790003a1e6bedb.tar.gz
llvm-201eb2b5775cf193c97c60a5eb790003a1e6bedb.tar.bz2
Revert "[clang] static operators should evaluate object argument (#68485)"
This reverts commit 30155fc0ef4fbdce2d79434aaae8d58b2fabb20a. It seems to have broken some tests in clangd: http://45.33.8.238/linux/129484/step_9.txt
Diffstat (limited to 'clang/lib/CodeGen/CGExpr.cpp')
-rw-r--r--clang/lib/CodeGen/CGExpr.cpp17
1 files changed, 2 insertions, 15 deletions
diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp
index 4a2f3ca..8c8c937 100644
--- a/clang/lib/CodeGen/CGExpr.cpp
+++ b/clang/lib/CodeGen/CGExpr.cpp
@@ -5848,7 +5848,6 @@ RValue CodeGenFunction::EmitCall(QualType CalleeType, const CGCallee &OrigCallee
// destruction order is not necessarily reverse construction order.
// FIXME: Revisit this based on C++ committee response to unimplementability.
EvaluationOrder Order = EvaluationOrder::Default;
- bool StaticOperator = false;
if (auto *OCE = dyn_cast<CXXOperatorCallExpr>(E)) {
if (OCE->isAssignmentOp())
Order = EvaluationOrder::ForceRightToLeft;
@@ -5866,22 +5865,10 @@ RValue CodeGenFunction::EmitCall(QualType CalleeType, const CGCallee &OrigCallee
break;
}
}
-
- if (const auto *MD =
- dyn_cast_if_present<CXXMethodDecl>(OCE->getCalleeDecl());
- MD && MD->isStatic())
- StaticOperator = true;
}
- auto Arguments = E->arguments();
- if (StaticOperator) {
- // If we're calling a static operator, we need to emit the object argument
- // and ignore it.
- EmitIgnoredExpr(E->getArg(0));
- Arguments = drop_begin(Arguments, 1);
- }
- EmitCallArgs(Args, dyn_cast<FunctionProtoType>(FnType), Arguments,
- E->getDirectCallee(), /*ParamsToSkip=*/0, Order);
+ EmitCallArgs(Args, dyn_cast<FunctionProtoType>(FnType), E->arguments(),
+ E->getDirectCallee(), /*ParamsToSkip*/ 0, Order);
const CGFunctionInfo &FnInfo = CGM.getTypes().arrangeFreeFunctionCall(
Args, FnType, /*ChainCall=*/Chain);