Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(4917)

Issue 193064: [PATCH] Kill ModuleProvider and ghost linkage (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
14 years, 3 months ago by Jeffrey Yasskin
Modified:
14 years, 3 months ago
Reviewers:
llvm-commits
CC:
nlewycky1
Visibility:
Public.

Description

Fixes http://llvm.org/PR5737 and http://llvm.org/PR5735 by inverting the relationship between Modules and ModuleProviders. Because the "ModuleProvider" simply materializes GlobalValues now, and doesn't provide modules, it's renamed to "GVMaterializer". Code that used to need a ModuleProvider to materialize Functions can now materialize the Functions directly. Functions no longer use a magic linkage to record that they're materializable; they simply ask the GVMaterializer. Because the C ABI must never change, we can't remove LLVMModuleProviderRef or the functions that refer to it. Instead, because Module now exposes the same functionality ModuleProvider used to, we store a Module* in any LLVMModuleProviderRef and translate in the wrapper methods. We could make this slightly cleaner if we just typedef'ed LLVMModuleProviderRef to LLVMModuleRef, but that would break programs that currently refer to LLVMOpaqueModuleProvider* directly. Is that ok? Tested with `make BUILD_EXAMPLES=1 && make check-lit` Saves ~130 lines of code.

Patch Set 1 #

Total comments: 8

Patch Set 2 : Proofread and fix Nick's comments #

Patch Set 3 : Sync to r94432 #

Patch Set 4 : More proofreading and test for fixed PR5735 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+574 lines, -670 lines) Patch
M docs/tutorial/LangImpl4.html View 5 chunks +13 lines, -26 lines 0 comments Download
M docs/tutorial/LangImpl5.html View 2 chunks +3 lines, -7 lines 0 comments Download
M docs/tutorial/LangImpl6.html View 2 chunks +3 lines, -7 lines 0 comments Download
M docs/tutorial/LangImpl7.html View 2 chunks +3 lines, -7 lines 0 comments Download
M examples/BrainF/BrainFDriver.cpp View 1 chunk +0 lines, -1 line 0 comments Download
M examples/Fibonacci/fibonacci.cpp View 1 chunk +0 lines, -1 line 0 comments Download
M examples/HowToUseJIT/HowToUseJIT.cpp View 1 chunk +0 lines, -1 line 0 comments Download
M examples/Kaleidoscope/Chapter4/toy.cpp View 2 chunks +3 lines, -7 lines 0 comments Download
M examples/Kaleidoscope/Chapter5/toy.cpp View 2 chunks +3 lines, -7 lines 0 comments Download
M examples/Kaleidoscope/Chapter6/toy.cpp View 2 chunks +3 lines, -7 lines 0 comments Download
M examples/Kaleidoscope/Chapter7/toy.cpp View 2 chunks +3 lines, -7 lines 0 comments Download
M examples/ParallelJIT/ParallelJIT.cpp View 1 chunk +0 lines, -1 line 0 comments Download
M include/llvm-c/Core.h View 1 2 5 chunks +14 lines, -12 lines 0 comments Download
M include/llvm/Bitcode/Archive.h View 4 chunks +10 lines, -11 lines 0 comments Download
M include/llvm/Bitcode/ReaderWriter.h View 1 chunk +4 lines, -5 lines 0 comments Download
M include/llvm/ExecutionEngine/ExecutionEngine.h View 10 chunks +21 lines, -34 lines 0 comments Download
M include/llvm/GVMaterializer.h View 1 2 3 2 chunks +28 lines, -50 lines 0 comments Download
M include/llvm/GlobalValue.h View 1 3 chunks +27 lines, -8 lines 0 comments Download
M include/llvm/Module.h View 1 2 3 3 chunks +47 lines, -0 lines 0 comments Download
M include/llvm/PassManager.h View 3 chunks +3 lines, -10 lines 0 comments Download
M include/llvm/Support/IRReader.h View 2 chunks +17 lines, -22 lines 0 comments Download
M lib/Archive/Archive.cpp View 1 3 chunks +14 lines, -29 lines 0 comments Download
M lib/Archive/ArchiveInternals.h View 1 chunk +5 lines, -5 lines 0 comments Download
M lib/Archive/ArchiveReader.cpp View 1 4 chunks +19 lines, -19 lines 0 comments Download
M lib/Archive/ArchiveWriter.cpp View 3 chunks +6 lines, -6 lines 0 comments Download
M lib/AsmParser/LLParser.cpp View 1 2 1 chunk +0 lines, -1 line 0 comments Download
M lib/Bitcode/Reader/BitReader.cpp View 1 2 2 chunks +4 lines, -4 lines 0 comments Download
M lib/Bitcode/Reader/BitcodeReader.h View 1 2 3 7 chunks +19 lines, -18 lines 0 comments Download
M lib/Bitcode/Reader/BitcodeReader.cpp View 1 2 3 9 chunks +63 lines, -70 lines 0 comments Download
M lib/Bitcode/Writer/BitcodeWriter.cpp View 1 chunk +0 lines, -1 line 0 comments Download
M lib/ExecutionEngine/ExecutionEngine.cpp View 1 2 11 chunks +21 lines, -48 lines 0 comments Download
M lib/ExecutionEngine/ExecutionEngineBindings.cpp View 1 2 1 chunk +5 lines, -9 lines 0 comments Download
M lib/ExecutionEngine/Interpreter/Interpreter.h View 2 chunks +2 lines, -2 lines 0 comments Download
M lib/ExecutionEngine/Interpreter/Interpreter.cpp View 2 chunks +6 lines, -7 lines 0 comments Download
M lib/ExecutionEngine/JIT/JIT.h View 4 chunks +12 lines, -25 lines 0 comments Download
M lib/ExecutionEngine/JIT/JIT.cpp View 1 2 8 chunks +20 lines, -79 lines 0 comments Download
M lib/ExecutionEngine/JIT/JITEmitter.cpp View 1 2 1 chunk +1 line, -1 line 0 comments Download
M lib/ExecutionEngine/JIT/TargetSelect.cpp View 2 chunks +2 lines, -5 lines 0 comments Download
M lib/Linker/LinkArchives.cpp View 1 2 3 3 chunks +10 lines, -11 lines 0 comments Download
M lib/Target/ARM/ARMSubtarget.cpp View 1 chunk +3 lines, -3 lines 0 comments Download
M lib/Target/CppBackend/CPPBackend.cpp View 1 chunk +0 lines, -2 lines 0 comments Download
M lib/Target/PowerPC/PPCSubtarget.cpp View 1 chunk +1 line, -1 line 0 comments Download
M lib/Target/X86/X86Subtarget.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp View 1 2 1 chunk +0 lines, -2 lines 0 comments Download
M lib/Transforms/IPO/MergeFunctions.cpp View 1 chunk +0 lines, -1 line 0 comments Download
M lib/VMCore/AsmWriter.cpp View 1 2 1 chunk +0 lines, -2 lines 0 comments Download
M lib/VMCore/Core.cpp View 1 2 4 chunks +7 lines, -7 lines 0 comments Download
M lib/VMCore/GVMaterializer.cpp View 1 2 chunks +5 lines, -13 lines 0 comments Download
M lib/VMCore/Globals.cpp View 1 chunk +13 lines, -0 lines 0 comments Download
M lib/VMCore/Module.cpp View 1 2 3 chunks +48 lines, -1 line 0 comments Download
M lib/VMCore/Pass.cpp View 1 chunk +0 lines, -1 line 0 comments Download
M lib/VMCore/PassManager.cpp View 1 2 4 chunks +4 lines, -7 lines 0 comments Download
M lib/VMCore/Verifier.cpp View 1 2 4 chunks +6 lines, -7 lines 0 comments Download
M tools/llc/llc.cpp View 2 chunks +1 line, -3 lines 0 comments Download
M tools/lli/lli.cpp View 2 chunks +12 lines, -13 lines 0 comments Download
M tools/lto/LTOCodeGenerator.cpp View 1 2 2 chunks +1 line, -3 lines 0 comments Download
M tools/lto/LTOModule.cpp View 1 2 3 2 chunks +4 lines, -6 lines 0 comments Download
M tools/opt/opt.cpp View 1 2 2 chunks +1 line, -2 lines 0 comments Download
M unittests/ExecutionEngine/JIT/JITEventListenerTest.cpp View 1 chunk +0 lines, -1 line 0 comments Download
M unittests/ExecutionEngine/JIT/JITTest.cpp View 1 2 3 7 chunks +52 lines, -22 lines 0 comments Download

