[llvm] [NVPTX] Cleanup/Refactoring in NVPTX AsmPrinter and RegisterInfo (NFC) (PR #126800)

Justin Fargnoli via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 11 14:06:33 PST 2025


================
@@ -928,28 +909,18 @@ void NVPTXAsmPrinter::emitLinkageDirective(const GlobalValue *V,
                                            raw_ostream &O) {
   if (static_cast<NVPTXTargetMachine &>(TM).getDrvInterface() == NVPTX::CUDA) {
     if (V->hasExternalLinkage()) {
-      if (isa<GlobalVariable>(V)) {
-        const GlobalVariable *GVar = cast<GlobalVariable>(V);
-        if (GVar) {
-          if (GVar->hasInitializer())
-            O << ".visible ";
-          else
-            O << ".extern ";
-        }
-      } else if (V->isDeclaration())
+      if (const auto *GVar = dyn_cast<GlobalVariable>(V))
+
----------------
justinfargnoli wrote:

```suggestion
```

https://github.com/llvm/llvm-project/pull/126800


More information about the llvm-commits mailing list