summaryrefslogtreecommitdiffstats
path: root/clang/tools
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* [index] Create different USR if a property is a class property.Argyrios Kyrtzidis2016-07-151-1/+1
| | | | | | Avoids USR conflicts between class & instance properties of the same name. llvm-svn: 275630
* Frontend: Simplify ownership model for clang's output streams.Peter Collingbourne2016-07-151-1/+1
| | | | | | | | | | | | | | This changes the CompilerInstance::createOutputFile function to return a std::unique_ptr<llvm::raw_ostream>, rather than an llvm::raw_ostream implicitly owned by the CompilerInstance. This in most cases required that I move ownership of the output stream to the relevant ASTConsumer. The motivation for this change is to allow BackendConsumer to be a client of interfaces such as D20268 which take ownership of the output stream. Differential Revision: http://reviews.llvm.org/D21537 llvm-svn: 275507
* [OpenMP] Sema and parsing for 'target parallel for simd' pragmaKelvin Li2016-07-142-0/+12
| | | | | | | | This patch is to implement sema and parsing for 'target parallel for simd' pragma. Differential Revision: http://reviews.llvm.org/D22096 llvm-svn: 275365
* [OpenMP] Initial implementation of parse+sema for OpenMP clause ↵Carlo Bertolli2016-07-131-0/+3
| | | | | | | | 'is_device_ptr' of target http://reviews.llvm.org/D22070 llvm-svn: 275282
* [OpenMP] Initial implementation of parse+sema for clause use_device_ptr of ↵Carlo Bertolli2016-07-131-0/+3
| | | | | | | | | | | | | | 'target data' http://reviews.llvm.org/D21904 This patch is similar to the implementation of 'private' clause: it adds a list of private pointers to be used within the target data region to store the device pointers returned by the runtime. Please refer to the following document for a full description of what the runtime witll return in this case (page 10 and 11): https://github.com/clang-omp/OffloadingDesign I am happy to answer any question related to the runtime interface to help reviewing this patch. llvm-svn: 275271
* Make tooling::applyAllReplacements return llvm::Expected<string> instead of ↵Eric Liu2016-07-111-3/+6
| | | | | | | | | | | | | | | | empty string to indicate potential error. Summary: return llvm::Expected<> to carry error status and error information. This is the first step towards introducing "Error" into tooling::Replacements. Reviewers: djasper, klimek Subscribers: ioeric, klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D21601 llvm-svn: 275062
* [AST] Use ArrayRef in more interfacesDavid Majnemer2016-07-071-4/+2
| | | | | | | | | ArrayRef is a little better than passing around a pointer/length pair. No functional change is intended. llvm-svn: 274732
* [OpenMP] Sema and parsing for 'distribute simd' pragmaKelvin Li2016-07-062-0/+11
| | | | | | | | Summary: This patch is an implementation of sema and parsing for the OpenMP composite pragma 'distribute simd'. Differential Revision: http://reviews.llvm.org/D22007 llvm-svn: 274604
* [OpenMP] Sema and parse for 'distribute parallel for simd'Kelvin Li2016-07-052-0/+12
| | | | | | | | Summary: This patch is an implementation of sema and parsing for the OpenMP composite pragma 'distribute parallel for simd'. Differential Revision: http://reviews.llvm.org/D21977 llvm-svn: 274530
* [libclang] Sync-up the way top-level decls in an ASTUnit are handled with ↵Argyrios Kyrtzidis2016-07-012-32/+45
| | | | | | | | how decls in a DeclContext are handled. rdar://19775013 llvm-svn: 274378
* AMDGPU: Set amdgpu_kernel calling convention for OpenCL kernels.Nikolay Haustov2016-06-301-1/+1
| | | | | | | | | | | | | | | | | | Summary: Summary: Change Clang calling convention SpirKernel to OpenCLKernel. Set calling convention OpenCLKernel for amdgcn as well. Add virtual method .getOpenCLKernelCallingConv() to TargetCodeGenInfo and use it to set target calling convention for AMDGPU and SPIR. Update tests. Reviewers: rsmith, tstellarAMD, Anastasia, yaxunl Subscribers: kzhuravl, cfe-commits Differential Revision: http://reviews.llvm.org/D21367 llvm-svn: 274220
* P0136R1, DR1573, DR1645, DR1715, DR1736, DR1903, DR1941, DR1959, DR1991:Richard Smith2016-06-282-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace inheriting constructors implementation with new approach, voted into C++ last year as a DR against C++11. Instead of synthesizing a set of derived class constructors for each inherited base class constructor, we make the constructors of the base class visible to constructor lookup in the derived class, using the normal rules for using-declarations. For constructors, UsingShadowDecl now has a ConstructorUsingShadowDecl derived class that tracks the requisite additional information. We create shadow constructors (not found by name lookup) in the derived class to model the actual initialization, and have a new expression node, CXXInheritedCtorInitExpr, to model the initialization of a base class from such a constructor. (This initialization is special because it performs real perfect forwarding of arguments.) In cases where argument forwarding is not possible (for inalloca calls, variadic calls, and calls with callee parameter cleanup), the shadow inheriting constructor is not emitted and instead we directly emit the initialization code into the caller of the inherited constructor. Note that this new model is not perfectly compatible with the old model in some corner cases. In particular: * if B inherits a private constructor from A, and C uses that constructor to construct a B, then we previously required that A befriends B and B befriends C, but the new rules require A to befriend C directly, and * if a derived class has its own constructors (and so its implicit default constructor is suppressed), it may still inherit a default constructor from a base class llvm-svn: 274049
* Resubmission of http://reviews.llvm.org/D21564 after fixes.Carlo Bertolli2016-06-272-0/+12
| | | | | | | | | | | | | [OpenMP] Initial implementation of parse and sema for composite pragma 'distribute parallel for' This patch is an initial implementation for #distribute parallel for. The main differences that affect other pragmas are: The implementation of 'distribute parallel for' requires blocking of the associated loop, where blocks are "distributed" to different teams and iterations within each block are scheduled to parallel threads within each team. To implement blocking, sema creates two additional worksharing directive fields that are used to pass the team assigned block lower and upper bounds through the outlined function resulting from 'parallel'. In this way, scheduling for 'for' to threads can use those bounds. As a consequence of blocking, the stride of 'distribute' is not 1 but it is equal to the blocking size. This is returned by the runtime and sema prepares a DistIncrExpr variable to hold that value. As a consequence of blocking, the global upper bound (EnsureUpperBound) expression of the 'for' is not the original loop upper bound (e.g. in for(i = 0 ; i < N; i++) this is 'N') but it is the team-assigned block upper bound. Sema creates a new expression holding the calculation of the actual upper bound for 'for' as UB = min(UB, PrevUB), where UB is the loop upper bound, and PrevUB is the team-assigned block upper bound. llvm-svn: 273884
* Revert r273705Carlo Bertolli2016-06-242-12/+0
| | | | | | [OpenMP] Initial implementation of parse and sema for composite pragma 'distribute parallel for' llvm-svn: 273709
* [OpenMP] Initial implementation of parse and sema for composite pragma ↵Carlo Bertolli2016-06-242-0/+12
| | | | | | | | | | | | | | | 'distribute parallel for' http://reviews.llvm.org/D21564 This patch is an initial implementation for #distribute parallel for. The main differences that affect other pragmas are: The implementation of 'distribute parallel for' requires blocking of the associated loop, where blocks are "distributed" to different teams and iterations within each block are scheduled to parallel threads within each team. To implement blocking, sema creates two additional worksharing directive fields that are used to pass the team assigned block lower and upper bounds through the outlined function resulting from 'parallel'. In this way, scheduling for 'for' to threads can use those bounds. As a consequence of blocking, the stride of 'distribute' is not 1 but it is equal to the blocking size. This is returned by the runtime and sema prepares a DistIncrExpr variable to hold that value. As a consequence of blocking, the global upper bound (EnsureUpperBound) expression of the 'for' is not the original loop upper bound (e.g. in for(i = 0 ; i < N; i++) this is 'N') but it is the team-assigned block upper bound. Sema creates a new expression holding the calculation of the actual upper bound for 'for' as UB = min(UB, PrevUB), where UB is the loop upper bound, and PrevUB is the team-assigned block upper bound. llvm-svn: 273705
* Use more ArrayRefsDavid Majnemer2016-06-241-2/+2
| | | | | | No functional change is intended, just a small refactoring. llvm-svn: 273647
* Use ranges to concisely express iterationDavid Majnemer2016-06-231-11/+10
| | | | | | | No functional change is intended, this should just clean things up a little. llvm-svn: 273522
* cc1_main: Do not print statistics twice in -disable_free mode.Matthias Braun2016-06-151-2/+0
| | | | | | | | | | | | | | | llvm statistics are currently printed when the destructor of a "static ManagedStatic<StatisticInfo> StatInfo" in llvm runs. This destructor currently runs in each case as part of llvm_shutdown() which is run even in disable_free mode as part of main(). I assume that this hasn't always been the case. Removing the special code here avoids the statistics getting printed twice. Differential Revision: http://reviews.llvm.org/D21338 llvm-svn: 272820
* Revert accidential "[MSVC] Late parsing of in-class defined member functions ↵Alexey Bataev2016-06-152-6/+0
| | | | | | | | in template" This reverts commit 0253605771b8bd9d414aba74fe2742c730d6fd1a. llvm-svn: 272776
* [MSVC] Late parsing of in-class defined member functions in templateAlexey Bataev2016-06-152-0/+6
| | | | | | | | | | | | | | | | | | | classes. MSVC actively uses unqualified lookup in dependent bases, lookup at the instantiation point (non-dependent names may be resolved on things declared later) etc. and all this stuff is the main cause of incompatibility between clang and MSVC. Clang tries to emulate MSVC behavior but it may fail in many cases. clang could store lexed tokens for member functions definitions within ClassTemplateDecl for later parsing during template instantiation. It will allow resolving many possible issues with lookup in dependent base classes and removing many already existing MSVC-specific hacks/workarounds from the clang code. llvm-svn: 272774
* Make sizeof and alignof a CXCursor_UnaryExprOlivier Goffart2016-06-091-1/+1
| | | | | | | | So we can match sizeof expressions more accurately than with UnexposedExpr Differential Revision: http://reviews.llvm.org/D18081 llvm-svn: 272274
* CIndex: add support for static_assertOlivier Goffart2016-06-092-0/+11
| | | | | | Differential Revision: http://reviews.llvm.org/D18080 llvm-svn: 272273
* Update to match LLVM r272232.Richard Smith2016-06-099-23/+13
| | | | llvm-svn: 272233
* Indexer: add CXObjCPropertyAttr_class for class properties.Manman Ren2016-05-312-0/+3
| | | | | | rdar://25963227 llvm-svn: 271351
* [CMake] Update to requiring CMake 3.4.3Chris Bieneman2016-05-311-1/+1
| | | | | | | | | | | | | | Summary: This is as per the discussions on developer lists: http://lists.llvm.org/pipermail/llvm-dev/2016-April/098780.html http://lists.llvm.org/pipermail/llvm-dev/2016-May/100058.html Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D20823 llvm-svn: 271326
* clang-c: Add the clang_getCursorVisibility() APIEhsan Akhgari2016-05-313-0/+52
| | | | | | | | | This patch adds an API for querying the visibility of the entity referred to by a cursor. Patch by Michael Wu <mwu@mozilla.com>. llvm-svn: 271292
* Revert r253909 because it was committed with an incorrect messageEhsan Akhgari2016-05-313-52/+0
| | | | llvm-svn: 271291
* Handle -Wa,--mrelax-relocations=[no|yes].Rafael Espindola2016-05-291-0/+4
| | | | llvm-svn: 271162
* Apply clang-tidy's misc-move-constructor-init throughout Clang.Benjamin Kramer2016-05-272-3/+6
| | | | | | No functionality change intended, maybe a tiny performance improvement. llvm-svn: 270996
* Update for following LLVM commit.George Rimar2016-05-271-1/+1
| | | | | | | It will be: Recommit 270977 - [llvm-mc] - Teach llvm-mc to generate zlib styled compression sections. llvm-svn: 270985
* [OpenMP] Parsing and sema support for the from clauseSamuel Antao2016-05-261-0/+3
| | | | | | | | | | | | | | | Summary: The patch contains the parsing and sema support for the `from` clause. Patch based on the original post by Kelvin Li. Reviewers: hfinkel, carlo.bertolli, kkwli0, arpith-jacob, ABataev Subscribers: caomhin, cfe-commits Differential Revision: http://reviews.llvm.org/D18488 llvm-svn: 270882
* [OpenMP] Parsing and sema support for the to clauseSamuel Antao2016-05-261-0/+3
| | | | | | | | | | | | | | | Summary: The patch contains the parsing and sema support for the `to` clause. Patch based on the original post by Kelvin Li. Reviewers: carlo.bertolli, hfinkel, kkwli0, arpith-jacob, ABataev Subscribers: caomhin, cfe-commits Differential Revision: http://reviews.llvm.org/D18597 llvm-svn: 270880
* [OpenMP] Parsing and sema support for target update directiveSamuel Antao2016-05-262-0/+5
| | | | | | | | | | | | | | | Summary: This patch is to add parsing and sema support for `target update` directive. Support for the `to` and `from` clauses will be added by a different patch. This patch also adds support for other clauses that are already implemented upstream and apply to `target update`, e.g. `device` and `if`. This patch is based on the original post by Kelvin Li. Reviewers: hfinkel, carlo.bertolli, kkwli0, arpith-jacob, ABataev Subscribers: caomhin, cfe-commits Differential Revision: http://reviews.llvm.org/D15944 llvm-svn: 270878
* Update for llvm change.Rafael Espindola2016-05-181-6/+5
| | | | llvm-svn: 269910
* Enable support for __float128 in Clang and enable it on pertinent platformsNemanja Ivanovic2016-05-091-0/+2
| | | | | | | | | | | | | | | | | | This patch corresponds to reviews: http://reviews.llvm.org/D15120 http://reviews.llvm.org/D19125 It adds support for the __float128 keyword, literals and target feature to enable it. Based on the latter of the two aforementioned reviews, this feature is enabled on Linux on i386/X86 as well as SystemZ. This is also the second attempt in commiting this feature. The first attempt did not enable it on required platforms which caused failures when compiling type_traits with -std=gnu++11. If you see failures with compiling this header on your platform after this commit, it is likely that your platform needs to have this feature enabled. llvm-svn: 268898
OpenPOWER on IntegriCloud