Messages

Total messages: 4
nlewycky1
TODO: I have not yet considered what it means to receive LLVMSetLinkage(... LLVMGhostLinkage) from a ...
14 years, 3 months ago (2010-01-23 02:08:16 UTC) #1
Jeffrey Yasskin
http://codereview.appspot.com/193064/diff/1/28 File lib/Linker/LinkArchives.cpp (right): http://codereview.appspot.com/193064/diff/1/28#newcode164 lib/Linker/LinkArchives.cpp:164: Module* aModule = *I; On 2010/01/23 02:08:17, nlewycky1 wrote: ...
14 years, 3 months ago (2010-01-25 19:19:27 UTC) #2
Jeffrey Yasskin
Please take a look. The major APi changes are in Module.h, GVMaterializer.h (moved from ModuleProvider.h), ...
14 years, 3 months ago (2010-01-26 23:44:33 UTC) #3
clattner_apple.com
14 years, 3 months ago (2010-01-27 01:19:29 UTC) #4
On Jan 26, 2010, at 3:44 PM, jyasskin@gmail.com wrote:

> Please take a look. The major APi changes are in Module.h,
> GVMaterializer.h (moved from ModuleProvider.h), and GlobalValue.h.
>
> The current version of the patch is at
> http://codereview.appspot.com/download/issue193064_2077.diff but I'll
> update the Rietveld issue instead of announcing new patches as I  
> address
> comments.

Looks pretty nice to me!  Major cleanup,

-Chris
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b