summaryrefslogtreecommitdiffstats
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
* Driver: Update clang-interpreter example for r218938Justin Bogner2014-10-031-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@218942 91177308-0d34-0410-b5e6-96231b3b80d8
* unique_ptrify JobList::JobsDavid Blaikie2014-09-041-4/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217168 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix configure and make build of clang-interpreter.Iain Sandoe2014-09-031-2/+4
| | | | | | | | | Replaced 'jit' link component with 'mcjit'. Updated the required libraries. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217033 91177308-0d34-0410-b5e6-96231b3b80d8
* Reinstate "Update for llvm API change.""Eric Christopher2014-09-021-1/+0
| | | | | | This reinstates r215113. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216986 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215979 91177308-0d34-0410-b5e6-96231b3b80d8
* Update for llvm api change.Rafael Espindola2014-08-191-13/+15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215968 91177308-0d34-0410-b5e6-96231b3b80d8
* Recommit 213307: unique_ptr-ify ownership of ASTConsumers (reverted in r213325)David Blaikie2014-08-101-2/+3
| | | | | | | | After post-commit review and community discussion, this seems like a reasonable direction to continue, making ownership semantics explicit in the source using the type system. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215323 91177308-0d34-0410-b5e6-96231b3b80d8
* Temporarily Revert "Update for llvm API change."Eric Christopher2014-08-071-0/+1
| | | | | | This reverts commit 215113 to match the reversion in llvm. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215156 91177308-0d34-0410-b5e6-96231b3b80d8
* Update for llvm API change.Rafael Espindola2014-08-071-1/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215113 91177308-0d34-0410-b5e6-96231b3b80d8
* Use ELF in the clang-interpreter on windows.Rafael Espindola2014-07-241-1/+8
| | | | | | We don't support loading COFF files yet. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213893 91177308-0d34-0410-b5e6-96231b3b80d8
* Attempt at fixing the windows shared build.Rafael Espindola2014-07-241-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213881 91177308-0d34-0410-b5e6-96231b3b80d8
* Use MCJIT.Rafael Espindola2014-07-242-2/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213879 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the last use of llvm::ExecutionEngine::create.Rafael Espindola2014-07-241-2/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213869 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "unique_ptr-ify ownership of ASTConsumers"David Blaikie2014-07-171-3/+2
| | | | | | | | | This reverts commit r213307. Reverting to have some on-list discussion/confirmation about the ongoing direction of smart pointer usage in the LLVM project. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213325 91177308-0d34-0410-b5e6-96231b3b80d8
* unique_ptr-ify ownership of ASTConsumersDavid Blaikie2014-07-171-2/+3
| | | | | | | | | (after fixing a bug in MultiplexConsumer I noticed the ownership of the nested consumers was implemented with raw pointers - so this fixes that... and follows the source back to its origin pushing unique_ptr ownership up through there too) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213307 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213171 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213064 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] Give explicit dependencies to a couple of modules, ↵NAKAMURA Takumi2014-07-132-0/+18
| | | | | | PrintFunctionNames and SampleAnalyzerPlugin, for Win32.DLL. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212906 91177308-0d34-0410-b5e6-96231b3b80d8
* PrintFunctionNames/CMakeLists.txt: Fix a comment.NAKAMURA Takumi2014-07-131-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212905 91177308-0d34-0410-b5e6-96231b3b80d8
* Instantiate llvm::Registry<clang::PluginASTAction> in FrontendAction.cpp.NAKAMURA Takumi2014-07-111-1/+0
| | | | | | | - Plugins don't need to export _ZN4llvm8Registry*. - Win32.DLL cannot merge common symbols among DLLs. Static members in llvm::Registry should be instantiated in a parent. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212821 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212585 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212087 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212083 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208926 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix build break, replace take() with release().Ahmed Charles2014-03-091-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203390 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Replace OwningPtr include with <memory>.Ahmed Charles2014-03-091-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203389 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Remove the remaining uses of OwningPtr.Ahmed Charles2014-03-092-6/+6
| | | | | | Replace OwningArrayPtr with std::unique_ptr<T[]>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203388 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] Get rid of explicit dependencies to include/clang/*.inc and ↵NAKAMURA Takumi2014-02-212-20/+0
| | | | | | | | | | | | | | | | | | | introduce CLANG_TABLEGEN_TARGETS. This does; - clang_tablegen() adds each tblgen'd target to global property CLANG_TABLEGEN_TARGETS as list. - List of targets is added to LLVM_COMMON_DEPENDS. - all clang libraries and targets depend on generated headers. You might wonder this would be regression, but in fact, this is little loss. - Almost all of clang libraries depend on tblgen'd files and clang-tblgen. - clang-tblgen may cause short stall-out but doesn't cause unconditional rebuild. - Each library's dependencies to tblgen'd files might vary along headers' structure. It made hard to track and update *really optimal* dependencies. Each dependency to intrinsics_gen and ClangSACheckers is left as DEPENDS. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201842 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] Fix installation without CLANG_BUILD_EXAMPLESJordan Rose2014-02-201-0/+1
| | | | | | | | | | | | | | | | | | When CLANG_BUILD_EXAMPLES is not on we set the EXCLUDE_FROM_ALL directory property for the examples/ directory to tell CMake not to build them by default. The AddLLVM.cmake APIs are not aware of this and try to install targets that are not built. This does not cause an install-time error because CMake excludes the directory from the default installation. However, now that installation attaches targets to the LLVMExports export set CMake-based applications that find_package(LLVM) fail because the example plugin binary is not available. Tell the AddLLVM.cmake APIs to exclude the examples from installation by setting the EXCLUDE_FROM_ALL variable they check. Patch by Brad King! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201799 91177308-0d34-0410-b5e6-96231b3b80d8
* [examples] Add tablegen'd ClangCommentCommandList as a dependency for plugins.Jordan Rose2014-02-132-3/+2
| | | | | | | | Also, remove library dependencies for the sample analyzer-plugin. The only library changes that would require a rebuild should be in headers, which should already implicitly be marked as dependencies. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201350 91177308-0d34-0410-b5e6-96231b3b80d8
* [examples] Use loadable modules instead of shared libraries for Clang plugins.Jordan Rose2014-02-123-30/+3
| | | | | | This avoids linking in extra copies of, say, LLVMSupport. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201256 91177308-0d34-0410-b5e6-96231b3b80d8
* Expose the name of the checker producing each diagnostic message.Alexander Kornienko2014-02-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: In clang-tidy we'd like to know the name of the checker producing each diagnostic message. PathDiagnostic has BugType and Category fields, which are both arbitrary human-readable strings, but we need to know the exact name of the checker in the form that can be used in the CheckersControlList option to enable/disable the specific checker. This patch adds the CheckName field to the CheckerBase class, and sets it in the CheckerManager::registerChecker() method, which gets them from the CheckerRegistry. Checkers that implement multiple checks have to store the names of each check in the respective registerXXXChecker method. Reviewers: jordan_rose, krememek Reviewed By: jordan_rose CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2557 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201186 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] Suppress SampleAnalyzerPlugin w/o ENABLE_STATIC_ANALYZER.NAKAMURA Takumi2014-01-311-0/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200532 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] Parameterize MODULE and SHARED in add_clang_library().NAKAMURA Takumi2014-01-232-6/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199902 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't use PrintFunctionNames.exports on Windows.Nico Weber2013-12-301-3/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198187 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix typo in comment.Nico Weber2013-12-291-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198186 91177308-0d34-0410-b5e6-96231b3b80d8
* [cmake] Set in LLVM_EXPORTED_SYMBOL_FILE PrintFunctionNames/CMakeLists.txt.Nico Weber2013-12-291-0/+8
| | | | | | | | The corresponding Makefile sets it too. Also tweak add_clang_library to support LLVM_EXPORTED_SYMBOL_FILE for modules. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198185 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix getCustomDiagID() usage in example codeAlp Toker2013-12-211-3/+3
| | | | | | | This was setting a bad example. DiagIDs are a limited resource and the message argument is evaluated as a format string. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197855 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] Update target_link_libraries() and LLVM_LINK_COMPONENTS for each ↵NAKAMURA Takumi2013-12-103-27/+17
| | | | | | CMakeLists.txt. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196916 91177308-0d34-0410-b5e6-96231b3b80d8
* Add ObjCARCOpts to LINK_COMPONENTS.NAKAMURA Takumi2013-12-101-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196915 91177308-0d34-0410-b5e6-96231b3b80d8
* Add irreader to the component list, because ParseIR is called.Bill Wendling2013-10-191-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193032 91177308-0d34-0410-b5e6-96231b3b80d8
* 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190620 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unused header.Rafael Espindola2013-06-261-1/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184945 91177308-0d34-0410-b5e6-96231b3b80d8
* Use llvm::sys::fs::getMainExecutable.Rafael Espindola2013-06-261-4/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184915 91177308-0d34-0410-b5e6-96231b3b80d8
* Include PathV1.h only where it is used.Rafael Espindola2013-06-171-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184090 91177308-0d34-0410-b5e6-96231b3b80d8
* [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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183989 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177972 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172945 91177308-0d34-0410-b5e6-96231b3b80d8
* Use getProcessTriple in clang-interpreter.Peter Collingbourne2013-01-161-2/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172664 91177308-0d34-0410-b5e6-96231b3b80d8
* 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172323 91177308-0d34-0410-b5e6-96231b3b80d8