summaryrefslogtreecommitdiffstats
path: root/clang/examples/clang-interpreter
Commit message (Collapse)AuthorAgeFilesLines
* Update clang-interpreter example to incorporate changes in ce2207abaf9.Lang Hames2020-01-291-1/+2
| | | | (cherry picked from commit b54aa053d3aeeab0cdaecb6286419138b7da5ef4)
* Fix the clang interpreter example which was broken by 4fc68b9b7f3e0.Lang Hames2019-12-051-3/+4
|
* Fixup build of clang-interpreter example after change in r370122.Douglas Yung2019-08-281-5/+1
| | | | | | This should fix the build failure on llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast. llvm-svn: 370151
* [Clang] Migrate llvm::make_unique to std::make_uniqueJonas Devlieghere2019-08-141-1/+1
| | | | | | | | | | 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. Differential revision: https://reviews.llvm.org/D66259 llvm-svn: 368942
* [ORC] Fix clang-interpreter example code broken by r368707.Douglas Yung2019-08-141-3/+4
| | | | llvm-svn: 368778
* Update the SimpleJIT class in the clang-interpreter example to use ORCv2.Lang Hames2019-07-181-44/+53
| | | | | | This will remove the ORCv1 deprecation warnings. llvm-svn: 366511
* cmake: Add CLANG_LINK_CLANG_DYLIB optionTom Stellard2019-07-031-1/+1
| | | | | | | | | | | | | | | | Summary: Setting CLANG_LINK_CLANG_DYLIB=ON causes clang tools to link against libclang_shared.so instead of the individual component libraries. Reviewers: mgorny, beanz, smeenai, phosek, sylvestre.ledru Subscribers: arphaman, cfe-commits, llvm-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D63503 llvm-svn: 365092
* [build] Rename clang-headers to clang-resource-headersShoaib Meenai2019-03-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The current install-clang-headers target installs clang's resource directory headers. This is different from the install-llvm-headers target, which installs LLVM's API headers. We want to introduce the corresponding target to clang, and the natural name for that new target would be install-clang-headers. Rename the existing target to install-clang-resource-headers to free up the install-clang-headers name for the new target, following the discussion on cfe-dev [1]. I didn't find any bots on zorg referencing install-clang-headers. I'll send out another PSA to cfe-dev to accompany this rename. [1] http://lists.llvm.org/pipermail/cfe-dev/2019-February/061365.html Reviewers: beanz, phosek, tstellar, rnk, dim, serge-sans-paille Subscribers: mgorny, javed.absar, jdoerfert, #sanitizers, openmp-commits, lldb-commits, cfe-commits, llvm-commits Tags: #clang, #sanitizers, #lldb, #openmp, #llvm Differential Revision: https://reviews.llvm.org/D58791 llvm-svn: 355340
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-192-8/+6
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* Link examples/clang-interpreter against clangSerializationKristof Umann2018-12-151-0/+1
| | | | llvm-svn: 349279
* Test commit - delete trailing space.Michael Platings2018-11-191-1/+1
| | | | llvm-svn: 347194
* Fix buildbots - update clang-interpreter to use Legacy ORC classes ↵Simon Pilgrim2018-10-161-3/+3
| | | | | | introduced in rL344572. llvm-svn: 344598
* Fix a clang::driver::ArgStringList usage I missed in rL344398. NFCI.Simon Pilgrim2018-10-121-1/+1
| | | | llvm-svn: 344400
* clang-interpreter: Add missing LLVM component ObjectFangrui Song2018-06-031-0/+1
| | | | llvm-svn: 333836
* Convert clang-interpreter to ORC JIT APIStephane Sezer2018-05-256-506/+84
| | | | | | | | | | | | | | Summary: This mostly re-uses code from the KaleidoscopeJIT example. Reviewers: ddunbar, lhames Reviewed By: lhames Subscribers: mgrang, alexshap, mgorny, xiaobai, cfe-commits Differential Revision: https://reviews.llvm.org/D45897 llvm-svn: 333302
* s/LLVM_ON_WIN32/_WIN32/, clangNico Weber2018-04-271-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. llvm-svn: 331069
* clang-interpreter example cmake fixLuke Cheeseman2018-03-211-1/+1
| | | | | | | | Add in a space when appending the export to the linker options. Without the space the export is appended onto whatever the last link option was, which might be a file. llvm-svn: 328092
* [CMake] Properly quote string arguments to quiet errors from r327528 when builtFrederich Munch2018-03-141-7/+7
| | | | | | with LLVM_ENABLE_EH and LLVM_ENABLE_RTTI. llvm-svn: 327531
* Expand clang-interpreter with example of throwing in and from the JIT for ↵Frederich Munch2018-03-148-49/+621
| | | | | | | | | | | | | | | | | | Windows64. Summary: Getting this to work is not particularly obvious, and having it as an example should be helpful. Portions of this could be placed into LLVM, but as a whole it seems necessary to do this a higher level. Reviewers: lhames, mehdi_amini Reviewed By: lhames Subscribers: mgrang, martell, cfe-commits, mgorny Differential Revision: https://reviews.llvm.org/D35103 llvm-svn: 327528
* [CMake] Use PRIVATE in target_link_libraries for executablesShoaib Meenai2017-12-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We currently use target_link_libraries without an explicit scope specifier (INTERFACE, PRIVATE or PUBLIC) when linking executables. Dependencies added in this way apply to both the target and its dependencies, i.e. they become part of the executable's link interface and are transitive. Transitive dependencies generally don't make sense for executables, since you wouldn't normally be linking against an executable. This also causes issues for generating install export files when using LLVM_DISTRIBUTION_COMPONENTS. For example, clang has a lot of LLVM library dependencies, which are currently added as interface dependencies. If clang is in the distribution components but the LLVM libraries it depends on aren't (which is a perfectly legitimate use case if the LLVM libraries are being built static and there are therefore no run-time dependencies on them), CMake will complain about the LLVM libraries not being in export set when attempting to generate the install export file for clang. This is reasonable behavior on CMake's part, and the right thing is for LLVM's build system to explicitly use PRIVATE dependencies for executables. Unfortunately, CMake doesn't allow you to mix and match the keyword and non-keyword target_link_libraries signatures for a single target; i.e., if a single call to target_link_libraries for a particular target uses one of the INTERFACE, PRIVATE, or PUBLIC keywords, all other calls must also be updated to use those keywords. This means we must do this change in a single shot. I also fully expect to have missed some instances; I tested by enabling all the projects in the monorepo (except dragonegg), and configuring both with and without shared libraries, on both Darwin and Linux, but I'm planning to rely on the buildbots for other configurations (since it should be pretty easy to fix those). Even after this change, we still have a lot of target_link_libraries calls that don't specify a scope keyword, mostly for shared libraries. I'm thinking about addressing those in a follow-up, but that's a separate change IMO. Differential Revision: https://reviews.llvm.org/D40823 llvm-svn: 319840
* Add LLVMOption to clang-interpreter, corresponding to r291938.NAKAMURA Takumi2017-01-141-0/+1
| | | | llvm-svn: 292007
* Reapply "IntrusiveRefCntPtr -> std::shared_ptr for CompilerInvocationBase ↵David Blaikie2017-01-061-1/+1
| | | | | | | | | | | | | | and CodeCompleteConsumer" Aleksey Shlypanikov pointed out my mistake in migrating an explicit unique_ptr to auto - I was expecting the function returned a unique_ptr, but instead it returned a raw pointer - introducing a leak. Thanks Aleksey! This reapplies r291184, reverted in r291249. llvm-svn: 291270
* Revert "Fix examples for recent shared_ptrification"David Blaikie2017-01-061-1/+1
| | | | | | | | | (should've rolled in to this revert of the CompilerInstance change in the first place... anyway) This reverts commit r291185. llvm-svn: 291252
* Fix examples for recent shared_ptrificationDavid Blaikie2017-01-051-1/+1
| | | | llvm-svn: 291185
* Remove autoconf supportChris Bieneman2016-01-261-28/+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 "This is the way [autoconf] ends Not with a bang but a whimper." -T.S. Eliot Reviewers: chandlerc, grosbach, bob.wilson, echristo Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D16472 llvm-svn: 258862
* Driver: Update clang-interpreter example for r218938Justin Bogner2014-10-031-2/+2
| | | | llvm-svn: 218942
* unique_ptrify JobList::JobsDavid Blaikie2014-09-041-4/+4
| | | | llvm-svn: 217168
* Fix configure and make build of clang-interpreter.Iain Sandoe2014-09-031-2/+4
| | | | | | | Replaced 'jit' link component with 'mcjit'. Updated the required libraries. llvm-svn: 217033
* Reinstate "Update for llvm API change.""Eric Christopher2014-09-021-1/+0
| | | | | | This reinstates r215113. llvm-svn: 216986
* Go back to having a takeModule instead of a getModule.Rafael Espindola2014-08-191-1/+1
| | | | | | | Returning a std::unique_ptr is more constrained. Thanks to David Blaikie for the suggestion. llvm-svn: 215979
* Update for llvm api change.Rafael Espindola2014-08-191-13/+15
| | | | llvm-svn: 215968
* Temporarily Revert "Update for llvm API change."Eric Christopher2014-08-071-0/+1
| | | | | | This reverts commit 215113 to match the reversion in llvm. llvm-svn: 215156
* Update for llvm API change.Rafael Espindola2014-08-071-1/+0
| | | | llvm-svn: 215113
* Use ELF in the clang-interpreter on windows.Rafael Espindola2014-07-241-1/+8
| | | | | | We don't support loading COFF files yet. llvm-svn: 213893
* Attempt at fixing the windows shared build.Rafael Espindola2014-07-241-0/+1
| | | | llvm-svn: 213881
* Use MCJIT.Rafael Espindola2014-07-242-2/+5
| | | | llvm-svn: 213879
* Remove the last use of llvm::ExecutionEngine::create.Rafael Espindola2014-07-241-2/+9
| | | | llvm-svn: 213869
* Make clang's rewrite engine a core featureAlp Toker2014-07-161-1/+1
| | | | | | | | | | | | | | | The rewrite facility's footprint is small so it's not worth going to these lengths to support disabling at configure time, particularly since key compiler features now depend on it. Meanwhile the Objective-C rewriters have been moved under the ENABLE_CLANG_ARCMT umbrella for now as they're comparatively heavy and still potentially worth excluding from lightweight builds. Tests are now passing with any combination of feature flags. The flags historically haven't been tested by LLVM's build servers so caveat emptor. llvm-svn: 213171
* Prune Redundant libdeps in CMake's target_link_libraries and LLVMBuild.txt.NAKAMURA Takumi2014-07-151-1/+0
| | | | | | I checked this with Release+Asserts on x86_64-mingw32. Please restore partially if this were overkill. llvm-svn: 213064
* clang-interpreter: don't check input file existence, we're in-processAlp Toker2014-07-091-0/+1
| | | | | | | | | | | | This flag is set by most other tools and avoids extra stat() calls. The frontend will diagnose anyway as it performs the check atomically while opening files at point of use. We could probably make Driver::CheckInputsExist default to false and only enable it in the main 'clang' binary, or even better only perform the checks if we know the tool is external but that needs more thought. llvm-svn: 212585
* clang-interpreter: use LLVM interpreter if JIT is unavailableAlp Toker2014-07-013-5/+6
| | | | | | | | | | Update the strategy in r212083 to try JIT first and otherwise fall back to the interpreter. This gives the best of both worlds and still builds fine with no targets enabled. Requires supporting changes from LLVM r212086. llvm-svn: 212087
* clang-interpreter: interpret instead of JITingAlp Toker2014-07-013-6/+6
| | | | | | | | | | | | | Fixes the build when no targets are selected, or no native target is built. This also better matches up with the description/title of the example and demonstrates how clang can be used to run C++ on constrained environments without file IO or executable memory permissions (e.g. iOS apps). A comment is added explaining how to extend the demo with JIT support as needed. llvm-svn: 212083
* Eliminate DefaultImageName from the Driver constructorAlp Toker2014-05-151-1/+1
| | | | | | | | | | | | All callers were passing in "a.out" or garbage so a sensible default works fine here as a cleanup. This also brings about the possibility of adapting the value based on the driver's compatibility mode in future. The setting can still be changed via Driver::DefaultImageName as needed. llvm-svn: 208926
* Fix build break, replace take() with release().Ahmed Charles2014-03-091-1/+1
| | | | llvm-svn: 203390
* [C++11] Replace OwningPtr include with <memory>.Ahmed Charles2014-03-091-1/+1
| | | | llvm-svn: 203389
* [C++11] Remove the remaining uses of OwningPtr.Ahmed Charles2014-03-091-5/+5
| | | | | | Replace OwningArrayPtr with std::unique_ptr<T[]>. llvm-svn: 203388
* [CMake] Update target_link_libraries() and LLVM_LINK_COMPONENTS for each ↵NAKAMURA Takumi2013-12-101-24/+7
| | | | | | CMakeLists.txt. llvm-svn: 196916
* Add ObjCARCOpts to LINK_COMPONENTS.NAKAMURA Takumi2013-12-101-1/+1
| | | | llvm-svn: 196915
* Add irreader to the component list, because ParseIR is called.Bill Wendling2013-10-191-2/+2
| | | | llvm-svn: 193032
* Move Compilation::PrintJob and PrintDiagnosticJob into Job::Print.Hans Wennborg2013-09-121-2/+2
| | | | | | | | | | | | | | | | | This moves the code to Job.cpp, which seems like a more natural fit, and replaces the "is this a JobList? is this a Command?" logic with a virtual function call. It also removes the code duplication between PrintJob and PrintDiagnosticJob and simplifies the code a little. There's no functionality change here, except that the Executable is now always printed within quotes, whereas it would previously not be quoted in crash reports, which I think was a bug. Differential Revision: http://llvm-reviews.chandlerc.com/D1653 llvm-svn: 190620
OpenPOWER on IntegriCloud