summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* [VirtualFileSystem] InMemoryFileSystem::addFile(): Type and PermsBen Hamilton2017-11-093-15/+108
| | | | | | | | | | | | | | | | | | | | | | | Summary: This implements a FIXME in InMemoryFileSystem::addFile(), allowing clients to specify User, Group, Type, and/or Perms when creating a file in an in-memory filesystem. New tests included. Ran tests with: % ninja BasicTests && ./tools/clang/unittests/Basic/BasicTests Fixes PR#35172 (https://bugs.llvm.org/show_bug.cgi?id=35172) Reviewers: bkramer, hokein Reviewed By: bkramer, hokein Subscribers: alexfh Differential Revision: https://reviews.llvm.org/D39572 llvm-svn: 317800
* [clang-format] Keep Sphinx happy after r317794Krasimir Georgiev2017-11-092-10/+12
| | | | llvm-svn: 317799
* [clang-format] Sort using declarations by splitting on '::'Krasimir Georgiev2017-11-095-38/+140
| | | | | | | | | | | | | | Summary: This patch improves using declarations sorting. Reviewers: bkramer Reviewed By: bkramer Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D39786 llvm-svn: 317794
* [clang-format] Apply a clang-tidy suggestion, NFCKrasimir Georgiev2017-11-091-1/+1
| | | | llvm-svn: 317793
* [clang-format] Fix a clang-tidy finding, NFCKrasimir Georgiev2017-11-091-1/+1
| | | | llvm-svn: 317784
* [clang-format] Fix argument name comment, NFCKrasimir Georgiev2017-11-091-1/+1
| | | | llvm-svn: 317783
* [Tooling] Use FixedCompilationDatabase when `compile_flags.txt` is found.Sam McCall2017-11-095-2/+66
| | | | | | | | | | | | | | | | | | | | | Summary: This is an alternative to JSONCompilationDatabase for simple projects that don't use a build system such as CMake. (You can also drop one in ~, to make your tools use e.g. C++11 by default) There's no facility for varying flags per-source-file or per-machine. Possibly this could be accommodated backwards-compatibly using cpp, but even if not the simplicity seems worthwhile for the cases that are addressed. Tested with clangd, works great! (requires clangd restart) Reviewers: klimek Subscribers: ilya-biryukov, cfe-commits Differential Revision: https://reviews.llvm.org/D39799 llvm-svn: 317777
* Fix a bug with the use of __builtin_bzero in a conditional expression.John McCall2017-11-092-1/+14
| | | | | | Patch by Bharathi Seshadri! llvm-svn: 317776
* [X86] Rename the VEX scalar fma builtins to end with a '3' to match gccCraig Topper2017-11-093-24/+24
| | | | | | | | I think we need to use different builtins for the FMA4 instructions since those instructions zero the upper bits and FMA3 instructions pass the bits through. So this moves the existing builtins to be the FMA3 versions. New versions will be added for FMA4. llvm-svn: 317766
* [Coverage] Emit deferred regions in headersVedant Kumar2017-11-093-4/+22
| | | | | | | | | | | There are some limitations with emitting regions in macro expansions because we don't gather file IDs within the expansions. Fix the check that prevents us from emitting deferred regions in expansions to make an exception for headers, which is something we can handle. rdar://35373009 llvm-svn: 317760
* [Coverage] Complete top-level deferred regions before labelsVedant Kumar2017-11-093-7/+42
| | | | | | | | | | | | | | | | | | | The area immediately after a terminated region in the function top-level should have the same count as the label it precedes. This solves another problem with wrapped segments. Consider: 1| a: 2| return 0; 3| b: 4| return 1; Without a gap area starting after the first return, the wrapped segment from line 2 would make it look like line 3 is executed, when it's not. rdar://35373009 llvm-svn: 317759
* [Coverage] Emit a gap area after if conditionsVedant Kumar2017-11-0918-66/+97
| | | | | | | | | | | | | | | | | | | The area immediately after the closing right-paren of an if condition should have a count equal to the 'then' block's count. Use a gap region to set this count, so that region highlighting for the 'then' block remains precise. This solves a problem we have with wrapped segments. Consider: 1| if (false) 2| foo(); Without a gap area starting after the condition, the wrapped segment from line 1 would make it look like line 2 is executed, when it's not. rdar://35373009 llvm-svn: 317758
* Remove redundant copy-pasted comment in test file from r317736Alex Lorenz2017-11-081-1/+0
| | | | llvm-svn: 317737
* [ObjC] Fix function signature handling for blocks literals with attributesAlex Lorenz2017-11-082-2/+17
| | | | | | | | | | | | | | Block literals can have a type with attributes in its signature, e.g. ns_returns_retained. The code that inspected the type loc of the block when declaring its parameters didn't account for this fact, and only looked through paren type loc. This commit ensures that getAsAdjusted is used instead of IgnoreParens to find the block's FunctionProtoTypeLoc. This ensures that block parameters are declared correctly in the block and avoids the 'undeclared identifier' error. rdar://35416160 llvm-svn: 317736
* [ObjC] Boxed strings should use the nullability from stringWithUTF8String's ↵Alex Lorenz2017-11-082-0/+35
| | | | | | | | | | | | | | | | | | return type Objective-C NSString has a class method stringWithUTF8String that creates a new NSString from a C string. Objective-C box expression @(...) can be used to create an NSString instead of invoking the stringWithUTF8String method directly (The compiler lowers it down to the invocation though). This commit ensures that the type of @(string-value) gets the same nullability attributes as the return type of stringWithUTF8String to ensure that the diagnostics are consistent between the two. rdar://33847186 Differential Revision: https://reviews.llvm.org/D39762 llvm-svn: 317727
* [OPENMP] Codegen for `#pragma omp target parallel for`.Alexey Bataev2017-11-0812-202/+1521
| | | | llvm-svn: 317719
* Add a missing "REQUIRES: system-windows" to a Windows-only test.David L. Jones2017-11-081-0/+1
| | | | | | | This un-breaks builds on other platforms. Otherwise, they fail due to warnings like: warning: unable to find a Visual Studio installation; try running Clang from a developer command prompt [-Wmsvc-not-found] llvm-svn: 317716
* Add CoreOption flag to "-coverage" option to make it available for clang-clMarco Castelluccio2017-11-082-1/+8
| | | | | | | | | | | | | | | | Summary: The -coverage option is not a CoreOption, so it is not available to clang-cl. This patch adds the CoreOption flag to "-coverage" to allow it to be used with clang-cl. Reviewers: rnk Reviewed By: rnk Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D38221 llvm-svn: 317709
* [bindings] fix TLS test failureMasud Rahman2017-11-081-4/+14
| | | | | | | | | | | | | | | Since cfe commit r237337, '__declspec(thread)' and 'thread_local' have been the same since MSVC 2015. i.e. they are both considered to supply a dynamic TLS kind, not a static TLS kind. This test originally did not specify which version of MS compatibility to assume. As a result, the test was brittle, since changing the default compatibility version could break the test. This commit adds a specific version when building up the flags used to parse the translation unit, and tests both versions. llvm-svn: 317706
* [analyzer] Fix a crash on logical operators with vectors.Artem Dergachev2017-11-082-0/+38
| | | | | | | | | | | | | | | | | Do not crash when trying to compute x && y or x || y where x and y are of a vector type. For now we do not seem to properly model operations with vectors. In particular, operations && and || on a pair of vectors are not short-circuit, unlike regular logical operators, so even our CFG is incorrect. Avoid the crash, add respective FIXME tests for later. Differential Revision: https://reviews.llvm.org/D39682 rdar://problem/34317663 llvm-svn: 317700
* [clang-refactor] Get rid of OccurrencesFinder in RenamingAction, NFCHaojian Wu2017-11-081-18/+9
| | | | | | | | | | | | | | | | | | Summary: The OccurrencesFinder is only used in RenameOccurrences to find symbol occurrences, there is no need to inherit RefactoringRule. Replace it with a single utility function to avoid code misleading. Reviewers: sammccall Reviewed By: sammccall Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D39796 llvm-svn: 317696
* Workaround reverse-iteration buildbot breakages. Filed PR35244.Ilya Biryukov2017-11-081-2/+3
| | | | | | | | | Clang's completion output is non-deterministic, causing test failures with turned on LLVM_REVERSE_ITERATION. The workaround is to use CHECK-DAGs for now, will remove them when PR35244 gets fixed. llvm-svn: 317687
* Avoid printing some redundant name qualifiers in completionIlya Biryukov2017-11-085-6/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Adjusted PrintingPolicy inside code completion to avoid printing some redundant name qualifiers. Before this change, typedefs that were written unqualified in source code were printed with qualifiers in completion. For example, in the following code struct foo { typedef int type; type method(); }; completion item for `method` had return type of `foo::type`, even though the original code used `type` without qualifiers. After this change, the completion item has return type `type`, as originally written in the source code. Note that this change does not suppress qualifiers written by the user. For example, in the following code typedef int type; struct foo { typedef int type; ::type method(foo::type); }; completion item for `method` has return type of `::type` and parameter type of `foo::type`, as originally written in the source code. Reviewers: arphaman, bkramer, klimek Reviewed By: arphaman Subscribers: mgorny, eraman, cfe-commits Differential Revision: https://reviews.llvm.org/D38538 llvm-svn: 317677
* Moved QualTypeNames.h from Tooling to AST.Ilya Biryukov2017-11-085-21/+21
| | | | | | | | | | | | | | | | | Summary: For code reuse in SemaCodeComplete. Note that the tests for QualTypeNames are still in Tooling as they use Tooling's common testing code. Reviewers: rsmith, saugustine, rnk, klimek, bkramer Reviewed By: rnk Subscribers: cfe-commits, mgorny Differential Revision: https://reviews.llvm.org/D39224 llvm-svn: 317676
* [clang-refactor] Introduce a new rename rule for qualified symbolsHaojian Wu2017-11-085-40/+157
| | | | | | | | | | | | | | Summary: Prototype of a new rename rule for renaming qualified symbol. Reviewers: arphaman, ioeric, sammccall Reviewed By: arphaman, sammccall Subscribers: jklaehn, cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D39332 llvm-svn: 317672
* [X86] Add masked vcvtps2ph builtins to CheckX86BuiltinFunctionCall.Craig Topper2017-11-081-0/+3
| | | | | | This ensures that only immediates that fit in 8-bits are used. This matches what we do for the unmasked versions. llvm-svn: 317664
* [Serialization] Fix some Clang-tidy modernize and Include What You Use ↵Eugene Zelenko2017-11-082-238/+317
| | | | | | warnings; other minor fixes (NFC). llvm-svn: 317648
* [AST] Fix some Clang-tidy modernize and Include What You Use warnings; other ↵Eugene Zelenko2017-11-085-191/+298
| | | | | | minor fixes (NFC). llvm-svn: 317644
* Change noplt.c to work for non-x86 targets.Sriraman Tallam2017-11-071-1/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D39759 llvm-svn: 317627
* [NVPTX] Implement __nvvm_atom_add_gen_d builtin.Justin Lebar2017-11-073-1/+34
| | | | | | | | | | | | | | | Summary: This just seems to have been an oversight. We already supported the f64 atomic add with an explicit scope (e.g. "cta"), but not the scopeless version. Reviewers: tra Subscribers: jholewinski, sanjoy, cfe-commits, llvm-commits, hiraditya Differential Revision: https://reviews.llvm.org/D39638 llvm-svn: 317623
* [ObjC++] Don't warn about pessimizing move for __block variablesAlex Lorenz2017-11-072-0/+47
| | | | | | rdar://33316951 llvm-svn: 317620
* Update SanitizerSpecialCaseList to use renamed functions in base class.Mitch Phillips2017-11-071-1/+1
| | | | | | | | | | | | Note: This change has a cyclical dependency on D39485. Both these changes must be submitted at the same time to avoid a build breakage. Reviewers: vlad.tsyrklevich Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D39486 llvm-svn: 317616
* New clang option -fno-plt which avoids the PLT and lazy binding while making ↵Sriraman Tallam2017-11-076-0/+30
| | | | | | | | external calls. Differential Revision: https://reviews.llvm.org/D39079 llvm-svn: 317605
* [refactor] rename field references in __builtin_offsetofAlex Lorenz2017-11-072-0/+44
| | | | | | rdar://33875453 llvm-svn: 317599
* Clang/libomptarget map interface flag renaming - NFC patchGeorge Rokos2017-11-071-41/+38
| | | | | | | | | | This patch renames some of the flag names of the clang/libomptarget map interface. The old names are slightly misleading, whereas the new ones describe in a better way what each flag is about. Only the macros within the enumeration are renamed, there is no change in functionality therefore there are no updated regression tests. Differential Revision: https://reviews.llvm.org/D39745 llvm-svn: 317598
* [index] __builtin_offset's field reference is located at the end locationAlex Lorenz2017-11-072-2/+2
| | | | | | The starting location is the location of the '.' llvm-svn: 317596
* [index] index field references in __builtin_offsetAlex Lorenz2017-11-072-0/+44
| | | | | | rdar://35109556 llvm-svn: 317593
* SystemZ Swift TargetInfo: swifterror support in the backend is brokenArnold Schwaighofer2017-11-071-1/+1
| | | | | | Return false for swifterror support until the backend is fixed. llvm-svn: 317589
* [CodeGen] split math and complex tests into separate files; NFCISanjay Patel2017-11-074-425/+418
| | | | | | | The files are already large, and we may need to add even more RUNs to distinguish differences based on OS, environment, or other platform things. llvm-svn: 317583
* [clang-refactor] Use ClangTool more explicitly by making refaroing actions ↵Eric Liu2017-11-071-126/+192
| | | | | | | | | | | | | | | | AST frontend actions. Summary: This is a refactoring change. NFC Reviewers: arphaman, hokein Reviewed By: arphaman, hokein Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D39675 llvm-svn: 317577
* [analyzer] pr34779: CStringChecker: Accept non-standard headers.Artem Dergachev2017-11-072-2/+14
| | | | | | | | | | | Do not crash when trying to define and call a non-standard strcpy(unsigned char *, unsigned char *) during analysis. At the same time, do not try to actually evaluate the call. Differential Revision: https://reviews.llvm.org/D39422 llvm-svn: 317565
* [docs] Add section 'Half-Precision Floating Point'Sjoerd Meijer2017-11-071-0/+43
| | | | | | | | | This documents the differences/interactions between _Float16 and __fp16 and is a companion change for the _Float16 type implementation (r312794). Differential Revision: https://reviews.llvm.org/D35295 llvm-svn: 317558
* [analyzer] [NFC] Remove unused typedef from SVals.hGeorge Karpenkov2017-11-071-3/+0
| | | | | | Differential Revision: https://reviews.llvm.org/D39620 llvm-svn: 317537
* Clarify the error message for unsupported aliases on DarwinAlex Lorenz2017-11-072-5/+2
| | | | | | rdar://35109556 llvm-svn: 317532
* [analyzer] Model correct dispatch_once() 'done' value in BodyFarmDevin Coughlin2017-11-062-261/+770
| | | | | | | | | | | | | | | | | | | | | | | The analyzer's BodyFarm models dispatch_once() by comparing the passed-in predicate against a known 'done' value. If the predicate does not have that value, the model updates the predicate to have that value and executes the passed in block. Unfortunately, the current model uses the wrong 'done' value: 1 instead of ~0. This interferes with libdispatch's static inline function _dispatch_once(), which enables a fast path if the block has already been executed. That function uses __builtin_assume() to tell the compiler that the done flag is set to ~0 on exit. When r302880 added modeling of __builtin_assume(), this caused the analyzer to assume 1 == ~0. This in turn caused the analyzer to never explore any code after a call to dispatch_once(). This patch regains the missing coverage by updating BodyFarm to use the correct 'done' value. rdar://problem/34413048 Differential Revision: https://reviews.llvm.org/D39691 llvm-svn: 317516
* Vary Windows toolchain selection by -fuse-ldDave Lee2017-11-063-1/+33
| | | | | | | | | | | | | | | | | Summary: This change allows binutils to be used for linking with MSVC. Currently, when using an MSVC target and `-fuse-ld=bfd`, the driver produces an invalid linker invocation. Reviewers: rnk, compnerd Reviewed By: compnerd Subscribers: smeenai, cfe-commits Differential Revision: https://reviews.llvm.org/D39509 llvm-svn: 317511
* [X86] Replace the mask cmpeq/cmple/cmplt/cmpgt/cmpge/cmpneq intrinsics with ↵Craig Topper2017-11-066-1877/+693
| | | | | | | | macros that just pass the right comparison predicate value to the regular cmp intrinsic. Remove mask cmpeq/cmpgt builtins that are now unused. This shortens the intrinsic headers a little and allows us to get rid of the cmpeq and cmpgt handling from CGBuiltin.cpp. llvm-svn: 317506
* [X86] Add 3dnow and 3dnowa to the list of valid target featuresMartin Storsjo2017-11-062-0/+18
| | | | | | | | These were missed in SVN r316783, which broke compiling mingw-w64 CRT. Differential Revision: https://reviews.llvm.org/D39631 llvm-svn: 317504
* [Parser] Fix TryParseLambdaIntroducer() error handlingJan Korous2017-11-062-14/+31
| | | | | | | | rdar://35066196 Differential Revision: https://reviews.llvm.org/D39419 llvm-svn: 317493
* [CodeGen] match new fast-math-flag method: isFast()Sanjay Patel2017-11-061-1/+1
| | | | | | | | This corresponds to LLVM commiti r317488: If that commit is reverted, this commit will also need to be reverted. llvm-svn: 317489
OpenPOWER on IntegriCloud