forked from OSchip/llvm-project
Revert "Reland "[CodeGen] Keep track info of lazy-emitted symbols in ModuleBuilder""
This reverts commit 781ee538da
.
Asan build is still broken :(
This commit is contained in:
parent
de6ba9704d
commit
44f0a2658d
|
@ -1486,33 +1486,6 @@ public:
|
|||
void printPostfixForExternalizedDecl(llvm::raw_ostream &OS,
|
||||
const Decl *D) const;
|
||||
|
||||
/// 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");
|
||||
std::swap(NewBuilder->DeferredDecls, DeferredDecls);
|
||||
|
||||
assert(NewBuilder->DeferredVTables.empty() &&
|
||||
"Newly created module should not have deferred vtables");
|
||||
std::swap(NewBuilder->DeferredVTables, 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");
|
||||
std::swap(NewBuilder->Manglings, Manglings);
|
||||
|
||||
assert(WeakRefReferences.empty() &&
|
||||
"Not all WeakRefRefs have been applied");
|
||||
std::swap(NewBuilder->WeakRefReferences, WeakRefReferences);
|
||||
|
||||
std::swap(NewBuilder->TBAA, TBAA);
|
||||
}
|
||||
|
||||
private:
|
||||
llvm::Constant *GetOrCreateLLVMFunction(
|
||||
StringRef MangledName, llvm::Type *Ty, GlobalDecl D, bool ForVTable,
|
||||
|
|
|
@ -134,14 +134,7 @@ namespace {
|
|||
llvm::LLVMContext &C) {
|
||||
assert(!M && "Replacing existing Module?");
|
||||
M.reset(new llvm::Module(ExpandModuleName(ModuleName, CodeGenOpts), C));
|
||||
|
||||
std::unique_ptr<CodeGenModule> OldBuilder = std::move(Builder);
|
||||
|
||||
Initialize(*Ctx);
|
||||
|
||||
if (OldBuilder)
|
||||
OldBuilder->moveLazyEmissionStates(Builder.get());
|
||||
|
||||
return M.get();
|
||||
}
|
||||
|
||||
|
|
|
@ -13,8 +13,4 @@ struct S { float f = 1.0; S *m = nullptr;} s;
|
|||
|
||||
auto r2 = printf("S[f=%f, m=0x%llx]\n", s.f, reinterpret_cast<unsigned long long>(s.m));
|
||||
// CHECK-NEXT: S[f=1.000000, m=0x0]
|
||||
|
||||
inline int foo() { return 42; }
|
||||
int r3 = foo();
|
||||
|
||||
quit
|
||||
|
|
Loading…
Reference in New Issue