summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* [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
* [clang-format] Handle unary operator overload with arguments and specifiersDaniel Jasper2017-11-062-1/+3
| | | | | | | | | | | | Before: int operator++(int)noexcept; After: int operator++(int) noexcept; Patch by Igor Sugak. Thank you! llvm-svn: 317473
* [Tooling] Test internal::createExecutorFromCommandLineArgsImpl instead of ↵Eric Liu2017-11-061-8/+8
| | | | | | the wrapper. llvm-svn: 317466
* lowering broadcastmJina Nahias2017-11-065-33/+82
| | | | | Change-Id: I0661abea3e3742860e0a03ff9e4fcdc367eff7db llvm-svn: 317456
* Remove \brief from doxygen comments in PrettyPrinter.hAdrian Prantl2017-11-051-39/+37
| | | | | | | | Patch by @xsga! Differential Revision: https://reviews.llvm.org/D39633 llvm-svn: 317443
* [clang-diff] NFC: formatJohannes Altmanninger2017-11-051-3/+3
| | | | llvm-svn: 317434
* [Sema] Document+test the -Wsign-conversion change for enums in C code [NFC]Roman Lebedev2017-11-042-1/+15
| | | | | | | | | | | | Basically a regression after r316268. However the diagnostic is correct, but the test coverage is bad. So just like rL316500, introduce yet more tests, and adjust the release notes. See https://bugs.llvm.org/show_bug.cgi?id=35200 llvm-svn: 317421
* Move the clang-tblgen-targets project into the Misc folder on IDEs like ↵Aaron Ballman2017-11-041-0/+1
| | | | | | Visual Studio rather than leave it in the root directory. NFC. llvm-svn: 317419
* Move the clang-tblgen project into the Clang tablegenning folder on IDEs ↵Aaron Ballman2017-11-041-0/+1
| | | | | | like Visual Studio rather than leave it in the root directory. NFC. llvm-svn: 317418
* Move the libclang-headers project into the Misc folder on IDEs like Visual ↵Aaron Ballman2017-11-041-0/+1
| | | | | | Studio rather than leave it in the root directory. NFC. llvm-svn: 317417
* [CodeGen] add remquo to list of recognized library callsSanjay Patel2017-11-042-4/+12
| | | | | | | | | | | | This is just an oversight because we already do recognize __builtin_remquo() with the same signature. http://en.cppreference.com/w/c/numeric/math/remquo http://pubs.opengroup.org/onlinepubs/9699919799/functions/remquo.html Differential Revision: https://reviews.llvm.org/D39615 llvm-svn: 317407
* CodeGenCXX: no default dllimport storage for mingwMartell Malone2017-11-042-2/+3
| | | | | | | | | | | GNU frontends don't have options like /MT, /MD This fixes a few link error regressions with libc++ and libc++abi Reviewers: rnk, mstorsjo, compnerd Differential Revision: https://reviews.llvm.org/D33620 llvm-svn: 317398
* [Driver] MinGW: Remove custom linker detectionMartell Malone2017-11-042-29/+2
| | | | | | | | | | | | | | | | | | This is a re-apply of rL313082 which was reverted in rL313088 In rL289668 the ability to specify the default linker at compile time was added but because the MinGW driver used custom detection we could not take advantage of this new CMAKE flag CLANG_DEFAULT_LINKER. rL289668 added no test cases and the mingw driver was either overlooked or purposefully skipped because it has some custom linker tests Removing them here because they are covered by the generic case. Reviewers: rnk Differntial Revision: https://reviews.llvm.org/D37727 llvm-svn: 317397
* Update ODR hashing testsRichard Trieu2017-11-041-120/+723
| | | | | | | | Add a mix of postive and negative tests to check that wrong Decls won't be flagged in the diagnostic. Split the check everything test and moved the pieces closer to where the related tests are. llvm-svn: 317394
* [Basic] Fix some Clang-tidy modernize and Include What You Use warnings; ↵Eugene Zelenko2017-11-037-170/+217
| | | | | | other minor fixes (NFC). llvm-svn: 317381
* Add -fcxx-exceptions for ExtractionSemicolonPolicy.cpp to appease PS4 botsAlex Lorenz2017-11-031-1/+1
| | | | llvm-svn: 317372
* Replace a use of std::for_each() with llvm::for_each(); NFC.Aaron Ballman2017-11-031-2/+1
| | | | llvm-svn: 317359
* Move Extract.cpp that wasn't moved in r317343Alex Lorenz2017-11-031-0/+0
| | | | llvm-svn: 317344
* [refactor][extract] insert semicolons into extracted/inserted codeAlex Lorenz2017-11-039-22/+450
| | | | | | | | | | | | | | | | | | when needed This commit implements the semicolon insertion logic into the extract refactoring. The following rules are used: - extracting expression: add terminating ';' to the extracted function. - extracting statements that don't require terminating ';' (e.g. switch): add terminating ';' to the callee. - extracting statements with ';': move (if possible) the original ';' from the callee and add terminating ';'. - otherwise, add ';' to both places. Differential Revision: https://reviews.llvm.org/D39441 llvm-svn: 317343
* [Driver] Add Scudo as a possible -fsanitize= optionKostya Kortchinsky2017-11-038-16/+101
| | | | | | | | | | | | | | | | | | | | | | Summary: This change adds Scudo as a possible Sanitizer option via -fsanitize=. This allows for easier static & shared linking of the Scudo library, it allows us to enforce PIE (otherwise the security of the allocator is moot), and check for incompatible Sanitizers combo. In its current form, Scudo is not compatible with any other Sanitizer, but the plan is to make it work in conjunction with UBsan (-fsanitize=scudo,undefined), which will require additional work outside of the scope of this change. Reviewers: eugenis, kcc, alekseyshl Reviewed By: eugenis, alekseyshl Subscribers: llvm-commits, srhines Differential Revision: https://reviews.llvm.org/D39334 llvm-svn: 317337
OpenPOWER on IntegriCloud