[PATCH] D51651: [ThinLTO] Fix memory corruption in ThinLTOCodeGenerator when CodeGenOnly was specified
Alex Borcan via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 4 15:23:45 PDT 2018
alexbdv updated this revision to Diff 163933.
https://reviews.llvm.org/D51651
Files:
include/llvm/LTO/legacy/ThinLTOCodeGenerator.h
lib/LTO/ThinLTOCodeGenerator.cpp
Index: lib/LTO/ThinLTOCodeGenerator.cpp
===================================================================
--- lib/LTO/ThinLTOCodeGenerator.cpp
+++ lib/LTO/ThinLTOCodeGenerator.cpp
@@ -818,14 +818,6 @@
optimizeModule(TheModule, *TMBuilder.create(), OptLevel, Freestanding);
}
-/**
- * Perform ThinLTO CodeGen.
- */
-std::unique_ptr<MemoryBuffer> ThinLTOCodeGenerator::codegen(Module &TheModule) {
- initTMBuilder(TMBuilder, Triple(TheModule.getTargetTriple()));
- return codegenModule(TheModule, *TMBuilder.create());
-}
-
/// Write out the generated object file, either from CacheEntryPath or from
/// OutputBuffer, preferring hard-link when possible.
/// Returns the path to the generated file in SavedObjectsDirectoryPath.
@@ -893,7 +885,7 @@
/*IsImporting*/ false);
// CodeGen
- auto OutputBuffer = codegen(*TheModule);
+ auto OutputBuffer = codegenModule(*TheModule, *TMBuilder.create());
if (SavedObjectsDirectoryPath.empty())
ProducedBinaries[count] = std::move(OutputBuffer);
else
Index: include/llvm/LTO/legacy/ThinLTOCodeGenerator.h
===================================================================
--- include/llvm/LTO/legacy/ThinLTOCodeGenerator.h
+++ include/llvm/LTO/legacy/ThinLTOCodeGenerator.h
@@ -299,11 +299,6 @@
*/
void optimize(Module &Module);
- /**
- * Perform ThinLTO CodeGen.
- */
- std::unique_ptr<MemoryBuffer> codegen(Module &Module);
-
/**@}*/
private:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D51651.163933.patch
Type: text/x-patch
Size: 1505 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180904/43c9ca5e/attachment-0001.bin>
More information about the llvm-commits
mailing list