[clang] 1a3a2ee - [NFC] Move function definition to cpp file
Jun Zhang via cfe-commits
cfe-commits at lists.llvm.org
Fri Jul 22 22:44:49 PDT 2022
Author: Jun Zhang
Date: 2022-07-23T13:43:42+08:00
New Revision: 1a3a2eec717b6067e29d8a07318257d2d96da238
URL: https://github.com/llvm/llvm-project/commit/1a3a2eec717b6067e29d8a07318257d2d96da238
DIFF: https://github.com/llvm/llvm-project/commit/1a3a2eec717b6067e29d8a07318257d2d96da238.diff
LOG: [NFC] Move function definition to cpp file
Signed-off-by: Jun Zhang <jun at junz.org>
Added:
Modified:
clang/lib/CodeGen/CodeGenModule.cpp
clang/lib/CodeGen/CodeGenModule.h
Removed:
################################################################################
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index a8b008b11435..101080b6fe13 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -6973,3 +6973,31 @@ void CodeGenModule::printPostfixForExternalizedDecl(llvm::raw_ostream &OS,
OS << getContext().getCUIDHash();
}
}
+
+void CodeGenModule::moveLazyEmissionStates(CodeGenModule *NewBuilder) {
+ assert(DeferredDeclsToEmit.empty() &&
+ "Should have emitted all decls deferred to emit.");
+ assert(NewBuilder->DeferredDecls.empty() &&
+ "Newly created module should not have deferred decls");
+ NewBuilder->DeferredDecls = std::move(DeferredDecls);
+
+ assert(NewBuilder->DeferredVTables.empty() &&
+ "Newly created module should not have deferred vtables");
+ NewBuilder->DeferredVTables = std::move(DeferredVTables);
+
+ assert(NewBuilder->MangledDeclNames.empty() &&
+ "Newly created module should not have mangled decl names");
+ assert(NewBuilder->Manglings.empty() &&
+ "Newly created module should not have manglings");
+ NewBuilder->Manglings = std::move(Manglings);
+
+ assert(WeakRefReferences.empty() && "Not all WeakRefRefs have been applied");
+ NewBuilder->WeakRefReferences = std::move(WeakRefReferences);
+
+ NewBuilder->TBAA = std::move(TBAA);
+
+ assert(NewBuilder->EmittedDeferredDecls.empty() &&
+ "Still have (unmerged) EmittedDeferredDecls deferred decls");
+
+ NewBuilder->EmittedDeferredDecls = std::move(EmittedDeferredDecls);
+}
diff --git a/clang/lib/CodeGen/CodeGenModule.h b/clang/lib/CodeGen/CodeGenModule.h
index aa57dc5a28d2..c939e7a309f5 100644
--- a/clang/lib/CodeGen/CodeGenModule.h
+++ b/clang/lib/CodeGen/CodeGenModule.h
@@ -1514,34 +1514,7 @@ class CodeGenModule : public CodeGenTypeCache {
/// Move some lazily-emitted states to the NewBuilder. This is especially
/// essential for the incremental parsing environment like Clang Interpreter,
/// because we'll lose all important information after each repl.
- void moveLazyEmissionStates(CodeGenModule *NewBuilder) {
- assert(DeferredDeclsToEmit.empty() &&
- "Should have emitted all decls deferred to emit.");
- assert(NewBuilder->DeferredDecls.empty() &&
- "Newly created module should not have deferred decls");
- NewBuilder->DeferredDecls = std::move(DeferredDecls);
-
- assert(NewBuilder->DeferredVTables.empty() &&
- "Newly created module should not have deferred vtables");
- NewBuilder->DeferredVTables = std::move(DeferredVTables);
-
- assert(NewBuilder->MangledDeclNames.empty() &&
- "Newly created module should not have mangled decl names");
- assert(NewBuilder->Manglings.empty() &&
- "Newly created module should not have manglings");
- NewBuilder->Manglings = std::move(Manglings);
-
- assert(WeakRefReferences.empty() &&
- "Not all WeakRefRefs have been applied");
- NewBuilder->WeakRefReferences = std::move(WeakRefReferences);
-
- NewBuilder->TBAA = std::move(TBAA);
-
- assert(NewBuilder->EmittedDeferredDecls.empty() &&
- "Still have (unmerged) EmittedDeferredDecls deferred decls");
-
- NewBuilder->EmittedDeferredDecls = std::move(EmittedDeferredDecls);
- }
+ void moveLazyEmissionStates(CodeGenModule *NewBuilder);
private:
llvm::Constant *GetOrCreateLLVMFunction(
More information about the cfe-commits
mailing list