summaryrefslogtreecommitdiffstats
path: root/clang/examples/clang-interpreter
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Remove unused header.Rafael Espindola2013-06-261-1/+0
| | | | llvm-svn: 184945
* Use llvm::sys::fs::getMainExecutable.Rafael Espindola2013-06-261-4/+5
| | | | llvm-svn: 184915
* Include PathV1.h only where it is used.Rafael Espindola2013-06-171-0/+1
| | | | llvm-svn: 184090
* [Driver] Refactor clang driver to use LLVM's Option libraryReid Kleckner2013-06-141-1/+1
| | | | | | | | | | | | | | | | | | The big changes are: - Deleting Driver/(Arg|Opt)* - Rewriting includes to llvm/Option/ and re-sorting - 'using namespace llvm::opt' in clang::driver - Fixing the autoconf build by adding option everywhere As discussed in the review, this change includes using directives in header files. I'll make follow up changes to remove those in favor of name specifiers. Reviewers: espindola Differential Revision: http://llvm-reviews.chandlerc.com/D975 llvm-svn: 183989
* The IRReader header is now part of its own library. Update the includeChandler Carruth2013-03-261-0/+1
| | | | | | line and the library dependencies to reflect this. llvm-svn: 177972
* Nuke SetUpBuildDumpLog.Sean Silva2013-01-201-1/+1
| | | | | | | Also, it was the only reason that `argc` and `argv` were being passed into createDiagnostics, so remove those parameters and clean up callers. llvm-svn: 172945
* Use getProcessTriple in clang-interpreter.Peter Collingbourne2013-01-161-2/+1
| | | | llvm-svn: 172664
* Remove useless 'llvm::' qualifier from names like StringRef and others that areDmitri Gribenko2013-01-121-1/+1
| | | | | | brought into 'clang' namespace by clang/Basic/LLVM.h llvm-svn: 172323
* Rewrite #includes for llvm/Foo.h to llvm/IR/Foo.h as appropriate toChandler Carruth2013-01-021-1/+1
| | | | | | | | reflect the migration in r171366. Re-sort the #include lines to reflect the new paths. llvm-svn: 171369
* Sort the #include lines for examples/...Chandler Carruth2012-12-041-7/+6
| | | | llvm-svn: 169241
* Fix examples.Rafael Espindola2012-11-271-1/+1
| | | | llvm-svn: 168705
* Update clang-interpreter exampleDouglas Gregor2012-10-231-3/+4
| | | | llvm-svn: 166510
* Split library clangRewrite into clangRewriteCore and clangRewriteFrontend.Ted Kremenek2012-09-012-2/+3
| | | | | | | This is similar to how we divide up the StaticAnalyzer libraries to separate core functionality to what is clearly associated with Frontend actions. llvm-svn: 163050
OpenPOWER on IntegriCloud