Author: phyBrackets
Date: 2022-07-05T08:12:01+05:30
New Revision: 98c6a3c0c2209dd7bdb15fe6c91c507c16990bcf

URL: 
https://github.com/llvm/llvm-project/commit/98c6a3c0c2209dd7bdb15fe6c91c507c16990bcf
DIFF: 
https://github.com/llvm/llvm-project/commit/98c6a3c0c2209dd7bdb15fe6c91c507c16990bcf.diff

LOG: [NFC][ASTImporter] remove the unnecessary condition checks in 
ASTImporter.cpp

I think that these conditions are unnecessary because in VisitClassTemplateDecl 
we import the definition via the templated CXXRecordDecl and in 
VisitVarTemplateDecl via the templated VarDecl. These are named ToTemplted and 
DTemplated respectively.

Reviewed By: martong

Differential Revision: https://reviews.llvm.org/D128608

Added: 
    

Modified: 
    clang/include/clang/AST/ASTImportError.h
    clang/lib/AST/ASTImporter.cpp

Removed: 
    


################################################################################
diff  --git a/clang/include/clang/AST/ASTImportError.h 
b/clang/include/clang/AST/ASTImportError.h
index 405790b6ded3f..728314ca0936e 100644
--- a/clang/include/clang/AST/ASTImportError.h
+++ b/clang/include/clang/AST/ASTImportError.h
@@ -19,7 +19,6 @@
 namespace clang {
 
 class ASTImportError : public llvm::ErrorInfo<ASTImportError> {
-
 public:
   /// \brief Kind of error when importing an AST component.
   enum ErrorKind {

diff  --git a/clang/lib/AST/ASTImporter.cpp b/clang/lib/AST/ASTImporter.cpp
index e9730112eaa35..73c3f02e67a85 100644
--- a/clang/lib/AST/ASTImporter.cpp
+++ b/clang/lib/AST/ASTImporter.cpp
@@ -5667,11 +5667,6 @@ ExpectedDecl 
ASTNodeImporter::VisitClassTemplateDecl(ClassTemplateDecl *D) {
     D2->setPreviousDecl(Recent);
   }
 
-  if (FromTemplated->isCompleteDefinition() &&
-      !ToTemplated->isCompleteDefinition()) {
-    // FIXME: Import definition!
-  }
-
   return D2;
 }
 
@@ -5950,11 +5945,6 @@ ExpectedDecl 
ASTNodeImporter::VisitVarTemplateDecl(VarTemplateDecl *D) {
     ToVarTD->setPreviousDecl(Recent);
   }
 
-  if (DTemplated->isThisDeclarationADefinition() &&
-      !ToTemplated->isThisDeclarationADefinition()) {
-    // FIXME: Import definition!
-  }
-
   return ToVarTD;
 }
 


        
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to