Commit Graph

71095 Commits

Author SHA1 Message Date
Ilya Biryukov cc3cf58cd2 Moved QualTypeNames.h from Tooling to AST.
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
2017-11-08 10:39:03 +00:00
Haojian Wu 200458f342 [clang-refactor] Introduce a new rename rule for qualified symbols
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
2017-11-08 08:56:56 +00:00
Craig Topper 23a302256a [X86] Add masked vcvtps2ph builtins to CheckX86BuiltinFunctionCall.
This ensures that only immediates that fit in 8-bits are used. This matches what we do for the unmasked versions.

llvm-svn: 317664
2017-11-08 04:54:26 +00:00
Eugene Zelenko b8c9e2aae5 [Serialization] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).
llvm-svn: 317648
2017-11-08 01:03:16 +00:00
Eugene Zelenko 0d00c89995 [AST] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).
llvm-svn: 317644
2017-11-08 00:39:18 +00:00
Sriraman Tallam fe34d6d8cd Change noplt.c to work for non-x86 targets.
Differential Revision: https://reviews.llvm.org/D39759

llvm-svn: 317627
2017-11-07 22:34:55 +00:00
Justin Lebar da9e0bd3a2 [NVPTX] Implement __nvvm_atom_add_gen_d builtin.
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
2017-11-07 22:10:54 +00:00
Alex Lorenz bbe51d86ec [ObjC++] Don't warn about pessimizing move for __block variables
rdar://33316951

llvm-svn: 317620
2017-11-07 21:40:11 +00:00
Mitch Phillips 512fa40b3e Update SanitizerSpecialCaseList to use renamed functions in base class.
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
2017-11-07 21:16:37 +00:00
Sriraman Tallam 5c65148565 New clang option -fno-plt which avoids the PLT and lazy binding while making external calls.
Differential Revision: https://reviews.llvm.org/D39079

llvm-svn: 317605
2017-11-07 19:37:51 +00:00
Alex Lorenz f4bf4227b7 [refactor] rename field references in __builtin_offsetof
rdar://33875453

llvm-svn: 317599
2017-11-07 18:30:23 +00:00
George Rokos 065755d23d Clang/libomptarget map interface flag renaming - NFC patch
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
2017-11-07 18:27:04 +00:00
Alex Lorenz 1c628e3c3e [index] __builtin_offset's field reference is located at the end location
The starting location is the location of the '.'

llvm-svn: 317596
2017-11-07 18:25:36 +00:00
Alex Lorenz 7b760095cb [index] index field references in __builtin_offset
rdar://35109556

llvm-svn: 317593
2017-11-07 17:29:11 +00:00
Arnold Schwaighofer 612d693c64 SystemZ Swift TargetInfo: swifterror support in the backend is broken
Return false for swifterror support until the backend is fixed.

llvm-svn: 317589
2017-11-07 16:40:51 +00:00
Sanjay Patel 040fbe3027 [CodeGen] split math and complex tests into separate files; NFCI
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
2017-11-07 15:13:22 +00:00
Eric Liu c47fd014ae [clang-refactor] Use ClangTool more explicitly by making refaroing actions 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
2017-11-07 14:35:03 +00:00
Artem Dergachev 0b5b1f14fd [analyzer] pr34779: CStringChecker: Accept non-standard headers.
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
2017-11-07 10:51:15 +00:00
Sjoerd Meijer 167f2e34d5 [docs] Add section 'Half-Precision Floating Point'
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
2017-11-07 10:09:45 +00:00
George Karpenkov 166548c0dc [analyzer] [NFC] Remove unused typedef from SVals.h
Differential Revision: https://reviews.llvm.org/D39620

llvm-svn: 317537
2017-11-07 02:02:10 +00:00
Alex Lorenz 4e30b96834 Clarify the error message for unsupported aliases on Darwin
rdar://35109556

llvm-svn: 317532
2017-11-07 00:31:19 +00:00
Devin Coughlin 046833e5fb [analyzer] Model correct dispatch_once() 'done' value in BodyFarm
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
2017-11-06 22:12:19 +00:00
Dave Lee f96bedfce3 Vary Windows toolchain selection by -fuse-ld
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
2017-11-06 21:18:05 +00:00
Craig Topper 57f96ac6dc [X86] Replace the mask cmpeq/cmple/cmplt/cmpgt/cmpge/cmpneq intrinsics with 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
2017-11-06 21:00:49 +00:00
Martin Storsjo b438ea3f1c [X86] Add 3dnow and 3dnowa to the list of valid target features
These were missed in SVN r316783, which broke compiling mingw-w64 CRT.

Differential Revision: https://reviews.llvm.org/D39631

llvm-svn: 317504
2017-11-06 20:33:13 +00:00
Jan Korous 06aa2aff7b [Parser] Fix TryParseLambdaIntroducer() error handling
rdar://35066196

Differential Revision: https://reviews.llvm.org/D39419

