summaryrefslogtreecommitdiffstats
path: root/clang/tools
Commit message (Collapse)AuthorAgeFilesLines
* Replace uses of LLVM_FUNCTION_NAME with __func__, this was macro was removed ↵Erik Pilkington2016-10-203-4/+4
| | | | | | from llvm/Support in r284681 llvm-svn: 284690
* Disable a silly GCC diagnostic for combining a scanf length specifier with theRichard Smith2016-10-151-0/+10
| | | | | | | '*' specifier. Apparently the GNU folks want to discourage self-documenting code. llvm-svn: 284300
* [linux] When pre-reserving stack pages to work around broken address spaceRichard Smith2016-10-141-7/+35
| | | | | | | | layout for PIE binaries, ask the OS how much stack space is already in use to avoid stack overflow if we are run with more than 512K of combined command line arguments + environment variables. llvm-svn: 284271
* Store FileEntry::Filename as a StringRef instead of raw pointer (NFC)Mehdi Amini2016-10-101-3/+4
| | | | llvm-svn: 283815
* Turn cl::values() (for enum) from a vararg function to using C++ variadic ↵Mehdi Amini2016-10-081-2/+1
| | | | | | | | | | | | | | | template The core of the change is supposed to be NFC, however it also fixes what I believe was an undefined behavior when calling: va_start(ValueArgs, Desc); with Desc being a StringRef. Differential Revision: https://reviews.llvm.org/D25342 llvm-svn: 283671
* Minor cleanups in clang-format.el.Manuel Klimek2016-10-041-41/+48
| | | | | | | | | | | | | | | | | | - Enable lexical binding - Formatting - Enable file name completion for the clang-format-executable variable - Add a missing docstring - When available, use bufferpos-to-filepos and filepos-to-bufferpos. These functions given more precise mapping than byte-to-position and position-bytes. - Rename arguments of clang-format-region to match the docstring - Instead of binding local variables to nil and then assigning them, bind them directly to their values - Make use of the fact that insert-file-contents returns the number of characters it inserted - Use cl-destructuring-bind to make the code a bit shorter - Use standard iteration (dolist) instead of mapc with a lambda, which is more common and shorter - Remove a message that was most likely only present for debugging purposes Patch by Philipp Stephani. llvm-svn: 283206
* [cmake] Install 'clang-cpp' symlinkMichal Gorny2016-10-021-1/+1
| | | | | | | | | | | | | | | Install the 'clang-cpp' symlink used to spawn the preprocessor. The code handling this suffix is already included in Driver. FreeBSD is already creating such a symlink in ports, and a similar one was requested by Gentoo/FreeBSD team. The goal is to handle software that takes a C preprocessor via a variable but does not handle passing options correctly (i.e. 'clang -E' does not work). Bug: https://bugs.gentoo.org/478810 Differential Revision: https://reviews.llvm.org/D25161 llvm-svn: 283075
* [analyzer][scan-build-py] subprocess output handling reviewed in clang moduleLaszlo Nagy2016-09-243-100/+156
| | | | llvm-svn: 282317
* clang-format: Add an option to git-clang-format to diff between to commitsStephen Hines2016-09-221-50/+97
| | | | | | | | | | | | | | | | | | | | | Summary: When building pre-upload hooks using git-clang-format, it is useful to limit the scope to a diff of two commits (instead of from a commit against the working tree) to allow for less false positives in dependent commits. This change adds the option of specifying two git commits to git-clang-format when using the `--diff` flag, which uses a different strategy to diff (using `git-diff-tree` instead of `git-diff-index`), and runs clang-format against the second commit instead of the working directory. There is a slight backwards-incompatibility introduced with this change: if a filename matches a branch name or other commit-ish, then `git clang-format <commit> <file>` will no longer work as expected; use `git clang-format <commit> -- <file>` instead. Patch by Luis Hector Chavez! Reviewers: djasper, lodato Subscribers: lodato, cfe-commits, srhines Projects: #clang-c Differential Revision: https://reviews.llvm.org/D24319 llvm-svn: 282136
* clang-format VS plugin: upgrade the project files to VS2015Hans Wennborg2016-09-153-4/+6
| | | | | | | The plugin itself runs on previous VS versions, but this enables it to be built with VS2015. llvm-svn: 281648
* [analyzer] scan-build-py: Remove relative path hack for SATestsBuild.pyDevin Coughlin2016-09-142-26/+1
| | | | | | | | | | | | | | | | | Remove the relative path hack in scan-build-py that converts a fully qualified directory name and a fully qualified file path to a relative path before running the analyzer on a file. This hack is not needed: the bad interaction with SATestsBuild.py it was intended to address is actually the same underlying problem that r280768 fixed. Further, because the hack would always relativize paths, it caused SATestBuild.py to be unable to properly line up issues when the build system changed directory and then built a source file in a child directory but used a fully-qualified path for the source file. Differential Revision: https://reviews.llvm.org/D24470 llvm-svn: 281516
* ObjectiveC generics: Add ObjCTypeParamType in the type system.Manman Ren2016-09-131-0/+12
| | | | | | | | | | | | | | | | | We also need to add ObjCTypeParamTypeLoc. ObjCTypeParamType supports the representation of "T <protocol>" where T is a type parameter. Before this, we use TypedefType to represent the type parameter for ObjC. ObjCTypeParamType has "ObjCTypeParamDecl *OTPDecl" and it extends from ObjCProtocolQualifiers. It is a non-canonical type and is canonicalized to the underlying type with the protocol qualifiers. rdar://24619481 rdar://25060179 Differential Revision: http://reviews.llvm.org/D23079 llvm-svn: 281355
* clang-format: Add Java detection to git-clang-format.Stephen Hines2016-09-131-0/+1
| | | | | | | | | | | | | | Summary: This change adds "java" to the list of known extensions that clang-format supports. Patch by Luis Hector Chavez Reviewers: djasper Subscribers: srhines, cfe-commits Differential Revision: https://reviews.llvm.org/D24401 llvm-svn: 281294
* Handle empty message in static_asserts.Richard Trieu2016-09-131-2/+3
| | | | llvm-svn: 281287
* clang-format: Make emacs integration work with narrowed buffers.Daniel Jasper2016-09-121-1/+1
| | | | | | | | | Use (call-process region nil ...) instead of (point-min) so that the call works in narrowed buffers. Patch by Philipp Stephani, thank you! llvm-svn: 281203
* C++ Modules TS: Add parsing and some semantic analysis support forRichard Smith2016-09-081-0/+1
| | | | | | | export-declarations. These don't yet have an effect on name visibility; we still export everything by default. llvm-svn: 280999
* [clang-offload-bundler] Fix some Clang-tidy modernize-use-override and ↵Eugene Zelenko2016-09-071-80/+120
| | | | | | | | Include What You Use warnings; other minor fixes. Differential revision: https://reviews.llvm.org/D24165 llvm-svn: 280828
* [scan-build-py] Increase precision of timestamp in report directory nameDevin Coughlin2016-09-062-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | This commit improves compatibility with the perl version of scan-build. The perl version of scan-build produces output report directories with increasing lexicographic ordering. This ordering is relied on by the CmpRuns.py tool in utils/analyzer when comparing results for build commands with multiple steps. That tool tries to line up the output directory for each step between different runs of the analyzer based on the increasing directory name. The python version of scan-build uses file.mkdtemp() with a time stamp prefix to create report directories. The timestamp has a 1-second precision. This means that when analysis of a single build step takes less than a second the ordering property that CmpRuns.py expects will sometimes not hold, depending on the timing and the random suffix generated by mkdtemp(). Ultimately this causes CmpRuns to incorrectly correlate results from build steps and report spurious differences between runs. This commit increases the precision of the timestamp used in scan-build-py to the microsecond level. This approach still has the same underlying issue -- but in practice analysis of any build step is unlikely to take less than a millisecond. Differential Revision: https://reviews.llvm.org/D24163 llvm-svn: 280768
* [clang-cl] Check that we are in clang cl mode before enabling support for ↵Pierre Gousseau2016-09-061-1/+1
| | | | | | | | | | the CL environment variable. Checking for the type of the command line tokenizer should not be the criteria to enable support for the CL environment variable, this change checks that we are in clang-cl mode instead. Differential Revision: https://reviews.llvm.org/D23503 llvm-svn: 280702
* When we reach the end of a #include of a header of a local submodule that weRichard Smith2016-09-011-0/+8
| | | | | | | | | | textually included, create an ImportDecl just as we would if we reached a #include of any other modular header. This is necessary in order to correctly determine the set of variables to initialize for an imported module. This should hopefully make the modules selfhost buildbot green again. llvm-svn: 280409
* [clang-format-vim] Support vim linked against py3Luke Drummond2016-08-311-7/+11
| | | | | | | | | | | | clang-format.py previously only worked in vim compiled against python2. This patch adds the necessary syntax changes to make this work with vim linked against python3, which is now shipped by default for at least Ubuntu16 and Arch. Differential Revision: https://reviews.llvm.org/D23319 Subscribers: cfe-commits llvm-svn: 280240
* Fix memory leaks in clang-offload-bundlerVitaly Buka2016-08-251-9/+11
| | | | | | | | | | | | | | Summary: 1. Pair removed from StringMap was not destroyed 2. ObjectFile had no owner Reviewers: sfantao Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D23865 llvm-svn: 279722
* clang-offload-bundler: Update libdeps.NAKAMURA Takumi2016-08-241-3/+1
| | | | llvm-svn: 279641
* [Driver][OpenMP][CUDA] Add capability to bundle object files in sections of ↵Samuel Antao2016-08-241-7/+296
| | | | | | | | | | | | | | | | | | | the host binary format. Summary: This patch adds the capability to bundle object files in sections of the host binary using a designated naming convention for these sections. This patch uses the functionality of the object reader already in the LLVM library to read bundled files, and invokes clang with the incremental linking options to create bundle files. Bundling files involves creating an IR file with the contents of the bundle assigned as initializers of globals binded to the designated sections. This way the bundling implementation is agnostic of the host object format. The features added by this patch were requested in the RFC discussion in http://lists.llvm.org/pipermail/cfe-dev/2016-February/047547.html. Reviewers: echristo, tra, jlebar, hfinkel, ABataev, Hahnfeld Subscribers: mkuron, whchung, cfe-commits, andreybokhanko, Hahnfeld, arpith-jacob, carlo.bertolli, mehdi_amini, caomhin Differential Revision: https://reviews.llvm.org/D21851 llvm-svn: 279634
* clang-offload-bundler - offload files bundling/unbundling toolSamuel Antao2016-08-243-0/+701
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: One of the goals of programming models that support offloading (e.g. OpenMP) is to enable users to offload with little effort, by annotating the code with a few pragmas. I'd also like to save users the trouble of changing their existent applications' build system. So having the compiler always return a single file instead of one for the host and each target even if the user is doing separate compilation is desirable. This diff proposes a tool named clang-offload-bundler (happy to change the name if required) that is used to bundle files associated with the same user source file but different targets, or to unbundle a file into separate files associated with different targets. This tool supports the driver support for OpenMP under review in http://reviews.llvm.org/D9888. The tool is used there to enable separate compilation, so that the very first action on input files that are not source files is a "unbundling action" and the very last non-linking action is a "bundling action". The format of the bundled files is currently very simple: text formats are concatenated with comments that have a magic string and target identifying triple in between, and binary formats have a header that contains the triple and the offset and size of the code for host and each target. The goal is to improve this tool in the future to deal with archive files so that each individual file in the archive is properly dealt with. We see that archives are very commonly used in current applications to combine separate compilation results. So I'm convinced users would enjoy this feature. This tool can be used like this: `clang-offload-bundler -targets=triple1,triple2 -type=ii -inputs=a.triple1.ii,a.triple2.ii -outputs=a.ii` or `clang-offload-bundler -targets=triple1,triple2 -type=ii -outputs=a.triple1.ii,a.triple2.ii -inputs=a.ii -unbundle` I implemented the tool under clang/tools. Please let me know if something like this should live somewhere else. This patch is prerequisite for http://reviews.llvm.org/D9888. Reviewers: hfinkel, rsmith, echristo, chandlerc, tra, jlebar, ABataev, Hahnfeld Subscribers: whchung, caomhin, andreybokhanko, arpith-jacob, carlo.bertolli, mehdi_amini, guansong, Hahnfeld, cfe-commits Differential Revision: https://reviews.llvm.org/D13909 llvm-svn: 279632
* driver: Support checking for rlimits via cmake (when bootstrapping)Chris Bieneman2016-08-231-5/+3
| | | | | | | | | | | | | | | | | Summary: Add a cmake check for sys/resource.h and replace the __has_include() check with its result, in order to make it possible to use rlimits when building with compilers not supporting __has_include() -- i.e. when bootstrapping. // Please also re-apply dfcd52eb1d8e5d322404b40414cb7331c7380a8c (llvm-config.h fix) Patch by: Michał Górny Reviewers: rsmith, beanz Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D23744 llvm-svn: 279559
* [Driver] Remove unused #include of llvm/Support/config.hVedant Kumar2016-08-191-1/+0
| | | | | | | | This is a follow-up to r279112 (which removed the need for the header) and in the same spirit as r279035 (which attempted to un-break out-of-tree builds). llvm-svn: 279348
* Use __has_include rather than a configure-time macro to determine ifRichard Smith2016-08-181-2/+7
| | | | | | | | | <sys/resource.h> is available. This should fix out-of-tree builds, at the cost of not providing the higher rlimits to stage 1 clang when built with an old host compiler not implementing this feature yet (bootstrap builds should be fine, though). llvm-svn: 279112
* Revert "[Driver] Use llvm-config.h, not config.h to unbreak out-of-tree builds"Vedant Kumar2016-08-181-1/+1
| | | | | | | This reverts commit r279035. According to Richard Smith, llvm-config.h does not contain the right definitions. llvm-svn: 279097
* [libclang] Added missing entry for newly introduced ↵Cameron Desrochers2016-08-181-0/+1
| | | | | | 'clang_getAllSkippedRanges' to libclang.exports llvm-svn: 279092
* [libclang] Add clang_getAllSkippedRanges functionCameron Desrochers2016-08-181-0/+27
| | | | | | | | | | This complements the clang_getSkippedRanges function which returns skipped ranges filtered by a specific file. This function is useful when all the ranges are desired (and a lot more efficient than the equivalent of asking for the ranges file by file, since the implementation of clang_getSkippedRanges iterates over all ranges anyway). Differential Revision: https://reviews.llvm.org/D20132 llvm-svn: 279076
* Revert "[OpenMP] Sema and parsing for 'teams distribute simd’ pragma"Diana Picus2016-08-182-12/+0
| | | | | | | | | | | | | | | | | This reverts commit r279003 as it breaks some of our buildbots (e.g. clang-cmake-aarch64-quick, clang-x86_64-linux-selfhost-modules). The error is in OpenMP/teams_distribute_simd_ast_print.cpp: clang: /home/buildslave/buildslave/clang-cmake-aarch64-quick/llvm/include/llvm/ADT/DenseMap.h:527: bool llvm::DenseMapBase<DerivedT, KeyT, ValueT, KeyInfoT, BucketT>::LookupBucketFor(const LookupKeyT&, const BucketT*&) const [with LookupKeyT = clang::Stmt*; DerivedT = llvm::DenseMap<clang::Stmt*, long unsigned int>; KeyT = clang::Stmt*; ValueT = long unsigned int; KeyInfoT = llvm::DenseMapInfo<clang::Stmt*>; BucketT = llvm::detail::DenseMapPair<clang::Stmt*, long unsigned int>]: Assertion `!KeyInfoT::isEqual(Val, EmptyKey) && !KeyInfoT::isEqual(Val, TombstoneKey) && "Empty/Tombstone value shouldn't be inserted into map!"' failed. llvm-svn: 279045
* [Driver] Use llvm-config.h, not config.h to unbreak out-of-tree buildsVedant Kumar2016-08-181-1/+1
| | | | | | | | | | llvm/Config/config.h has intentionally been excluded from llvm installations (see: llvm/CMakeLists.txt). Un-break out-of-tree builds post-r278882 by switching to llvm-config.h, which is exported. Suggested by Will Dietz! llvm-svn: 279035
* [OpenMP] Sema and parsing for 'teams distribute simd’ pragmaKelvin Li2016-08-172-0/+12
| | | | | | | | | | This patch is to implement sema and parsing for 'teams distribute simd’ pragma. This patch is originated by Carlo Bertolli. Differential Revision: https://reviews.llvm.org/D23528 llvm-svn: 279003
* Add missing close brace to fix Windows bots. Oops :(Richard Smith2016-08-171-1/+1
| | | | llvm-svn: 278891
* If possible, set the stack rlimit to at least 8MiB on cc1 startup, and workRichard Smith2016-08-171-0/+65
| | | | | | | | | | | | | | | | | | | | | around a Linux kernel bug where the actual amount of available stack may be a *lot* lower than the rlimit. GCC also sets a higher stack rlimit on startup, but it goes all the way to 64MiB. We can increase this limit if it proves necessary. The kernel bug is as follows: Linux kernels prior to version 4.1 may choose to map the process's heap as little as 128MiB before the process's stack for a PIE binary, even in a 64-bit virtual address space. This means that allocating more than 128MiB before you reach the process's stack high water mark can lead to crashes, even if you don't recurse particularly deeply. We work around the kernel bug by touching a page deep within the stack (after ensuring that we know how big it is), to preallocate virtual address space for the stack so that the kernel doesn't allow the brk() area to wander into it, when building clang as a Linux PIE binary. llvm-svn: 278882
* [CMake] Fixing typo in Info.plist generationChris Bieneman2016-08-161-1/+1
| | | | | | This is causing an error in the generation of the clang info plist. llvm-svn: 278850
* [Order Files] Don't use empty order filesChris Bieneman2016-08-111-2/+9
| | | | | | | | LD64 does optimization on symbol layouts that gets disabled whenever an order file is passed (even if it is empty). This change prevents disabling that optimization, and still enables iterative generation and usage of order files. If the order file is empty it does not setup the order file flags, instead it sets the empty order file as a configuration dependency. When the order file changes it will then trigger a re-configuration that adds the linker flag. llvm-svn: 278306
* Make clang-format remove duplicate headers when sorting #includes.Eric Liu2016-08-101-3/+2
| | | | | | | | | | | | Summary: When sorting #includes, #include directives that have the same text will be deduplicated when sorting #includes, and only the first #include in the duplicate #includes remains. If the `Cursor` is provided and put on a deleted #include, it will be put on the remaining #include in the duplicate #includes. Reviewers: djasper Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D23274 llvm-svn: 278206
* [OpenMP] Sema and parsing for 'teams distribute' pragmaKelvin Li2016-08-052-0/+11
| | | | | | | | This patch is to implement sema and parsing for 'teams distribute' pragma. Differential Revision: https://reviews.llvm.org/D23189 llvm-svn: 277818
* [analyzer] Fix execution permissions for the scan-build-py scripts.Artem Dergachev2016-08-017-0/+0
| | | | | | Differential Revision: https://reviews.llvm.org/D22969 llvm-svn: 277338
* Implement tooling::Replacements as a class.Eric Liu2016-08-011-4/+4
| | | | | | | | | | | | | | | | | | | Summary: - Implement clang::tooling::Replacements as a class to provide interfaces to control how replacements for a single file are combined and provide guarantee on the order of replacements being applied. - tooling::Replacements only contains replacements for the same file now. Use std::map<std::string, tooling::Replacements> to represent multi-file replacements. - Error handling for the interface change will be improved in followup patches. Reviewers: djasper, klimek Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D21748 llvm-svn: 277335
* scan-build: Add an option to show the description in the list of defectSylvestre Ledru2016-08-011-4/+28
| | | | | | | | | | | | | | | | Summary: This patch adds an option //--show-description// to add the defect description to the list of defect. This helps to get a better understanding of the defect without opening the page. For example, this is used for Firefox: https://people.mozilla.org/~sledru/reports/fx-scan-build/ Reviewers: rizsotto.mailinglist, zaks.anna Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D22810 llvm-svn: 277328
* [c-index-test] Make sure to check that clang_Cursor_getNumTemplateArguments ↵Argyrios Kyrtzidis2016-07-301-2/+5
| | | | | | did not return -1. llvm-svn: 277261
* [cc1as] Add MCTargetOptions argument to createAsmBackendJoel Jones2016-07-251-2/+4
| | | | | | | | | | | | | Allow an assembler backend to get ABI options. This is to match the changes to http://reviews.llvm.org/D16213. Tested with "make check-clang" Patch by: Joel Jones Differential Revision: https://reviews.llvm.org/D16538 llvm-svn: 276655
* P0217R3: Parsing support and framework for AST representation of C++1zRichard Smith2016-07-221-1/+3
| | | | | | | | | | | decomposition declarations. There are a couple of things in the wording that seem strange here: decomposition declarations are permitted at namespace scope (which we partially support here) and they are permitted as the declaration in a template (which we reject). llvm-svn: 276492
* [OpenMP] Sema and parsing for 'target simd' pragmaKelvin Li2016-07-202-0/+11
| | | | | | | | This patch is to implement sema and parsing for 'target simd' pragma. Differential Revision: https://reviews.llvm.org/D22479 llvm-svn: 276203
* Add missing header in ClangFuzzer (after r275882 cleanup)Mehdi Amini2016-07-181-0/+1
| | | | llvm-svn: 275906
* [NFC] Header cleanupMehdi Amini2016-07-1817-43/+14
| | | | | | | | | | Summary: Removed unused headers, replaced some headers with forward class declarations Patch by: Eugene <claprix@yandex.ru> Differential Revision: https://reviews.llvm.org/D20100 llvm-svn: 275882
* [ObjC] Implement @available in the Parser and ASTErik Pilkington2016-07-162-1/+7
| | | | | | | | | | | | | | | | This patch adds a new AST node: ObjCAvailabilityCheckExpr, and teaches the Parser and Sema to generate it. This node represents an availability check of the form: @available(macos 10.10, *); Which will eventually compile to a runtime check of the host's OS version. This is the first patch of the feature I proposed here: http://lists.llvm.org/pipermail/cfe-dev/2016-July/049851.html Differential Revision: https://reviews.llvm.org/D22171 llvm-svn: 275654
OpenPOWER on IntegriCloud