[clang] 8592b3e - Revert "[NFC] Don't recompute Linkage for Decl in Release Modes"

Chuanqi Xu via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 9 23:25:50 PST 2023


Author: Chuanqi Xu
Date: 2023-03-10T15:25:26+08:00
New Revision: 8592b3e1d2080d9f6b3102dfb5895ca390da44a0

URL: https://github.com/llvm/llvm-project/commit/8592b3e1d2080d9f6b3102dfb5895ca390da44a0
DIFF: https://github.com/llvm/llvm-project/commit/8592b3e1d2080d9f6b3102dfb5895ca390da44a0.diff

LOG: Revert "[NFC] Don't recompute Linkage for Decl in Release Modes"

This reverts commit 87ba95aa212a4fd363a4dd52677e9eea5224a4e7.

Added: 
    

Modified: 
    clang/lib/AST/Decl.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp
index 06af1969a8f0..240e744ee644 100644
--- a/clang/lib/AST/Decl.cpp
+++ b/clang/lib/AST/Decl.cpp
@@ -1525,16 +1525,11 @@ LinkageInfo LinkageComputer::getLVForDecl(const NamedDecl *D,
   if (std::optional<LinkageInfo> LI = lookup(D, computation))
     return *LI;
 
-#ifndef NDEBUG
   LinkageInfo LV = computeLVForDecl(D, computation);
   if (D->hasCachedLinkage())
     assert(D->getCachedLinkage() == LV.getLinkage());
 
   D->setCachedLinkage(LV.getLinkage());
-#else
-  LinkageInfo LV = D->hasCachedLinkage() ? D->getCachedLinkage() :
-                   computeLVForDecl(D, computation);
-#endif
   cache(D, computation, LV);
 
 #ifndef NDEBUG


        


More information about the cfe-commits mailing list