llvm-svn: 317493
2017-11-06 17:42:17 +00:00
Sanjay Patel 401aaee300 [CodeGen] match new fast-math-flag method: isFast()
This corresponds to LLVM commiti r317488:

If that commit is reverted, this commit will also need to be reverted.

llvm-svn: 317489
2017-11-06 16:27:36 +00:00
Daniel Jasper bbf5f4ecbc [clang-format] Handle unary operator overload with arguments and specifiers
Before:
  int operator++(int)noexcept;

After:
  int operator++(int) noexcept;

Patch by Igor Sugak. Thank you!

llvm-svn: 317473
2017-11-06 12:11:51 +00:00
Eric Liu 190afe955c [Tooling] Test internal::createExecutorFromCommandLineArgsImpl instead of the wrapper.
llvm-svn: 317466
2017-11-06 09:29:09 +00:00
Jina Nahias 48e298b8c4 lowering broadcastm
Change-Id: I0661abea3e3742860e0a03ff9e4fcdc367eff7db
llvm-svn: 317456
2017-11-06 07:04:12 +00:00
Adrian Prantl 131ab94008 Remove \brief from doxygen comments in PrettyPrinter.h
Patch by @xsga!

Differential Revision: https://reviews.llvm.org/D39633

llvm-svn: 317443
2017-11-05 21:52:36 +00:00
Johannes Altmanninger a584beb9d7 [clang-diff] NFC: format
llvm-svn: 317434
2017-11-05 11:53:18 +00:00
Roman Lebedev d9af8e1f98 [Sema] Document+test the -Wsign-conversion change for enums in C code [NFC]
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
2017-11-04 20:27:47 +00:00
Aaron Ballman 3f8bad8626 Move the clang-tblgen-targets project into the Misc folder on IDEs like Visual Studio rather than leave it in the root directory. NFC.
llvm-svn: 317419
2017-11-04 20:06:49 +00:00
Aaron Ballman e89760cb29 Move the clang-tblgen project into the Clang tablegenning folder on IDEs like Visual Studio rather than leave it in the root directory. NFC.
llvm-svn: 317418
2017-11-04 20:06:22 +00:00
Aaron Ballman e7db01f0e0 Move the libclang-headers project into the Misc folder on IDEs like Visual Studio rather than leave it in the root directory. NFC.
llvm-svn: 317417
2017-11-04 20:00:21 +00:00
Sanjay Patel c919758075 [CodeGen] add remquo to list of recognized library calls
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
2017-11-04 15:03:11 +00:00
Martell Malone b22e600484 CodeGenCXX: no default dllimport storage for mingw
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
2017-11-04 02:15:49 +00:00
Martell Malone db5b34ce30 [Driver] MinGW: Remove custom linker detection
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
2017-11-04 02:07:59 +00:00
Richard Trieu 73cf924104 Update ODR hashing tests
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
2017-11-04 01:20:50 +00:00
Eugene Zelenko 918e0ca77a [Basic] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).
llvm-svn: 317381
2017-11-03 22:35:27 +00:00
Alex Lorenz 3cee7cfb30 Add -fcxx-exceptions for ExtractionSemicolonPolicy.cpp to appease PS4 bots
llvm-svn: 317372
2017-11-03 21:31:10 +00:00
Aaron Ballman 72f6563bb3 Replace a use of std::for_each() with llvm::for_each(); NFC.
llvm-svn: 317359
2017-11-03 20:09:17 +00:00
Alex Lorenz 3aae328318 Move Extract.cpp that wasn't moved in r317343
llvm-svn: 317344
2017-11-03 18:21:06 +00:00
Alex Lorenz ebbbb81266 [refactor][extract] insert semicolons into extracted/inserted code
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
2017-11-03 18:11:22 +00:00
Kostya Kortchinsky 8acdc98271 [Driver] Add Scudo as a possible -fsanitize= option
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
2017-11-03 17:04:13 +00:00
Sanjay Patel 594d217502 [CodeGen] add libcall attr tests to show errno-related diffs; NFC
See rL317220 for the builtin siblings.

llvm-svn: 317336
2017-11-03 16:27:27 +00:00
Eric Liu 152ad05050 [Tooling] Fix linking of StandaloneToolExecutorPlugin.
llvm-svn: 317332
2017-11-03 15:57:27 +00:00
Eric Liu 6e6228477b [Tooling] Put createExecutorFromCommandLineArgs implementation in a wrapper. NFC
llvm-svn: 317328
2017-11-03 15:20:57 +00:00
Krasimir Georgiev c47fc31da1 [clang-format] Sort using-declarations case sensitively with a special case for '_'
Summary:
This makes clang-format sort using declarations case-sensitive with the
exception that '_' comes just before 'A'. This is better than the current case
insensitive version, because it groups uppercase names in the same namespace
together.

Reviewers: bkramer

Reviewed By: bkramer

Subscribers: cfe-commits, klimek

Differential Revision: https://reviews.llvm.org/D39549

llvm-svn: 317325
2017-11-03 14:38:07 +00:00