summaryrefslogtreecommitdiffstats
path: root/llvm/examples
Commit message (Collapse)AuthorAgeFilesLines
...
* Simplify the Mangler interface now that DataLayout is mandatory.Rafael Espindola2015-06-234-17/+13
| | | | | | | We only need to pass in a DataLayout when mangling a raw string, not when constructing the mangler. llvm-svn: 240405
* BrainF.cpp: Update CreateCall() according to r237624.NAKAMURA Takumi2015-05-191-1/+2
| | | | llvm-svn: 237669
* [Orc] Reapply r236465 with fixes for the MSVC bots.Lang Hames2015-05-051-8/+14
| | | | llvm-svn: 236506
* [Orc] Revert r236465 - It broke the Windows bots.Lang Hames2015-05-041-14/+8
| | | | | | | Looks like the usual missing explicit move-constructor issue with MSVC. I should have a fix shortly. llvm-svn: 236472
* [Orc] Refactor the compile-on-demand layer to make module partitioning lazy,Lang Hames2015-05-041-8/+14
| | | | | | | | | | | | | | | and avoid cloning unused decls into every partition. Module partitioning showed up as a source of significant overhead when I profiled some trivial test cases. Avoiding the overhead of partitionging for uncalled functions helps to mitigate this. This change also means that it is no longer necessary to have a LazyEmittingLayer underneath the CompileOnDemand layer, since the CompileOnDemandLayer will not extract or emit function bodies until they are called. llvm-svn: 236465
* IR: Give 'DI' prefix to debug info metadataDuncan P. N. Exon Smith2015-04-291-16/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Finish off PR23080 by renaming the debug info IR constructs from `MD*` to `DI*`. The last of the `DIDescriptor` classes were deleted in r235356, and the last of the related typedefs removed in r235413, so this has all baked for about a week. Note: If you have out-of-tree code (like a frontend), I recommend that you get everything compiling and tests passing with the *previous* commit before updating to this one. It'll be easier to keep track of what code is using the `DIDescriptor` hierarchy and what you've already updated, and I think you're extremely unlikely to insert bugs. YMMV of course. Back to *this* commit: I did this using the rename-md-di-nodes.sh upgrade script I've attached to PR23080 (both code and testcases) and filtered through clang-format-diff.py. I edited the tests for test/Assembler/invalid-generic-debug-node-*.ll by hand since the columns were off-by-three. It should work on your out-of-tree testcases (and code, if you've followed the advice in the previous paragraph). Some of the tests are in badly named files now (e.g., test/Assembler/invalid-mdcompositetype-missing-tag.ll should be 'dicompositetype'); I'll come back and move the files in a follow-up commit. llvm-svn: 236120
* [Kaleidoscope] Fix incorrect use of reinterpret_cast.Lang Hames2015-04-227-7/+7
| | | | | | Thanks to Dave Blaikie for catching this. llvm-svn: 235543
* [Kaleidoscope] Remove RTTI use from chapters 7 and 8.Lang Hames2015-04-226-12/+8
| | | | llvm-svn: 235541
* Fix up Exception demo from recent opaque pointer type changes to GEPDavid Blaikie2015-04-221-6/+7
| | | | llvm-svn: 235478
* DebugInfo: Fix Kaleidoscope Ch. 8 after r235327Duncan P. N. Exon Smith2015-04-201-2/+2
| | | | | | | Pretty sure the build was broken by r235327 (I updated it there, but apparently didn't check if it compiled). llvm-svn: 235353
* DebugInfo: Remove DIScopeDuncan P. N. Exon Smith2015-04-201-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. llvm-svn: 235327
* DebugInfo: Remove DIDescriptor from the DIBuilder APIDuncan P. N. Exon Smith2015-04-161-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. llvm-svn: 235111
* DebugInfo: Gut DIDescriptorDuncan P. N. Exon Smith2015-04-161-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`. llvm-svn: 235069
* DebugInfo: Remove unnecessary API from DIDerivedType and DITypeDuncan P. N. Exon Smith2015-04-151-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. llvm-svn: 235059
* DebugInfo: Gut DICompileUnit and DIFileDuncan P. N. Exon Smith2015-04-151-12/+12
| | | | | | | Continuing gutting `DIDescriptor` subclasses; this edition, `DICompileUnit` and `DIFile`. In the name of PR23080. llvm-svn: 235055
* DebugInfo: Add implicit conversion from DISubprogram to DIScopeDuncan P. N. Exon Smith2015-04-141-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...) llvm-svn: 234904
* Fixing a compile error with MSVC 2013 where there is no conversion from ↵Aaron Ballman2015-04-141-1/+1
| | | | | | DISubprogram to DIScope directly. llvm-svn: 234890
* Use 'override/final' instead of 'virtual' for overridden methodsAlexander Kornienko2015-04-117-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 llvm-svn: 234679
* [Orc] Update kaleidoscope tutorial for API change in r234669.Lang Hames2015-04-111-1/+1
| | | | llvm-svn: 234673
* llvm/examples/BrainF: Give an explicit pointee type to ↵NAKAMURA Takumi2015-04-021-1/+1
| | | | | | ConstantExpr::getGetElementPtr(ty...), according to r233938. llvm-svn: 233983
* Rework r233647, "llvm/examples: Suppress building a few JIT examples."NAKAMURA Takumi2015-03-313-3/+3
| | | | | | It didn't work with "install". llvm-svn: 233708
* llvm/examples: Suppress building a few JIT examples.NAKAMURA Takumi2015-03-313-0/+6
| | | | | | examples/ExceptionDemo/CMakeFiles/ExceptionDemo.dir/ExceptionDemo.cpp.o:(.data.rel.ro._ZTIN4llvm18MCJITMemoryManagerE[_ZTIN4llvm18MCJITMemoryManagerE]+0x10): undefined reference to `typeinfo for llvm::RuntimeDyld::MemoryManager' llvm-svn: 233647
* llvm/examples: Add RuntimeDyld as libdeps.NAKAMURA Takumi2015-03-315-0/+5
| | | | llvm-svn: 233646
* [MCJIT][Orc] Refactor RTDyldMemoryManager, weave RuntimeDyld::SymbolInfo throughLang Hames2015-03-304-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. llvm-svn: 233509
* Fix build.Rafael Espindola2015-03-251-1/+1
| | | | llvm-svn: 233171
* CMake: Disable ENABLE_EXPORTS for executables with MSVCReid Kleckner2015-03-181-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. llvm-svn: 232662
* Fix the build of the gold-plugin and examples.Rafael Espindola2015-03-046-6/+6
| | | | llvm-svn: 231279
* Make DataLayout Non-Optional in the ModuleMehdi Amini2015-03-0410-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> llvm-svn: 231270
* llvm/examples: Add missing include according to r230907.NAKAMURA Takumi2015-03-027-0/+7
| | | | llvm-svn: 230926
* [Orc][Kaleidoscope] More tutorial cleanup, a little extra debugging output.Lang Hames2015-02-262-23/+19
| | | | llvm-svn: 230705
* [Orc][Kaleidoscope] Fix a missed symbol mangling operation in the fully lazy ↵Lang Hames2015-02-261-1/+5
| | | | | | tutorial. llvm-svn: 230664
* [Orc][Kaleidoscope] More diff-reduction between tutorial versions.Lang Hames2015-02-261-2/+2
| | | | llvm-svn: 230658
* [Orc][Kaleidoscope] Clean up the Orc/Kaleidoscope tutorials to minimize the ↵Lang Hames2015-02-254-168/+187
| | | | | | | | diffs between them. llvm-svn: 230542
* [Orc][Kaleidoscope] Tidy up the lazy_irgen tutorial, touch up a couple ofLang Hames2015-02-232-31/+46
| | | | | | comments in the fully_lazy tutorial to minimize the diff between the two. llvm-svn: 230202
* [Orc][Kaleidoscope] Remove dead AST map in SessionContext.Lang Hames2015-02-231-2/+1
| | | | llvm-svn: 230201
* [Orc] Move Orc code into a namespace (llvm::orc), update Kaleidoscope code.Lang Hames2015-02-214-0/+8
| | | | | | NFC. llvm-svn: 230143
* [Orc][Kaleidoscope] Fix the orc/kaleidoscope tutorials on linux.Lang Hames2015-02-204-8/+12
| | | | llvm-svn: 229949
* [orcjit] Include CMake support for the fully_lazy example and fix the buildDavid Blaikie2015-02-193-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. llvm-svn: 229888
* [Orc][Kaleidoscope] Fix typo in tutorial comment.Lang Hames2015-02-191-1/+1
| | | | llvm-svn: 229821
* [Orc][Kaleidoscope] Make the 'fully lazy' orc kaleidoscope tutorial lazier ↵Lang Hames2015-02-191-26/+45
| | | | | | | | still. The new JIT doesn't IRGen stubs until they're referenced. llvm-svn: 229807
* [Orc][Kaleidoscope] Fix a fixme - no reason we can't use C++14 in the tutorials.Lang Hames2015-02-181-11/+14
| | | | llvm-svn: 229765
* [Orc][Kaleidoscope] Make the Orc/Kaleidoscope tutorials easier to build onLang Hames2015-02-184-12/+40
| | | | | | Darwin. llvm-svn: 229761
* [Orc][Kaleidoscope] Make sure to look for the mangled name when updating theLang Hames2015-02-181-1/+1
| | | | | | function body pointer in the fully lazy orc/kaleidoscope tutorial. llvm-svn: 229760
* [Orc][Kaleidoscope] Fix misnumbered steps in comments, plus tidy oneLang Hames2015-02-171-4/+4
| | | | | | explanation up a little. llvm-svn: 229467
* [Orc][Kaleidoscope] Add an example of extreme-laziness in Orc.Lang Hames2015-02-174-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. llvm-svn: 229466
* [Orc][Kaleidoscope] Update the MainLoop code of the orc/kaleidoscope tutorialsLang Hames2015-02-173-12/+12
| | | | | | to get rid of the duplicate prompt. NFC. llvm-svn: 229465
* [CMake] Add RuntimeDyld to libdeps corresponding to r229343.NAKAMURA Takumi2015-02-161-0/+1
| | | | llvm-svn: 229351
* Removing LLVM_DELETED_FUNCTION, as MSVC 2012 was the last reason for ↵Aaron Ballman2015-02-155-377/+377
| | | | | | requiring the macro. NFC; LLVM edition. llvm-svn: 229340
* [PM] Update the examples to reflect the removal of theChandler Carruth2015-02-136-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. llvm-svn: 229095
* [PM] Remove the old 'PassManager.h' header file at the top level ofChandler Carruth2015-02-1315-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". llvm-svn: 229094
OpenPOWER on IntegriCloud