[clang] 74b56e0 - [NFC] Remove unused variable in CodeGenModules

Chuanqi Xu via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 7 20:53:05 PDT 2022


Author: Chuanqi Xu
Date: 2022-04-08T11:52:31+08:00
New Revision: 74b56e02bda09ae735c6aeca583a2078375f2da1

URL: https://github.com/llvm/llvm-project/commit/74b56e02bda09ae735c6aeca583a2078375f2da1
DIFF: https://github.com/llvm/llvm-project/commit/74b56e02bda09ae735c6aeca583a2078375f2da1.diff

LOG: [NFC] Remove unused variable in CodeGenModules

This eliminates an unused-variable warning

Added: 
    

Modified: 
    clang/lib/CodeGen/CodeGenModule.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index ec34d91e65372..c9e5354d3269a 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -5183,11 +5183,9 @@ void CodeGenModule::EmitAliasDefinition(GlobalDecl GD) {
   SetCommonAttributes(GD, GA);
 
   // Emit global alias debug information.
-  if (const auto *VD = dyn_cast<VarDecl>(D)) {
-    if (CGDebugInfo *DI = getModuleDebugInfo()) {
+  if (isa<VarDecl>(D))
+    if (CGDebugInfo *DI = getModuleDebugInfo())
       DI->EmitGlobalAlias(cast<llvm::GlobalValue>(GA->getAliasee()), GD);
-    }
-  }
 }
 
 void CodeGenModule::emitIFuncDefinition(GlobalDecl GD) {


        


More information about the cfe-commits mailing list