summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* Sema: provide an extension warning for enable_ifSaleem Abdulrasool2016-02-183-0/+54
| | | | | | | Clang implements an enable_if attribute as an extension. Hook up `-Wpedantic` to issue an extension usage warning when __enable_if__ is used. llvm-svn: 261192
* [Parse] Make sure we don't forget to diagnose typos in exprsDavid Majnemer2016-02-182-3/+12
| | | | | | | If ActOn*Op fails, we will forget to diagnose typos in the LHS of expressions. llvm-svn: 261191
* [sanitizer-coverage] allow -fsanitize-coverage=trace-pc w/o any other ↵Kostya Serebryany2016-02-183-57/+70
| | | | | | sanitizer and w/o ...=[func,bb,edge]. This makes this syntax a superset of the GCC's syntax llvm-svn: 261182
* [sanitizer-coverage] add a deprecation warning for -fsanitize-coverage=[1234]Kostya Serebryany2016-02-172-20/+25
| | | | llvm-svn: 261178
* Don't crash w/ a diagnostic range containing a null byteDavid Majnemer2016-02-172-3/+11
| | | | | | | | We prematurely ended the line at the null byte which caused us to crash down stream because we tried to reason about columns beyond the end of the line. llvm-svn: 261171
* Add 'nopartial' qualifier for availability attributes.Manman Ren2016-02-1715-29/+124
| | | | | | | | | | | | | | | | | | | | | | An optional nopartial can be placed after the platform name. int bar() __attribute__((availability(macosx,nopartial,introduced=10.12)) When deploying back to a platform version prior to when the declaration was introduced, with 'nopartial', Clang emits an error specifying that the function is not introduced yet; without 'nopartial', the behavior stays the same: the declaration is `weakly linked`. A member is added to the end of AttributeList to save the location of the 'nopartial' keyword. A bool member is added to AvailabilityAttr. The diagnostics for 'nopartial' not-yet-introduced is handled in the same way as we handle unavailable cases. Reviewed by Doug Gregor and Jordan Rose. rdar://23791325 llvm-svn: 261163
* [modules] Cache 'acceptable decl' lookups for namespaces. In projects withRichard Smith2016-02-173-0/+28
| | | | | | | | | | | | | | | | thousands of modules, each of which declares the same namespace, linearly scanning the redecl chain looking for a visible declaration (once for each leaf module, for each use) performs very poorly. Namespace visibility can only decrease when we leave a module during a module build step, and we never care *which* visible declaration of a namespace we find, so we can cache this very effectively. This results in a 35x speedup on one of our internal build steps (2m -> 3.5s), but is hard to unit test because it requires a very large number of modules. Ideas for a test appreciated! No functionality change intended other than the speedup. llvm-svn: 261161
* [sanitizer-coverage] implement -fsanitize-coverage=trace-pc. This is similar ↵Kostya Serebryany2016-02-177-2/+29
| | | | | | to trace-bb, but has a different API. We already use the equivalent flag in GCC for Linux kernel fuzzing. We may be able to use this flag with AFL too llvm-svn: 261159
* [CodeGen] Fix an assert in CodeGenFunction::EmitFunctionEpilogAkira Hatanaka2016-02-172-1/+54
| | | | | | | | | | | | | | The assert is triggered because isObjCRetainableType() is called on the canonicalized return type that has been stripped of the typedefs and attributes attached to it. To fix this assert, this commit gets the original return type from CurCodeDecl or BlockInfo and uses it instead of the canoicalized type. rdar://problem/24470031 Differential Revision: http://reviews.llvm.org/D16914 llvm-svn: 261151
* Enable SafeStack for CloudABI.Ed Schouten2016-02-173-0/+12
| | | | | | | | | | | | | | | | | Summary: I've got a patchset in my home directory to integrate support for SafeStack into CloudABI's C library. All of the CloudABI unit tests still seem to pass. Pretty sweet! This change adds the necessary changes to Clang to make -fsanitize=safe-stack work on CloudABI. Without it, passing this command line flag throws an error. Reviewers: eugenis, samsonov Differential Revision: http://reviews.llvm.org/D17243 llvm-svn: 261135
* Correct more typos in conditional expressionsDavid Majnemer2016-02-174-3/+24
| | | | | | | We didn't correctly handle some edge cases, causing us to bail out before correcting all the typos. llvm-svn: 261109
* [OPENMP] Fix tests incompatibility with ARM buildbots.Alexey Bataev2016-02-172-2/+2
| | | | llvm-svn: 261098
* [OPENMP 4.5] Codegen support for data members in 'firstprivate' clause.Alexey Bataev2016-02-1710-21/+218
| | | | | | Added codegen for captured data members in non-static member functions. llvm-svn: 261089
* [OpenCL] Added half type literal with suffix h.Anastasia Stulova2016-02-177-3/+42
| | | | | | | | | | | | | OpenCL Extension v1.2 s9.5 allows half precision floating point type literals with suffices h or H when cl_khr_fp16 is enabled. Example: half x = 1.0h; Patch by Liu Yaxun (Sam)! Differential Revision: http://reviews.llvm.org/D16865 llvm-svn: 261084
* [OPENMP] Fix handling loop-based directives with arrays.Alexey Bataev2016-02-172-68/+118
| | | | | | | Patch fixes possible problems with correct handling arrays as expressions in initialization, conditions etc in loop-based constructs. llvm-svn: 261080
* [cmake] Revert r260742 (and r260744) to improve order file support.Chandler Carruth2016-02-173-32/+11
| | | | | | | | | | This appears to be passing '-Wl,-order_file' to Linux link commands, which then causes the linker to silently, behind the scenes, write the output to 'rder_file' instead of somewhere else. Will work with Chris to figure out the proper support for this, but so far there are numerous people who can't get Clang to update when they build because of this. llvm-svn: 261054
* [AttrDocs.td] Fix up some reST syntax.Sean Silva2016-02-171-4/+4
| | | | llvm-svn: 261053
* Test simplificationXinliang David Li2016-02-171-3/+2
| | | | llvm-svn: 261047
* Restrengthen tests relaxed in r259955Xinliang David Li2016-02-172-1/+2
| | | | llvm-svn: 261046
* Teach clang to use the ThinLTO pipelineMehdi Amini2016-02-171-1/+2
| | | | | | | | | | | | | Summary: Use the new pipeline implemented in D17115 Reviewers: tejohnson Subscribers: joker.eph, cfe-commits Differential Revision: http://reviews.llvm.org/D17272 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 261045
* Improve diagnostics for ill-formed literal operator declarations.Richard Smith2016-02-175-99/+165
| | | | | | Patch by Erik Pilkington! llvm-svn: 261034
* [CUDA] pass debug options to ptxas.Artem Belevich2016-02-163-9/+22
| | | | | | | | | ptxas optimizations are disabled if we need to generate debug info as ptxas does not accept '-g' otherwise. Differential Revision: http://reviews.llvm.org/D17111 llvm-svn: 261018
* Missing semicolons are kind of important. Who knew?Aaron Ballman2016-02-161-1/+1
| | | | llvm-svn: 261009
* Add a nullPointerConstant() AST matcher to handle variations of null pointer ↵Aaron Ballman2016-02-164-0/+49
| | | | | | constants in one matcher. llvm-svn: 261008
* Stop using "template" when printing qualtype namesReid Kleckner2016-02-162-2/+9
| | | | | | | | | | | | | | | | Summary: The keyword "template" isn't necessary when printing a fully-qualified qualtype name, and, in fact, results in a syntax error if one tries to use it. So stop printing it. Reviewers: rsmith, rnk Subscribers: rnk, klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D17214 llvm-svn: 261005
* Exclude PCH/missing-file.cpp on Windows, it does not pass reliablyReid Kleckner2016-02-161-5/+4
| | | | | | | Tag the test with "REQUIRES: can-remove-opened-file", which is what we use for the similar test Modules/explicit-build-missing-file.cpp. llvm-svn: 260994
* [typo-correction] Apply name specifier corrections when forming a NNSReid Kleckner2016-02-162-0/+12
| | | | | | | | Previously we would leave behind the old name specifier prefix, which creates an invalid AST. Other callers of CorrectTypo update their CXXScopeSpec objects with the correction specifier if one is present. llvm-svn: 260993
* clang-cl: Expose -isystem.Nico Weber2016-02-162-1/+3
| | | | | | | | | | | | | Like cl.exe, clang-cl allows adding system include directories via the INCLUDE env var. Having a driver flag for this functionality is useful, so add this too. (In the future, we probably also want to have a flag alternative to VCINSTALLDIR as used in MSVCToolChain::getVisualStudioBinaries(), and a way to override the registry accesses in MSVCToolChain::getWindowsSDKDir() -- maybe -ivcroot= and -iwinsdkroot=?). llvm-svn: 260990
* [OPENMP] Allow to use compound assignment operators.Alexey Bataev2016-02-162-10/+54
| | | | | | Loop-based directives allow to use iterators as loop counters. Iterators are allowed to define their own operators. This patch allows to use compound assignment operators for iterators. llvm-svn: 260957
* [OPENMP] Improved handling of pseudo-captured expressions in OpenMP.Alexey Bataev2016-02-1612-209/+328
| | | | | | | | Expressions inside 'schedule'|'dist_schedule' clause must be captured in combined directives to avoid possible crash during codegen. Patch improves handling of such constructs llvm-svn: 260954
* [Frontend] Make sure WrapperFrontendAction updates CurrentInput after ↵Argyrios Kyrtzidis2016-02-161-1/+4
| | | | | | | | calling BeginSourceFileAction. I don't have a test case to add unfortunately. llvm-svn: 260937
* clang/test/Driver/ps4-linker-win.c: Tweak substitutions if %PATH% ends with ↵NAKAMURA Takumi2016-02-161-5/+5
| | | | | | '\\', or lit complains with "parser error". llvm-svn: 260929
* Simplify users of StringRef::{l,r}trim (clang) (NFC)Vedant Kumar2016-02-163-3/+3
| | | | | | | r260925 introduced a version of the *trim methods which is preferable when trimming a single kind of character. Update all users in clang. llvm-svn: 260927
* Remove unnecessary regex in the test cases I fixed in r260496.Akira Hatanaka2016-02-162-2/+2
| | | | llvm-svn: 260921
* Darwin: fix stdlib handling when CLANG_DEFAULT_STDLIB is setTim Northover2016-02-152-1/+1
| | | | | | | | | I'd accidentally skipped the CMake check in a premature optimisation. I'd also put the original test in completely the wrong place. Thanks Jonas Hahnfeld! llvm-svn: 260898
* PR26449: Tests for builtin_classify_type fixAndrey Bokhanko2016-02-152-0/+96
| | | | | | | | | In my previous commit (rL260881) I forget to svn add tests. This commit adds them. Differential Revision: http://reviews.llvm.org/D16846 llvm-svn: 260882
* PR26449: Fixes for bugs in __builtin_classify_type implementationAndrey Bokhanko2016-02-151-30/+126
| | | | | | | | | | | | | | | This patch fixes the following bugs in __builtin_classify_type implementation: 1) Support for member functions and fields 2) Same behavior as GCC in C mode (specifically, return integer_type_class for enums and pointer_type_class for function pointers and arrays). Behavior in C++ mode didn't changed. Also, it refactors the whole implementation, by replacing a sequence of if-else-if with a couple of switches. Differential Revision: http://reviews.llvm.org/D16846 llvm-svn: 260881
* [OPENMP] Remove extra sync barriers for 'firstprivate' clause.Alexey Bataev2016-02-155-43/+40
| | | | | | | Sync barrier will be emitted after generation of firstprivate variables only if one of the firstprivate vars is used in lastprivate clause. llvm-svn: 260877
* clangIndex requires LLVMIR as Core, since r260858 uses llvm/IR.NAKAMURA Takumi2016-02-151-0/+1
| | | | llvm-svn: 260874
* Add isAnyPointer() matchers. Register missing matchers.Felix Berger2016-02-153-0/+23
| | | | | | | | | | | | | Summary: The isAnyPointer() matcher is useful for http://reviews.llvm.org/D15623. Reviewers: alexfh, klimek Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D15819 llvm-svn: 260872
* Sema: prevent assertion on stack return checkingSaleem Abdulrasool2016-02-152-2/+26
| | | | | | | | | | | | | | In the case that the array indexing itself is within a type dependent context, bail out of the evaluation. We would previously try to symbolically evaluate the expression which would then try to evaluate a non-address expression as an address, triggering an assertion in Asserts builds. We only need to consider the array subscript expression itself as in the case that the base itself being type dependent is handled appropriately in EvalAddr. Resolves PR26599. llvm-svn: 260867
* [AST/index] Introduce an option 'SuppressTemplateArgsInCXXConstructors' in ↵Argyrios Kyrtzidis2016-02-157-7/+53
| | | | | | | | | | printing policy. Enable it for USRs and names when indexing. Forward references can have different template argument names; including them makes USRs and names unstable, since the name depends on whether we saw a forward reference or not. llvm-svn: 260866
* silence -Wreturn-type warningsSaleem Abdulrasool2016-02-153-0/+7
| | | | | | | | These codepaths would generate warnings with GCC on linux even though the switch was covered. Add llvm_unreachable markers to indicate that the switch should be covered. NFC. llvm-svn: 260865
* Sema: constify EvalAddr, EvalValSaleem Abdulrasool2016-02-151-139/+146
| | | | | | | Propagate const throughout these methods as they are non-mutating analyzers of state. NFC. llvm-svn: 260864
* [test/Index] Set a specific target for the test.Argyrios Kyrtzidis2016-02-141-1/+1
| | | | llvm-svn: 260861
* [index] Factor libclang's functionality to determing the mangled name of ↵Argyrios Kyrtzidis2016-02-1410-133/+286
| | | | | | symbols into the clangIndex library. llvm-svn: 260858
* Fix some typos in the clang docSylvestre Ledru2016-02-144-5/+5
| | | | llvm-svn: 260856
* As reported in https://llvm.org/bugs/show_bug.cgi?id=25496, on FreeBSD,Dimitry Andric2016-02-143-2/+27
| | | | | | | | | | | | | | | | C++ programs compiled for profiling (using `-pg`) should be linked with `-lc++_p` (or `-lstdc++_p`, depending on the `-stdlib=` setting), not with the regular C++ libraries. Add a `FreeBSD::AddCXXStdlibLibArgs()` override to handle this, and add a test case for it. While here, extend the test case for the proper passing of -lm and -lm_p. Reviewers: compnerd, davide, dws, emaste Reviewed By: compnerd Differential Revision: http://reviews.llvm.org/D16264 llvm-svn: 260851
* Don't leak the ASTUnit when done with testing.Benjamin Kramer2016-02-141-3/+2
| | | | | | Found by lsan. llvm-svn: 260850
* c-index-test: Fix libdeps corresponding to r260841.NAKAMURA Takumi2016-02-141-0/+3
| | | | llvm-svn: 260847
OpenPOWER on IntegriCloud