summaryrefslogtreecommitdiffstats
path: root/llvm/examples/Kaleidoscope/Chapter8
Commit message (Collapse)AuthorAgeFilesLines
* Move CodeGenFileType enum to Support/CodeGen.hReid Kleckner2019-11-131-1/+1
| | | | | | | Avoids the need to include TargetMachine.h from various places just for an enum. Various other enums live here, such as the optimization level, TLS model, etc. Data suggests that this change probably doesn't matter, but it seems nice to have anyway.
* [llvm] Migrate llvm::make_unique to std::make_uniqueJonas Devlieghere2019-08-151-13/+13
| | | | | | | | Now that we've moved to C++14, we no longer need the llvm::make_unique implementation from STLExtras.h. This patch is a mechanical replacement of (hopefully) all the llvm::make_unique instances across the monorepo. llvm-svn: 369013
* Rename F_{None,Text,Append} to OF_{None,Text,Append}. NFCFangrui Song2019-08-051-1/+1
| | | | | | F_{None,Text,Append} are kept for compatibility since r334221. llvm-svn: 367800
* Unbreak kaleidoscope example.Peter Collingbourne2018-05-211-1/+1
| | | | llvm-svn: 332908
* s/LLVM_ON_WIN32/_WIN32/, llvmNico Weber2018-04-291-1/+1
| | | | | | | | | | | | | | LLVM_ON_WIN32 is set exactly with MSVC and MinGW (but not Cygwin) in HandleLLVMOptions.cmake, which is where _WIN32 defined too. Just use the default macro instead of a reinvented one. See thread "Replacing LLVM_ON_WIN32 with just _WIN32" on llvm-dev and cfe-dev. No intended behavior change. This moves over all uses of the macro, but doesn't remove the definition of it in (llvm-)config.h yet. llvm-svn: 331127
* [Kaleidoscope] toy.cpp use after move fixPeter Szecsi2017-05-071-1/+1
| | | | | | | | | | The variable Proto is moved at the beginning of the codegen() function. According to the comment above, the pointed object should be used due the reference P. Differential Revision: https://reviews.llvm.org/D32939 llvm-svn: 302369
* Update Kaleidoscope tutorial and improve Windows supportMehdi Amini2017-02-111-5/+11
| | | | | | | | | | | | | | | Many quoted code blocks were not in sync with the actual toy.cpp files. Improve tutorial text slightly in several places. Added some step descriptions crucial to avoid crashes (like InitializeNativeTarget* calls). Solve/workaround problems with Windows (JIT'ed method not found, using custom and standard library functions from host process). Patch by: Moritz Kroll <moritz.kroll@gmx.de> Differential Revision: https://reviews.llvm.org/D29864 llvm-svn: 294870
* Use print() instead of dump() in codeMatthias Braun2017-01-281-2/+4
| | | | | | | The dump() functions are meant to be used in a debugger, code should typically use something like print(errs()); llvm-svn: 293365
* [Examples] Fix some Clang-tidy modernize-use-default and Include What You ↵Eugene Zelenko2016-11-181-6/+27
| | | | | | | | Use warnings; other minor fixes. Differential revision: https://reviews.llvm.org/D26433 llvm-svn: 287384
* New Kaleidoscope chapter: Creating object filesWilfred Hughes2016-07-022-328/+94
| | | | | | | | | | | | This new chapter describes compiling LLVM IR to object files. The new chaper is chapter 8, so later chapters have been renumbered. Since this brings us to 10 chapters total, I've also needed to rename the other chapters to use two digit numbering. Differential Revision: http://reviews.llvm.org/D18070 llvm-svn: 274441
* Fix some Clang-tidy modernize-use-bool-literals and Include What You Use ↵Eugene Zelenko2016-05-191-15/+40
| | | | | | | | warnings in examples; other minor fixes. Differential revision: http://reviews.llvm.org/D20397 llvm-svn: 270008
* Remove every uses of getGlobalContext() in LLVM (but the C API)Mehdi Amini2016-04-141-24/+20
| | | | | | | | | | | At the same time, fixes InstructionsTest::CastInst unittest: yes you can leave the IR in an invalid state and exit when you don't destroy the context (like the global one), no longer now. This is the first part of http://reviews.llvm.org/D19094 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 266379
* [Kaleidoscope] Fix 'Error' name clashes.Lang Hames2016-03-251-31/+31
| | | | llvm-svn: 264426
* Remove autoconf supportChris Bieneman2016-01-261-15/+0
| | | | | | | | | | | | | | | | Summary: This patch is provided in preparation for removing autoconf on 1/26. The proposal to remove autoconf on 1/26 was discussed on the llvm-dev thread here: http://lists.llvm.org/pipermail/llvm-dev/2016-January/093875.html "I felt a great disturbance in the [build system], as if millions of [makefiles] suddenly cried out in terror and were suddenly silenced. I fear something [amazing] has happened." - Obi Wan Kenobi Reviewers: chandlerc, grosbach, bob.wilson, tstellarAMD, echristo, whitequark Subscribers: chfast, simoncook, emaste, jholewinski, tberghammer, jfb, danalbert, srhines, arsenm, dschuff, jyknight, dsanders, joker.eph, llvm-commits Differential Revision: http://reviews.llvm.org/D16471 llvm-svn: 258861
* Fix Kaleidoscope example.Peter Collingbourne2015-11-051-1/+2
| | | | llvm-svn: 252222
* Update for llvm API change.Eric Christopher2015-10-151-2/+1
| | | | llvm-svn: 250375
* Fix Clang-tidy modernize-use-nullptr warnings in examples and include ↵Hans Wennborg2015-09-291-2/+3
| | | | | | | | | | directories; other minor cleanups. Patch by Eugene Zelenko! Differential Revision: http://reviews.llvm.org/D13172 llvm-svn: 248811
* Kaleidoscope: Prune __attribute__((used)). Some compilers wouldn't accept one.NAKAMURA Takumi2015-08-281-2/+2
| | | | llvm-svn: 246268
* Recommit r246175 - Add Kaleidoscope regression tests, with a fix to make sureLang Hames2015-08-272-4/+6
| | | | | | the kaleidoscope 'library' functions aren't dead-stripped in release builds. llvm-svn: 246201
* Revert r246175 to get builder green again.Lang Hames2015-08-272-4/+2
| | | | llvm-svn: 246185
* Add Kaleidoscope regression tests.Lang Hames2015-08-272-2/+4
| | | | | | These will be run if LLVM_BUILD_EXAMPLES is enabled. llvm-svn: 246175
* Kaleidoscope: Prune unused libdeps.NAKAMURA Takumi2015-08-271-2/+0
| | | | llvm-svn: 246126
* Kaleidoscope: Update libdeps corresponding to r246002.NAKAMURA Takumi2015-08-261-0/+1
| | | | llvm-svn: 246025
* Big Kaleidoscope tutorial update.Lang Hames2015-08-261-187/+128
| | | | | | | | | | | | | This commit switches the underlying JIT for the Kaleidoscope tutorials from MCJIT to a custom ORC-based JIT, KaleidoscopeJIT. This fixes a lot of the bugs in Kaleidoscope that were introduced when we deleted the legacy JIT. The documentation for Chapter 4, which introduces the JIT APIs, is updated to reflect the change. Also included are a number of C++11 modernizations and general cleanup. Where appropriate, the docs have been updated to reflect these changes too. llvm-svn: 246002
* [Kaleidoscope] Clang-format the Kaleidoscope tutorials.Lang Hames2015-08-191-76/+89
| | | | | | Also reduces changes between tutorial chapters. llvm-svn: 245472
* [Kaleidoscope] Start C++11'ifying the kaleidoscope tutorials.Lang Hames2015-08-181-179/+177
| | | | llvm-svn: 245322
* DI: Rewrite the DIBuilder local variable APIDuncan P. N. Exon Smith2015-07-311-3/+2
| | | | | | | | | | | | Replace the general `createLocalVariable()` with two more specific functions: `createParameterVariable()` and `createAutoVariable()`, and rewrite the documentation. Besides cleaning up the API, this avoids exposing the fake DWARF tags `DW_TAG_arg_variable` and `DW_TAG_auto_variable` to frontends, and is preparation for removing them completely. llvm-svn: 243764
* DI/Verifier: Fix argument bitrot in DILocalVariableDuncan P. N. Exon Smith2015-07-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | Add a verifier check that `DILocalVariable`s of tag `DW_TAG_arg_variable` always have a non-zero 'arg:' field, and those of tag `DW_TAG_auto_variable` always have a zero 'arg:' field. These are the only configurations that are properly understood by the backend. (Also, fix the bad examples in LangRef and test/Assembler, and fix the bug in Kaleidoscope Ch8.) A large number of testcases seem to have bitrotted their way forward from some ancient version of the debug info hierarchy that didn't have `arg:` parameters. If you have out-of-tree testcases that start failing in the verifier and you don't care enough to get the `arg:` right, you may have some luck just calling: sed -e 's/, arg: 0/, arg: 1/' or some such, but I hand-updated the ones in tree. llvm-svn: 243183
* Fix Kaleidoscope tuto: ExecutionEngine->getDataLayout() returns a refMehdi Amini2015-07-161-1/+1
| | | | | From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 242416
* 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-221-1/+1
| | | | | | Thanks to Dave Blaikie for catching this. llvm-svn: 235543
* [Kaleidoscope] Remove RTTI use from chapters 7 and 8.Lang Hames2015-04-223-6/+4
| | | | llvm-svn: 235541
* 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-111-16/+16
| | | | | | | | | | | | | | 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
* Rework r233647, "llvm/examples: Suppress building a few JIT examples."NAKAMURA Takumi2015-03-311-1/+1
| | | | | | It didn't work with "install". llvm-svn: 233708
* llvm/examples: Suppress building a few JIT examples.NAKAMURA Takumi2015-03-311-0/+2
| | | | | | 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-311-0/+1
| | | | llvm-svn: 233646
* Fix the build of the gold-plugin and examples.Rafael Espindola2015-03-041-1/+1
| | | | llvm-svn: 231279
* Make DataLayout Non-Optional in the ModuleMehdi Amini2015-03-041-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-021-0/+1
| | | | llvm-svn: 230926
* [PM] Update the examples to reflect the removal of theChandler Carruth2015-02-131-2/+2
| | | | | | | | | | | 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-131-1/+1
| | | | | | | | | | | | | | | | | | | | 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
* Re-sort the #include lines in bindings and examples which I managed toChandler Carruth2015-02-131-2/+2
| | | | | | miss previously. llvm-svn: 229089
OpenPOWER on IntegriCloud