summaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorNikita Popov <npopov@redhat.com>2022-04-05 11:18:33 +0200
committerNikita Popov <npopov@redhat.com>2022-04-05 11:28:40 +0200
commitff18b158edc4719c4b05cd04dceaedcf69a8d9c5 (patch)
treebf893e28e53ab40fbf76962f22a8079182c3b677 /clang/lib/CodeGen/CodeGenModule.cpp
parent004d4f898069da55d12f61e756664736232eb328 (diff)
[CodeGen] Avoid unnecessary ConstantExpr cast
With opaque pointers, this is not necessarily a ConstantExpr. And we don't need one here either, just Constant is sufficient.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index d637ab6ec288..4d24c33f51d0 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -5407,7 +5407,7 @@ CodeGenModule::GetAddrOfConstantCFString(const StringLiteral *Literal) {
auto Fields = Builder.beginStruct(STy);
// Class pointer.
- Fields.add(cast<llvm::ConstantExpr>(CFConstantStringClassRef));
+ Fields.add(cast<llvm::Constant>(CFConstantStringClassRef));
// Flags.
if (IsSwiftABI) {