summaryrefslogtreecommitdiff
path: root/examples
AgeCommit message (Collapse)AuthorFilesLines
2015-04-20DebugInfo: Fix Kaleidoscope Ch. 8 after r235327Duncan P. N. Exon Smith1-2/+2
Pretty sure the build was broken by r235327 (I updated it there, but apparently didn't check if it compiled). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235353 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-20DebugInfo: Remove DIScopeDuncan P. N. Exon Smith1-20/+20
Replace uses of `DIScope` with `MDScope*`. There was one spot where I've left an `MDScope*` uninitialized (where `DIScope` would have been default-initialized to `nullptr`) -- this is intentional, since the if/else that follows should unconditional assign it to a value. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235327 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-16DebugInfo: Remove DIDescriptor from the DIBuilder APIDuncan P. N. Exon Smith1-2/+2
As a step toward killing `DIDescriptor` and its subclasses, remove it from the `DIBuilder` API. Replace the subclasses with appropriate pointers from the new debug info hierarchy. There are a couple of possible surprises in type choices for out-of-tree frontends: - Subroutine types: `MDSubroutineType`, not `MDCompositeTypeBase`. - Composite types: `MDCompositeType`, not `MDCompositeTypeBase`. - Scopes: `MDScope`, not `MDNode`. - Generic debug info nodes: `DebugNode`, not `MDNode`. This is part of PR23080. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235111 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-16DebugInfo: Gut DIDescriptorDuncan P. N. Exon Smith1-1/+1
PR23080 is almost finished. With this commit, there's no consequential API in `DIDescriptor` and its subclasses. What's left? - Default-constructed to `nullptr`. - Handy `const_cast<>` (constructed from `const`, but accessors are non-`const`). I think the safe way to catch those is to delete the classes and fix compile errors. That'll be my next step, after I delete the `DITypeRef` (etc.) wrapper around `MDTypeRef`. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235069 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-15DebugInfo: Remove unnecessary API from DIDerivedType and DITypeDuncan P. N. Exon Smith1-1/+1
Remove the accessors of `DIDerivedType` that downcast to `MDDerivedType`, shifting the `cast<MDDerivedType>` into the callers. Also remove `DIType::isValid()`, which is really just a check against `nullptr` at this point. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235059 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-15DebugInfo: Gut DICompileUnit and DIFileDuncan P. N. Exon Smith1-12/+12
Continuing gutting `DIDescriptor` subclasses; this edition, `DICompileUnit` and `DIFile`. In the name of PR23080. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235055 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-14DebugInfo: Add implicit conversion from DISubprogram to DIScopeDuncan P. N. Exon Smith1-1/+1
As a follow-up to r234850, add an implicit conversion from `DISubprogram` to `DIScope` to support Kaleidoscope Ch. 8. This also reverts that band-aid from r234890. (/me learns *again* to build Kaleidoscope before commit...) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234904 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-14Fixing a compile error with MSVC 2013 where there is no conversion from ↵Aaron Ballman1-1/+1
DISubprogram to DIScope directly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234890 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-11Use 'override/final' instead of 'virtual' for overridden methodsAlexander Kornienko7-48/+48
The patch is generated using clang-tidy misc-use-override check. This command was used: tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py \ -checks='-*,misc-use-override' -header-filter='llvm|clang' \ -j=32 -fix -format http://reviews.llvm.org/D8925 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234679 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-11[Orc] Update kaleidoscope tutorial for API change in r234669.Lang Hames1-1/+1
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234673 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-02llvm/examples/BrainF: Give an explicit pointee type to ↵NAKAMURA Takumi1-1/+1
ConstantExpr::getGetElementPtr(ty...), according to r233938. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233983 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-31Rework r233647, "llvm/examples: Suppress building a few JIT examples."NAKAMURA Takumi3-3/+3
It didn't work with "install". git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233708 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-31llvm/examples: Suppress building a few JIT examples.NAKAMURA Takumi3-0/+6
examples/ExceptionDemo/CMakeFiles/ExceptionDemo.dir/ExceptionDemo.cpp.o:(.data.rel.ro._ZTIN4llvm18MCJITMemoryManagerE[_ZTIN4llvm18MCJITMemoryManagerE]+0x10): undefined reference to `typeinfo for llvm::RuntimeDyld::MemoryManager' git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233647 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-31llvm/examples: Add RuntimeDyld as libdeps.NAKAMURA Takumi5-0/+5
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233646 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-30[MCJIT][Orc] Refactor RTDyldMemoryManager, weave RuntimeDyld::SymbolInfo throughLang Hames4-46/+66
MCJIT. This patch decouples the two responsibilities of the RTDyldMemoryManager class, memory management and symbol resolution, into two new classes: RuntimeDyld::MemoryManager and RuntimeDyld::SymbolResolver. The symbol resolution interface is modified slightly, from: uint64_t getSymbolAddress(const std::string &Name); to: RuntimeDyld::SymbolInfo findSymbol(const std::string &Name); The latter passes symbol flags along with symbol addresses, allowing RuntimeDyld and others to reason about non-strong/non-exported symbols. The memory management interface removes the following method: void notifyObjectLoaded(ExecutionEngine *EE, const object::ObjectFile &) {} as it is not related to memory management. (Note: Backwards compatibility *is* maintained for this method in MCJIT and OrcMCJITReplacement, see below). The RTDyldMemoryManager class remains in-tree for backwards compatibility. It inherits directly from RuntimeDyld::SymbolResolver, and indirectly from RuntimeDyld::MemoryManager via the new MCJITMemoryManager class, which just subclasses RuntimeDyld::MemoryManager and reintroduces the notifyObjectLoaded method for backwards compatibility). The EngineBuilder class retains the existing method: EngineBuilder& setMCJITMemoryManager(std::unique_ptr<RTDyldMemoryManager> mcjmm); and includes two new methods: EngineBuilder& setMemoryManager(std::unique_ptr<MCJITMemoryManager> MM); EngineBuilder& setSymbolResolver(std::unique_ptr<RuntimeDyld::SymbolResolver> SR); Clients should use EITHER: A single call to setMCJITMemoryManager with an RTDyldMemoryManager. OR (exclusive) One call each to each of setMemoryManager and setSymbolResolver. This patch should be fully compatible with existing uses of RTDyldMemoryManager. If it is not it should be considered a bug, and the patch either fixed or reverted. If clients find the new API to be an improvement the goal will be to deprecate and eventually remove the RTDyldMemoryManager class in favor of the new classes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233509 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-25Fix build.Rafael Espindola1-1/+1
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233171 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-18CMake: Disable ENABLE_EXPORTS for executables with MSVCReid Kleckner1-1/+1
The MSVC linker won't produce a .lib file for an executable that doesn't export anything, and LLVM doesn't maintain dllexport annotations or .def files listing all C++ symbols. It also doesn't support exporting all symbols, like binutils ld. CMake 3.2 changed the Ninja generator to list both the .exe and .lib files as outputs of executable build targets. Ninja would always re-link executables with ENABLE_EXPORTS because the .lib output file was not present, and therefore the target was out of date. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232662 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-04Fix the build of the gold-plugin and examples.Rafael Espindola6-6/+6
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231279 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-04Make DataLayout Non-Optional in the ModuleMehdi Amini10-10/+4
Summary: DataLayout keeps the string used for its creation. As a side effect it is no longer needed in the Module. This is "almost" NFC, the string is no longer canonicalized, you can't rely on two "equals" DataLayout having the same string returned by getStringRepresentation(). Get rid of DataLayoutPass: the DataLayout is in the Module The DataLayout is "per-module", let's enforce this by not duplicating it more than necessary. One more step toward non-optionality of the DataLayout in the module. Make DataLayout Non-Optional in the Module Module->getDataLayout() will never returns nullptr anymore. Reviewers: echristo Subscribers: resistor, llvm-commits, jholewinski Differential Revision: http://reviews.llvm.org/D7992 From: Mehdi Amini <mehdi.amini@apple.com> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231270 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-02llvm/examples: Add missing include according to r230907.NAKAMURA Takumi7-0/+7
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230926 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-26[Orc][Kaleidoscope] More tutorial cleanup, a little extra debugging output.Lang Hames2-23/+19
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230705 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-26[Orc][Kaleidoscope] Fix a missed symbol mangling operation in the fully lazy ↵Lang Hames1-1/+5
tutorial. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230664 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-26[Orc][Kaleidoscope] More diff-reduction between tutorial versions.Lang Hames1-2/+2
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230658 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-25[Orc][Kaleidoscope] Clean up the Orc/Kaleidoscope tutorials to minimize the ↵Lang Hames4-168/+187
diffs between them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230542 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-23[Orc][Kaleidoscope] Tidy up the lazy_irgen tutorial, touch up a couple ofLang Hames2-31/+46
comments in the fully_lazy tutorial to minimize the diff between the two. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230202 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-23[Orc][Kaleidoscope] Remove dead AST map in SessionContext.Lang Hames1-2/+1
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230201 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-21[Orc] Move Orc code into a namespace (llvm::orc), update Kaleidoscope code.Lang Hames4-0/+8
NFC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230143 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-20[Orc][Kaleidoscope] Fix the orc/kaleidoscope tutorials on linux.Lang Hames4-8/+12
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229949 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-19[orcjit] Include CMake support for the fully_lazy example and fix the buildDavid Blaikie3-6/+8
Not sure if/how to make the CMake build use C++14 for the examples, so let's stick to C++11 for now. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229888 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-19[Orc][Kaleidoscope] Fix typo in tutorial comment.Lang Hames1-1/+1
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229821 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-19[Orc][Kaleidoscope] Make the 'fully lazy' orc kaleidoscope tutorial lazier ↵Lang Hames1-26/+45
still. The new JIT doesn't IRGen stubs until they're referenced. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229807 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-18[Orc][Kaleidoscope] Fix a fixme - no reason we can't use C++14 in the tutorials.Lang Hames1-11/+14
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229765 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-18[Orc][Kaleidoscope] Make the Orc/Kaleidoscope tutorials easier to build onLang Hames4-12/+40
Darwin. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229761 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-18[Orc][Kaleidoscope] Make sure to look for the mangled name when updating theLang Hames1-1/+1
function body pointer in the fully lazy orc/kaleidoscope tutorial. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229760 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-17[Orc][Kaleidoscope] Fix misnumbered steps in comments, plus tidy oneLang Hames1-4/+4
explanation up a little. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229467 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-17[Orc][Kaleidoscope] Add an example of extreme-laziness in Orc.Lang Hames4-0/+1454
The version of the tutorial uses the new compile callbacks API to inject stubs that trigger IRGen & Codegen of their respective function bodies when they are first called. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229466 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-17[Orc][Kaleidoscope] Update the MainLoop code of the orc/kaleidoscope tutorialsLang Hames3-12/+12
to get rid of the duplicate prompt. NFC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229465 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-16[CMake] Add RuntimeDyld to libdeps corresponding to r229343.NAKAMURA Takumi1-0/+1
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229351 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-15Removing LLVM_DELETED_FUNCTION, as MSVC 2012 was the last reason for ↵Aaron Ballman5-377/+377
requiring the macro. NFC; LLVM edition. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229340 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-13[PM] Update the examples to reflect the removal of theChandler Carruth6-29/+24
llvm/PassManager.h wrapper header and its using declarations. These now directly use the legacy namespace. I had updated the #include lines in my large commit but forgot that the examples weren't being built and didn't update the code to use the correct namespace. Sorry for the noise here. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229095 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-13[PM] Remove the old 'PassManager.h' header file at the top level ofChandler Carruth15-15/+15
LLVM's include tree and the use of using declarations to hide the 'legacy' namespace for the old pass manager. This undoes the primary modules-hostile change I made to keep out-of-tree targets building. I sent an email inquiring about whether this would be reasonable to do at this phase and people seemed fine with it, so making it a reality. This should allow us to start bootstrapping with modules to a certain extent along with making it easier to mix and match headers in general. The updates to any code for users of LLVM are very mechanical. Switch from including "llvm/PassManager.h" to "llvm/IR/LegacyPassManager.h". Qualify the types which now produce compile errors with "legacy::". The most common ones are "PassManager", "PassManagerBase", and "FunctionPassManager". git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229094 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-13Re-sort the #include lines in bindings and examples which I managed toChandler Carruth1-2/+2
miss previously. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229089 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-09[Orc] Add a JITSymbol class to the Orc APIs, refactor APIs, update clients.Lang Hames3-26/+26
This patch refactors a key piece of the Orc APIs: It removes the *::getSymbolAddress and *::lookupSymbolAddressIn methods, which returned target addresses (uint64_ts), and replaces them with *::findSymbol and *::findSymbolIn respectively, which return instances of the new JITSymbol type. Unlike the old methods, calling findSymbol or findSymbolIn does not cause the symbol to be immediately materialized when found. Instead, the symbol will be materialized if/when the getAddress method is called on the returned JITSymbol. This allows us to query for the existence of symbols without actually materializing them. In the future I expect more information to be attached to the JITSymbol class, for example whether the returned symbol is a weak or strong definition. This will allow us to properly handle weak symbols and multiple definitions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228557 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-08Kaleidoscope-Orc: Reuse the IRGen utility function in later chapters, and ↵David Blaikie3-20/+40
remove an unused parameter. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228543 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-08Kaleidoscope-Orc: Extract IRGen work into a utility function.David Blaikie1-7/+15
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228539 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-08Constify the Orc Kaleidoscope examples IRGen functions.David Blaikie3-66/+66
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228537 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-08[Orc][Kaleidoscope] Build Kaleidoscope/Orc tutorials with warnings.Lang Hames3-3/+3
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228531 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-08[Orc][Kaleidoscope] Remove fixed sized buffers from string conversion code andLang Hames3-77/+71
further c++ify the Kaleidoscope/Orc tutorials. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228530 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-08[CMake] Kaleidoscope-Orc: Update libdeps.NAKAMURA Takumi3-3/+6
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228524 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-08Add CMake build support for Orc examples (& fix some clang -Werror buildDavid Blaikie8-3/+38
breaks due to unused variables). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228520 91177308-0d34-0410-b5e6-96231b3b80d8