]> granicus.if.org Git - clang/log
clang
7 years agoFix MSVC build of libclang after r288438
Reid Kleckner [Fri, 16 Dec 2016 23:44:44 +0000 (23:44 +0000)]
Fix MSVC build of libclang after r288438

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@290009 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAdd explicit triple to test to fix arm bots.
Peter Collingbourne [Fri, 16 Dec 2016 23:43:51 +0000 (23:43 +0000)]
Add explicit triple to test to fix arm bots.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@290008 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFixed library dependencies on clang-import-test to clean up the bots.
Sean Callanan [Fri, 16 Dec 2016 23:34:16 +0000 (23:34 +0000)]
Fixed library dependencies on clang-import-test to clean up the bots.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@290006 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[analyzer] Extend UnixAPIChecker open() checks to handle openat().
Devin Coughlin [Fri, 16 Dec 2016 23:31:56 +0000 (23:31 +0000)]
[analyzer] Extend UnixAPIChecker open() checks to handle openat().

The openat() API has similar constraints to the open() API -- it just takes
an extra parameter.

rdar://problem/29526458

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@290005 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoTestbed and skeleton of a new expression parser
Sean Callanan [Fri, 16 Dec 2016 23:21:38 +0000 (23:21 +0000)]
Testbed and skeleton of a new expression parser

LLVM's JIT is now the foundation of dynamic-compilation features for many languages. Clang also has low-level support for dynamic compilation (ASTImporter and ExternalASTSource, notably). How the compiler is set up for dynamic parsing is generally left up to individual clients, for example LLDB's C/C++/Objective-C expression parser and the ROOT project.

Although this arrangement offers external clients the flexibility to implement dynamic features as they see fit, the lack of an in-tree client means that subtle bugs can be introduced that cause regressions in the external clients but aren't caught by tests (or users) until much later. LLDB for example regularly encounters complicated ODR violation scenarios where it is not immediately clear who is at fault.

Other external clients (notably, Cling) rely on similar functionality, and another goal is to break this functionality up into composable parts so that any client can be built easily on top of Clang without requiring extensive additional code.

I propose that the parts required to build a simple expression parser be added to Clang.  Initially, I aim to have the following features:

- A piece that looks up external declarations from a variety of sources (e.g., from previous dynamic compilations, from modules, or from DWARF) and uses clear conflict resolution rules to reconcile differences, with easily understood errors. This functionality will be supported by in-tree tests.

- A piece that works hand in hand with the LLVM JIT to resolve the locations of external declarations so that e.g. variables can be redeclared and (for high-performance applications like DTrace) external variables can be accessed directly from the registers where they reside.

This commit adds a tester that parses a sequence of source files and then uses them as source data for an expression. External references are resolved using an ExternalASTSource that responds to name queries using an ASTImporter. This is the setup that LLDB uses, and the motivating reason for MinimalImport in ASTImporter.  When complete, this tester will implement the first of the above goals.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@290004 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoReally revert all changes from r289979. Apparently conflict resolution failed
Reid Kleckner [Fri, 16 Dec 2016 22:11:28 +0000 (22:11 +0000)]
Really revert all changes from r289979. Apparently conflict resolution failed

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289997 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoIRGen: Fix assertion failure when creating debug info for an integer constant wider...
Peter Collingbourne [Fri, 16 Dec 2016 22:10:52 +0000 (22:10 +0000)]
IRGen: Fix assertion failure when creating debug info for an integer constant wider than 64 bits.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289996 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[libclang] Restore the CXXRecordDecl path for clang_Type_getNumTemplateArguments...
Argyrios Kyrtzidis [Fri, 16 Dec 2016 21:40:16 +0000 (21:40 +0000)]
[libclang] Restore the CXXRecordDecl path for clang_Type_getNumTemplateArguments and clang_Type_getTemplateArgumentAsType

Patch by Emilio Cobos Álvarez!
See https://reviews.llvm.org/D26907

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289995 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRevert r289979 due to regressions
Yaxun Liu [Fri, 16 Dec 2016 21:23:55 +0000 (21:23 +0000)]
Revert r289979 due to regressions

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289991 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Sema] Transform the default arguments of a lambda expression when the
Akira Hatanaka [Fri, 16 Dec 2016 21:16:57 +0000 (21:16 +0000)]
[Sema] Transform the default arguments of a lambda expression when the
lambda expression is instantiated.

Rather than waiting until Sema::CheckCXXDefaultArgExpr tries to
transform the default arguments (which fails because it can't get the
template arguments that are used), transform the default arguments
earlier when the lambda expression is transformed in
TransformLambdaExpr.

rdar://problem/27535319

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289990 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[OpenMP] support the 'is_device_ptr' clause with 'target parallel' pragma
Kelvin Li [Fri, 16 Dec 2016 20:50:46 +0000 (20:50 +0000)]
[OpenMP] support the 'is_device_ptr' clause with 'target parallel' pragma

This patch is to add support of the 'is_device_ptr' clause in the 'target parallel' pragma.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289989 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRemove the temporary fix to the RUN line that was committed in r289924.
Akira Hatanaka [Fri, 16 Dec 2016 20:25:11 +0000 (20:25 +0000)]
Remove the temporary fix to the RUN line that was committed in r289924.

Also, dump the AST and run FileCheck to make sure the expected nodes are
created in the AST.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289986 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFix clang build
Zachary Turner [Fri, 16 Dec 2016 19:49:14 +0000 (19:49 +0000)]
Fix clang build

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289985 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRevert "Update for LLVM global variable debug info API change."
Adrian Prantl [Fri, 16 Dec 2016 19:39:18 +0000 (19:39 +0000)]
Revert "Update for LLVM global variable debug info API change."

This reverts commit r289921.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289984 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[OpenCL] Allow disabling types and declarations associated with extensions
Yaxun Liu [Fri, 16 Dec 2016 19:22:08 +0000 (19:22 +0000)]
[OpenCL] Allow disabling types and declarations associated with extensions

Added a map to associate types and declarations with extensions.

Refactored existing diagnostic for disabled types associated with extensions and extended it to declarations for generic situation.

Fixed some bugs for types associated with extensions.

Allow users to use pragma to declare types and functions for supported extensions, e.g.

#pragma OPENCL EXTENSION the_new_extension_name : begin
// declare types and functions associated with the extension here
#pragma OPENCL EXTENSION the_new_extension_name : end

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289979 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[analyzer] Fix crash in MallocChecker.
Devin Coughlin [Fri, 16 Dec 2016 18:41:40 +0000 (18:41 +0000)]
[analyzer] Fix crash in MallocChecker.

Fix a crash in the MallocChecker when the extent size for the argument
to new[] is not known.

A patch by Abramo Bagnara and Dániel Krupp!

https://reviews.llvm.org/D27849

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289970 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[analyzer] Add another exception for Qt in MallocChecker
Artem Dergachev [Fri, 16 Dec 2016 12:21:55 +0000 (12:21 +0000)]
[analyzer] Add another exception for Qt in MallocChecker

Treat pointers passed to QObject::connectImpl() as escaping.

rdar://problem/29550440

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289939 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoattempt to fix bots after r289914/r289919
Nico Weber [Fri, 16 Dec 2016 05:03:44 +0000 (05:03 +0000)]
attempt to fix bots after r289914/r289919

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289924 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoUpdate for LLVM global variable debug info API change.
Adrian Prantl [Fri, 16 Dec 2016 04:26:15 +0000 (04:26 +0000)]
Update for LLVM global variable debug info API change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289921 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRemove "-disable-llvm-optzns -verify" from the RUN line.
Akira Hatanaka [Fri, 16 Dec 2016 04:18:53 +0000 (04:18 +0000)]
Remove "-disable-llvm-optzns -verify" from the RUN line.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289919 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Sema] Fix handling of enumerators used as default arguments of lambda
Akira Hatanaka [Fri, 16 Dec 2016 03:19:41 +0000 (03:19 +0000)]
[Sema] Fix handling of enumerators used as default arguments of lambda
expressions in a function or class template.

This patch makes the following changes:

- Create a DependentScopeDeclRefExpr for the default argument instead of
  a CXXDependentScopeMemberExpr.
- Pass CombineWithOuterScope=true so that the outer scope in which the
  enum is declared is searched for the instantiation of the enum.

This is the first part of https://reviews.llvm.org/D23096. Fixes PR28795

rdar://problem/27535319

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289914 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoclang-format-vsix: add command to format document
Antonio Maiorano [Fri, 16 Dec 2016 01:51:43 +0000 (01:51 +0000)]
clang-format-vsix: add command to format document

Bound to Ctrl+R, Ctrl+D by default. Also added section on how to debug the extension to the Readme.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289910 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoclang-format-vsix: add a date stamp to the VSIX version number to ensure upgradability
Antonio Maiorano [Fri, 16 Dec 2016 01:37:01 +0000 (01:37 +0000)]
clang-format-vsix: add a date stamp to the VSIX version number to ensure upgradability

Presently, the version number of the VSIX matches the LLVM version number. However, as this number doesn't change often, it means that as we release new versions of this VSIX, it will have the same version number, which means users must first uninstall the old version before installing the new one. With this change, we generate a 4th part to the version number that is a date stamp (year, month, day); for example: 4.0.0.161203.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289909 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRevert "Update for LLVM global variable debug info API change."
Adrian Prantl [Fri, 16 Dec 2016 01:01:40 +0000 (01:01 +0000)]
Revert "Update for LLVM global variable debug info API change."

This reverts commit 289901 while investigating bot breakage.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289908 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[c++1z] P0195R2: Allow multiple using-declarators in a single using-declaration.
Richard Smith [Fri, 16 Dec 2016 00:58:48 +0000 (00:58 +0000)]
[c++1z] P0195R2: Allow multiple using-declarators in a single using-declaration.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289905 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoUpdate for LLVM global variable debug info API change.
Adrian Prantl [Fri, 16 Dec 2016 00:35:42 +0000 (00:35 +0000)]
Update for LLVM global variable debug info API change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289901 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFix typo in error messages. NFC.
Kelvin Li [Fri, 16 Dec 2016 00:15:54 +0000 (00:15 +0000)]
Fix typo in error messages. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289897 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[sanitizer] Passthrough CMAKE_OSX_DEPLOYMENT_TARGET and CMAKE_OSX_SYSROOT when buildi...
Kuba Mracek [Thu, 15 Dec 2016 23:20:54 +0000 (23:20 +0000)]
[sanitizer] Passthrough CMAKE_OSX_DEPLOYMENT_TARGET and CMAKE_OSX_SYSROOT when building compiler-rt from clang/runtime/CMakeLists.txt

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289890 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[asan][docs] Fix the documentation to use clang++ for the C++ example
Anna Zaks [Thu, 15 Dec 2016 22:55:21 +0000 (22:55 +0000)]
[asan][docs] Fix the documentation to use clang++ for the C++ example

After Darwin has been updated not to link in stdc++ on Darwin this actually
started to break.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289887 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[analyzer] Teach the analyzer that pointers can escape into __cxa_demangle
Anna Zaks [Thu, 15 Dec 2016 22:55:18 +0000 (22:55 +0000)]
[analyzer] Teach the analyzer that pointers can escape into __cxa_demangle

This fixes a reported false positive in the malloc checker.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289886 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[analyzer] Refine the diagnostics in the nullability checker to differentiate between...
Anna Zaks [Thu, 15 Dec 2016 22:55:15 +0000 (22:55 +0000)]
[analyzer] Refine the diagnostics in the nullability checker to differentiate between nil and null

This is a big deal for ObjC, where nullability annotations are extensively
used. I've also changed "Null" -> "null" and removed "is" as this is the
pattern that Sema is using.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289885 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[analyzer] Refer to macro names in diagnostics for macros representing a literal
Anna Zaks [Thu, 15 Dec 2016 22:55:11 +0000 (22:55 +0000)]
[analyzer] Refer to macro names in diagnostics for macros representing a literal

When a macro expending to a literal is used in a comparison, use the macro name
in the diagnostic rather than the literal. This improves readability of path
notes.

Added tests for various macro literals that could occur. Only BOOl, Int, and
NULL tests have changed behavior with this patch.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289884 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[analyzer] Include type name in Retain Count Checker diagnostics
Anna Zaks [Thu, 15 Dec 2016 22:55:03 +0000 (22:55 +0000)]
[analyzer] Include type name in Retain Count Checker diagnostics

The more detailed diagnostic will make identifying which object the
diagnostics refer to easier.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289883 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[analyzer] Add a new SVal to support pointer-to-member operations.
Devin Coughlin [Thu, 15 Dec 2016 21:27:06 +0000 (21:27 +0000)]
[analyzer] Add a new SVal to support pointer-to-member operations.

Add a new type of NonLoc SVal for C++ pointer-to-member operations. This SVal
supports both pointers to member functions and pointers to member data.

A patch by Kirill Romanenkov!

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289873 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAdd a class ASTRecordReader which wraps an ASTReader, a RecordData, and ModuleFile.
David L. Jones [Thu, 15 Dec 2016 20:53:26 +0000 (20:53 +0000)]
Add a class ASTRecordReader which wraps an ASTReader, a RecordData, and ModuleFile.

Summary:
When reading an ASTRecord, each RecordData is logically contained within a
single ModuleFile, and global(er) state is contained by a single ASTReader. This
means that any operations that read from a RecordData and reference an ASTReader
or a ModuleFile, will always reference the same ASTReader or ModuleFile.
ASTRecordReader groups these together so that parameters don't need to be
duplicated ad infinitum. Most uses of the Idx variable seem to be redunant
aliases as well, but I'll leave that for now.

Reviewers: rsmith

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289870 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[test] Extend llvm_shlib_dir fix to unittests
Michal Gorny [Thu, 15 Dec 2016 20:31:08 +0000 (20:31 +0000)]
[test] Extend llvm_shlib_dir fix to unittests

Extend the fix from rL286952 to unittests. The fix added clang built
library directories (via llvm_shlib_dir) to LD_LIBRARY_PATH.
The previous logic has used llvm_libs_dir only which points to installed
LLVM when doing stand-alone builds.

The patch also removes the redundant win32 code that is no longer
necessary now that shlibdir is used unconditionally.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289865 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFix printf specifier handling: invalid specifier should not be marked as "consuming...
Mehdi Amini [Thu, 15 Dec 2016 18:54:00 +0000 (18:54 +0000)]
Fix printf specifier handling: invalid specifier should not be marked as "consuming data arguments"

Reviewers: rsmith, bruno, dexonsmith

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289850 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[CUDA] Add --ptxas-path= flag.
Justin Lebar [Thu, 15 Dec 2016 18:44:57 +0000 (18:44 +0000)]
[CUDA] Add --ptxas-path= flag.

Summary:
This lets you build with one CUDA installation but use ptxas from
another install.

This is useful e.g. if you want to avoid bugs in an old ptxas without
actually upgrading wholesale to a newer CUDA version.

Reviewers: tra

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289847 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Driver] Bump default x86 cpu to Penryn when targeting macosx10.12+.
Ahmed Bougacha [Thu, 15 Dec 2016 18:14:27 +0000 (18:14 +0000)]
[Driver] Bump default x86 cpu to Penryn when targeting macosx10.12+.

10.12 dropped support for all pre-Penryn Macs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289839 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFix typo in comment. NFC.
Kelvin Li [Thu, 15 Dec 2016 17:55:32 +0000 (17:55 +0000)]
Fix typo in comment.  NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289836 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoCodeGen: ubsan is built static on windows, give handlers local storage
Saleem Abdulrasool [Thu, 15 Dec 2016 16:30:20 +0000 (16:30 +0000)]
CodeGen: ubsan is built static on windows, give handlers local storage

The UBSAN runtime is built static on Windows.  This requires that we give local
storage always.  This impacts Windows where the linker would otherwise have to
generate a thunk to access the symbol via the IAT.  This should repair the
windows clang build bots.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289829 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRevert "[TESTS] Initial commit of tests, by Andrew Tischenko"
Alexey Bataev [Thu, 15 Dec 2016 12:24:20 +0000 (12:24 +0000)]
Revert "[TESTS] Initial commit of tests, by Andrew Tischenko"

This reverts commit 5898c713bee5e96aae87c73e11f3f4a7d19c74ed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289812 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[TESTS] Initial commit of tests, by Andrew Tischenko
Alexey Bataev [Thu, 15 Dec 2016 12:06:27 +0000 (12:06 +0000)]
[TESTS] Initial commit of tests, by Andrew Tischenko

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289809 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRe-commit r289252 and r289285, and fix PR31374
Yaxun Liu [Thu, 15 Dec 2016 08:09:08 +0000 (08:09 +0000)]
Re-commit r289252 and r289285, and fix PR31374

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289787 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[ARM] Implement execute-only support in CodeGen
Prakhar Bahuguna [Thu, 15 Dec 2016 07:59:24 +0000 (07:59 +0000)]
[ARM] Implement execute-only support in CodeGen

Summary:
This implements execute-only support for ARM code generation, which
prevents the compiler from generating data accesses to code sections.
The following changes are involved:

* Add the CodeGen option "-arm-execute-only" to the ARM code generator.
* Add the clang flag "-mexecute-only" as well as the GCC-compatible
  alias "-mpure-code" to enable this option.
* When enabled, literal pools are replaced with MOVW/MOVT instructions,
  with VMOV used in addition for floating-point literals. As the MOVT
  instruction is required, execute-only support is only available in
  Thumb mode for targets supporting ARMv8-M baseline or Thumb2.
* Jump tables are placed in data sections when in execute-only mode.
* The execute-only text section is assigned section ID 0, and is
  marked as unreadable with the SHF_ARM_PURECODE flag with symbol 'y'.
  This also overrides selection of ELF sections for globals.

Reviewers: t.p.northover, rengolin

Subscribers: llvm-commits, aemerson

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289786 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoCodeGen: force builtins to be local
Saleem Abdulrasool [Thu, 15 Dec 2016 07:29:04 +0000 (07:29 +0000)]
CodeGen: force builtins to be local

Unfortunately _setjmp3 can be both import or local.  The ASAN tests try to
emulate the flags which makes this harder to detect.  Rely on the linker
creating or using thunks here instead.  Should repair the ASAN windows bots.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289783 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoCodeGen: fix runtime function dll storage
Saleem Abdulrasool [Thu, 15 Dec 2016 06:59:05 +0000 (06:59 +0000)]
CodeGen: fix runtime function dll storage

Properly attribute DLL storage to runtime functions.  When generating the
runtime function, scan for an existing declaration which may provide an explicit
declaration (local storage) or a DLL import or export storage from the user.
Honour that if available.  Otherwise, if building with a local visibility of the
public or standard namespaces (-flto-visibility-public-std), give the symbols
local storage (it indicates a /MT[d] link, so static runtime).  Otherwise,
assume that the link is dynamic, and give the runtime function dllimport
storage.

This allows for implementations to get the correct storage as long as they are
properly declared, the user to override the import storage, and in case no
explicit storage is given, use of the import storage.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289776 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRevert "Fix printf specifier handling: invalid specifier should not be marked as...
Mehdi Amini [Thu, 15 Dec 2016 04:58:51 +0000 (04:58 +0000)]
Revert "Fix printf specifier handling: invalid specifier should not be marked as "consuming data arguments""

This reverts commit r289762, wasn't ready to be pushed, it broke the printf tests.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289763 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFix printf specifier handling: invalid specifier should not be marked as "consuming...
Mehdi Amini [Thu, 15 Dec 2016 04:51:22 +0000 (04:51 +0000)]
Fix printf specifier handling: invalid specifier should not be marked as "consuming data arguments"

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289762 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFix os_log formating with arbitrary precision and field width
Mehdi Amini [Thu, 15 Dec 2016 04:02:31 +0000 (04:02 +0000)]
Fix os_log formating with arbitrary precision and field width

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289761 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[c++1z] Permit constant evaluation of a call through a function pointer whose
Richard Smith [Thu, 15 Dec 2016 02:35:39 +0000 (02:35 +0000)]
[c++1z] Permit constant evaluation of a call through a function pointer whose
type differs from the type of the actual function due to having a different
exception specification.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289754 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoMove checks for creation of objects of abstract class type from the various
Richard Smith [Thu, 15 Dec 2016 02:28:18 +0000 (02:28 +0000)]
Move checks for creation of objects of abstract class type from the various
constructs that can do so into the initialization code. This fixes a number
of different cases in which we used to fail to check for abstract types.

Thanks to Tim Shen for inspiring the weird code that uncovered this!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289753 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoInclude SmallSet.h in BackendUtil.cpp
Hal Finkel [Thu, 15 Dec 2016 02:19:17 +0000 (02:19 +0000)]
Include SmallSet.h in BackendUtil.cpp

BackendUtil.cpp uses llvm::SmallSet but did not include the header. It was
included indirectly, but this will change once the AssumptionCache is removed.
NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289752 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoUse PIC relocation mode by default for PowerPC64 ELF
Joerg Sonnenberger [Thu, 15 Dec 2016 00:02:57 +0000 (00:02 +0000)]
Use PIC relocation mode by default for PowerPC64 ELF

Most of the PowerPC64 code generation already creates PIC access. This
changes to a full PIC default, similar to what GCC is doing.

Overall, a monolithic clang binary shrinks by 600KB (about 1%). This can
be a slight regression for TLS access and will use the TOC more
aggressively instead of synthesizing immediates. It is expected to be
performance neutral.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289744 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoCreate SampleProfileLoader pass in llvm instead of clang
Dehao Chen [Wed, 14 Dec 2016 21:41:04 +0000 (21:41 +0000)]
Create SampleProfileLoader pass in llvm instead of clang

Summary:
We used to create SampleProfileLoader pass in clang. This makes LTO/ThinLTO unable to add this pass in the linker plugin. This patch moves the SampleProfileLoader pass creation from
clang to llvm pass manager builder.

Reviewers: tejohnson, davidxl, dnovillo

Subscribers: mehdi_amini, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289715 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRevert 289252 (and follow-up 289285), it caused PR31374
Nico Weber [Wed, 14 Dec 2016 21:38:18 +0000 (21:38 +0000)]
Revert 289252 (and follow-up 289285), it caused PR31374

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289713 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoUpdate MSVC compat docs about debug info
Nico Weber [Wed, 14 Dec 2016 21:34:19 +0000 (21:34 +0000)]
Update MSVC compat docs about debug info

https://reviews.llvm.org/D27769

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289712 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[DebugInfo] Changed DIBuilder::createCompileUnit() to take DIFile instead of FileName...
Amjad Aboud [Wed, 14 Dec 2016 20:24:40 +0000 (20:24 +0000)]
[DebugInfo] Changed DIBuilder::createCompileUnit() to take DIFile instead of FileName and Directory.
This way it will be easier to expand DIFile (e.g., to contain checksum) without the need to modify the createCompileUnit() API.

Reviewers: cfe-commits, rnk

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289701 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRemove unused variable found by GCC warning.
Richard Smith [Wed, 14 Dec 2016 19:45:03 +0000 (19:45 +0000)]
Remove unused variable found by GCC warning.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289698 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAArch64: add architecture version feature to Clang invocation.
Tim Northover [Wed, 14 Dec 2016 19:21:30 +0000 (19:21 +0000)]
AArch64: add architecture version feature to Clang invocation.

Otherwise we don't get the correct predefines and so on in the front-end (or
the right features in the backend).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289692 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[DebugInfo] Restore test case for long double constants.
David Gross [Wed, 14 Dec 2016 18:52:33 +0000 (18:52 +0000)]
[DebugInfo] Restore test case for long double constants.

Summary:
D27549 (partial fix for PR26619) emits a constant value in the debug
metadata for a floating-point static const that does not exceed 64
bits in size.  Whether or not a long double exceeds 64 bits in size
depends on the target.  Modify the test case so that it expects a
constant value for long double if and only if the long double is no
larger than 64 bits.

Reviewers: cfe-commits, probinson

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289686 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Driver] Add tests for enabled static analyzer checkers.
Devin Coughlin [Wed, 14 Dec 2016 18:46:01 +0000 (18:46 +0000)]
[Driver] Add tests for enabled static analyzer checkers.

The driver passes flags to cc1 that enable various checkers based on
the target triple. This commit adds tests for these flags on Darwin, Linux,
and Windows.

This is a test-only change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289685 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoImprove our handling of tag decls in function prototypes
Reid Kleckner [Wed, 14 Dec 2016 17:44:11 +0000 (17:44 +0000)]
Improve our handling of tag decls in function prototypes

r289225 broke AST invariants by reparenting enumerators into function
decl contexts. This improves things by only reparenting TagDecls while
also attempting to preserve the lexical declcontext chain. The
interesting example here is:
  int f(struct S { enum E { a = 1 } b; } c);

The semantic contexts of E and S should be f, and the lexical context of
S should be f and the lexical context of E should be S. We didn't do
that with r289225, but now we should.

This change should also improve our behavior on this example:
  void f() {
    extern void ext(struct S { } o);
    // S injected here
  }

Before r289225 we would only remove 'S' from the surrounding tag
injection context if it was the TU, but now we properly reparent S from
f to ext.

Fixes PR31366

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289678 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agorevert r289670 which breaks bot.
Dehao Chen [Wed, 14 Dec 2016 17:22:53 +0000 (17:22 +0000)]
revert r289670 which breaks bot.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289675 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoCreate SampleProfileLoader pass in llvm instead of clang
Dehao Chen [Wed, 14 Dec 2016 16:49:34 +0000 (16:49 +0000)]
Create SampleProfileLoader pass in llvm instead of clang

Summary:
We used to create SampleProfileLoader pass in clang. This makes LTO/ThinLTO unable to add this pass in the linker plugin. This patch moves the SampleProfileLoader pass creation from
clang to llvm pass manager builder.

Reviewers: tejohnson, davidxl, dnovillo

Subscribers: mehdi_amini, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289670 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Driver] Allow setting the default linker during build
Petr Hosek [Wed, 14 Dec 2016 16:46:50 +0000 (16:46 +0000)]
[Driver] Allow setting the default linker during build

This change allows setting the default linker used by the Clang
driver when configuring the build.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289668 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoUpdate the default of the Mozilla coding style
Sylvestre Ledru [Wed, 14 Dec 2016 16:09:29 +0000 (16:09 +0000)]
Update the default of the Mozilla coding style

Summary:
I also proposed the change in Firefox .clang-format file:
https://bugzilla.mozilla.org/show_bug.cgi?id=1322321

Reviewers: klimek

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289660 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFix assert message. NFC.
Kelvin Li [Wed, 14 Dec 2016 15:39:58 +0000 (15:39 +0000)]
Fix assert message.  NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289657 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFixing cast condition for removing casts from builtin FPClassification.
Neil Hickey [Wed, 14 Dec 2016 13:18:48 +0000 (13:18 +0000)]
Fixing cast condition for removing casts from builtin FPClassification.

The function SemaBuiltinFPClassification removed superfluous float to double
casts, this was changed to also remove float to float casts but this isn't
valid in all cases, for example when doing an rvaluetolvalue cast. Added a
check to only remove if this was a conventional floating cast.

Added additional tests into SemaOpenCL/extensions to cover these cases

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289650 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoReplace APFloatBase static fltSemantics data members with getter functions
Stephan Bergmann [Wed, 14 Dec 2016 11:57:17 +0000 (11:57 +0000)]
Replace APFloatBase static fltSemantics data members with getter functions

At least the plugin used by the LibreOffice build
(<https://wiki.documentfoundation.org/Development/Clang_plugins>) indirectly
uses those members (through inline functions in LLVM/Clang include files in turn
using them), but they are not exported by utils/extract_symbols.py on Windows,
and accessing data across DLL/EXE boundaries on Windows is generally
problematic.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289647 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[c++1z] P0217R3: Allow by-value structured binding of arrays.
Richard Smith [Wed, 14 Dec 2016 03:22:16 +0000 (03:22 +0000)]
[c++1z] P0217R3: Allow by-value structured binding of arrays.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289630 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[PS4] Undo dialect tweak for Objective-C.
Paul Robinson [Wed, 14 Dec 2016 02:06:11 +0000 (02:06 +0000)]
[PS4] Undo dialect tweak for Objective-C.

In r267772, we had set the PS4's default dialect for both C and
Objective-C to gnu99.  Make that change only for C; we don't really
support Objective-C/C++ so there's no point fiddling the dialect.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289625 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoWhen emitting a multidimensional array copy, only emit a single flattened
Richard Smith [Wed, 14 Dec 2016 01:32:13 +0000 (01:32 +0000)]
When emitting a multidimensional array copy, only emit a single flattened
cleanup loop for exception handling.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289623 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoLTO: Add support for multi-module bitcode files.
Peter Collingbourne [Wed, 14 Dec 2016 01:17:59 +0000 (01:17 +0000)]
LTO: Add support for multi-module bitcode files.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289621 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRemove custom handling of array copies in lambda by-value array capture and
Richard Smith [Wed, 14 Dec 2016 00:03:17 +0000 (00:03 +0000)]
Remove custom handling of array copies in lambda by-value array capture and
copy constructors of classes with array members, instead using
ArrayInitLoopExpr to represent the initialization loop.

This exposed a bug in the static analyzer where it was unable to differentiate
between zero-initialized and unknown array values, which has also been fixed
here.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289618 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[CodeGen][ObjC] Emit objc_unsafeClaimAutoreleasedReturnValue for
Akira Hatanaka [Tue, 13 Dec 2016 23:32:22 +0000 (23:32 +0000)]
[CodeGen][ObjC] Emit objc_unsafeClaimAutoreleasedReturnValue for
fragile runtime too.

Follow-up to r258962.

rdar://problem/29269006

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289615 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAdd support for Samsung Exynos M3 (NFC)
Evandro Menezes [Tue, 13 Dec 2016 23:31:57 +0000 (23:31 +0000)]
Add support for Samsung Exynos M3 (NFC)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289614 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoCodeGen: Start using inrange annotations on vtable getelementptr.
Peter Collingbourne [Tue, 13 Dec 2016 20:50:44 +0000 (20:50 +0000)]
CodeGen: Start using inrange annotations on vtable getelementptr.

This annotation allows the optimizer to split vtable groups, as permitted by
a change to the Itanium ABI [1] that prevents compilers from adjusting virtual
table pointers between virtual tables.

[1] https://github.com/MentorEmbedded/cxx-abi/pull/7

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289585 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoCodeGen: New vtable group representation: struct of vtable arrays.
Peter Collingbourne [Tue, 13 Dec 2016 20:40:39 +0000 (20:40 +0000)]
CodeGen: New vtable group representation: struct of vtable arrays.

In a future change, this representation will allow us to use the new inrange
annotation on getelementptr to allow the optimizer to split vtable groups.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289584 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAlign EvalInfo in ExprConstant to avoid PointerUnion assertions
Reid Kleckner [Tue, 13 Dec 2016 19:48:32 +0000 (19:48 +0000)]
Align EvalInfo in ExprConstant to avoid PointerUnion assertions

32-bit MSVC doesn't provide more than 4 byte stack alignment by default.
This conflicts with PointerUnion's attempt to make assertions about
alignment. This fixes the problem by explicitly asking the compiler for
8 byte alignment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289575 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Sema] Prefer SmallVector over `new`ed memory blocks. NFC.
George Burgess IV [Tue, 13 Dec 2016 19:22:56 +0000 (19:22 +0000)]
[Sema] Prefer SmallVector over `new`ed memory blocks. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289571 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago__uuidof() and declspec(uuid("...")) should be allowed on enumeration types
Reid Kleckner [Tue, 13 Dec 2016 18:58:09 +0000 (18:58 +0000)]
__uuidof() and declspec(uuid("...")) should be allowed on enumeration types

Although not specifically mentioned in the documentation, MSVC accepts
__uuidof(…) and declspec(uuid("…")) attributes on enumeration types in
addition to structs/classes. This is meaningful, as such types *do* have
associated UUIDs in ActiveX typelibs, and such attributes are included
by default in the wrappers generated by their #import construct, so they
are not particularly unusual.

clang currently rejects the declspec with a –Wignored-attributes
warning, and errors on __uuidof() with “cannot call operator __uuidof on
a type with no GUID” (because it rejected the uuid attribute, and
therefore finds no value). This is causing problems for us while trying
to use clang-tidy on a codebase that makes heavy use of ActiveX.

I believe I have found the relevant places to add this functionality,
this patch adds this case to clang’s implementation of these MS
extensions.  patch is against r285994 (or actually the git mirror
80464680ce).

Both include an update to test/Parser/MicrosoftExtensions.cpp to
exercise the new functionality.

This is my first time contributing to LLVM, so if I’ve missed anything
else needed to prepare this for review just let me know!

__uuidof: https://msdn.microsoft.com/en-us/library/zaah6a61.aspx
declspec(uuid("…")): https://msdn.microsoft.com/en-us/library/3b6wkewa.aspx
 #import: https://msdn.microsoft.com/en-us/library/8etzzkb6.aspx

Reviewers: aaron.ballman, majnemer, rnk

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289567 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[analyzer] Detect ObjC properties that are both (copy) and Mutable.
Artem Dergachev [Tue, 13 Dec 2016 17:19:18 +0000 (17:19 +0000)]
[analyzer] Detect ObjC properties that are both (copy) and Mutable.

When an Objective-C property has a (copy) attribute, the default setter
for this property performs a -copy on the object assigned.

Calling -copy on a mutable NS object such as NSMutableString etc.
produces an immutable object, NSString in our example.
Hence the getter becomes type-incorrect.

rdar://problem/21022397

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289554 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoUpdate for clang after llvm::StringLiteral.
Zachary Turner [Tue, 13 Dec 2016 17:10:16 +0000 (17:10 +0000)]
Update for clang after llvm::StringLiteral.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289553 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFixing build failure by adding triple option to new test condition.
Neil Hickey [Tue, 13 Dec 2016 17:04:33 +0000 (17:04 +0000)]
Fixing build failure by adding triple option to new test condition.

Adding -triple option to ensure target supports double for fpmath test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289552 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoImprove handling of floating point literals in OpenCL to only use double precision...
Neil Hickey [Tue, 13 Dec 2016 16:22:50 +0000 (16:22 +0000)]
Improve handling of floating point literals in OpenCL to only use double precision if the target supports fp64.

This change makes sure single-precision floating point types are used if the
cl_fp64 extension is not supported by the target.

Also removed the check to see whether the OpenCL version is >= 1.2, as this has
been incorporated into the extension setting code.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289544 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRemove deprecated methods ast_matchers::BoundNodes::{getStmtAs,getDeclAs}
Alexander Kornienko [Tue, 13 Dec 2016 16:19:34 +0000 (16:19 +0000)]
Remove deprecated methods ast_matchers::BoundNodes::{getStmtAs,getDeclAs}

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289543 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[OpenCL] Improve address space diagnostics.
Egor Churaev [Tue, 13 Dec 2016 14:07:23 +0000 (14:07 +0000)]
[OpenCL] Improve address space diagnostics.

Reviewers: Anastasia

Subscribers: bader, yaxunl, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289536 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[OpenCL] Enable unroll hint for OpenCL 1.x.
Egor Churaev [Tue, 13 Dec 2016 14:02:35 +0000 (14:02 +0000)]
[OpenCL] Enable unroll hint for OpenCL 1.x.

Summary: Although the feature was introduced only in OpenCL C v2.0 spec., it's useful for OpenCL 1.x too and doesn't require HW support.

Reviewers: Anastasia

Subscribers: yaxunl, cfe-commits, bader

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289535 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoclang-format: Keep string-literal-label + value pairs on a line.
Daniel Jasper [Tue, 13 Dec 2016 11:16:42 +0000 (11:16 +0000)]
clang-format: Keep string-literal-label + value pairs on a line.

We have previously done that for <<-operators. This patch also adds
this logic for "," and "+".

Before:
  string v = "aaaaaaaaaaaaaaaa: " + aaaaaaaaaaaaaaaa + "aaaaaaaaaaaaaaaa: " +
             aaaaaaaaaaaaaaaa + "aaaaaaaaaaaaaaaa: " + aaaaaaaaaaaaaaaa;
  string v = StrCat("aaaaaaaaaaaaaaaa: ", aaaaaaaaaaaaaaaa, "aaaaaaaaaaaaaaaa: ",
                    aaaaaaaaaaaaaaaa, "aaaaaaaaaaaaaaaa: ", aaaaaaaaaaaaaaaa);

After:
  string v = "aaaaaaaaaaaaaaaa: " + aaaaaaaaaaaaaaaa +
     "aaaaaaaaaaaaaaaa: " + aaaaaaaaaaaaaaaa +
     "aaaaaaaaaaaaaaaa: " + aaaaaaaaaaaaaaaa;
  string v = StrCat("aaaaaaaaaaaaaaaa: ", aaaaaaaaaaaaaaaa,
    "aaaaaaaaaaaaaaaa: ", aaaaaaaaaaaaaaaa,
    "aaaaaaaaaaaaaaaa: ", aaaaaaaaaaaaaaaa);

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289531 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoclang-format: Improve braced-list detection.
Daniel Jasper [Tue, 13 Dec 2016 10:05:03 +0000 (10:05 +0000)]
clang-format: Improve braced-list detection.

Before:
  vector<int> v { 12 }
      GUARDED_BY(mutex);

After:
  vector<int> v{12} GUARDED_BY(mutex);

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289525 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoCodeGen: clean up -Wpedantic warning (NFC)
Saleem Abdulrasool [Tue, 13 Dec 2016 03:27:35 +0000 (03:27 +0000)]
CodeGen: clean up -Wpedantic warning (NFC)

  lib/CodeGen/CGExpr.cpp:2511:2: warning: extra ';' [-Wpedantic]
   };
    ^

Clean up warning from gcc 6.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289514 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[analyzer] Run clang-format and fix style
Dominic Chen [Tue, 13 Dec 2016 01:40:41 +0000 (01:40 +0000)]
[analyzer] Run clang-format and fix style

Summary: Split out formatting and style changes from D26061

Reviewers: zaks.anna, dcoughlin

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289511 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRevert "[Modules] Make header inclusion order from umbrella dirs deterministic"
Bruno Cardoso Lopes [Mon, 12 Dec 2016 23:22:30 +0000 (23:22 +0000)]
Revert "[Modules] Make header inclusion order from umbrella dirs deterministic"

Reverts commit r289478.

This broke
http://lab.llvm.org:8011/builders/clang-ppc64be-linux/builds/2070
(and maybe
http://lab.llvm.org:8011/builders/clang-x86_64-linux-selfhost-modules-2/builds/2246)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289494 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRevert "[Headers] Add #include_next for tgmath.h on Darwin"
Bruno Cardoso Lopes [Mon, 12 Dec 2016 23:06:58 +0000 (23:06 +0000)]
Revert "[Headers] Add #include_next for tgmath.h on Darwin"

Reverts r289181: it's currently breaking modules using simd.h in
10.12 SDK.

This reverts commit 6e73e3464e96a4e00492c24aa790d36e1adb5702.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289487 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Modules] Make header inclusion order from umbrella dirs deterministic
Bruno Cardoso Lopes [Mon, 12 Dec 2016 22:41:20 +0000 (22:41 +0000)]
[Modules] Make header inclusion order from umbrella dirs deterministic

Sort the headers by name before adding the includes in
collectModuleHeaderIncludes. This makes the include order for building
umbrellas deterministic across different filesystems and also guarantees
that the ASTWriter always dump top headers in the same order.

There's currently no good way to test for this behavior.

rdar://problem/28116411

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289478 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[CrashReproducer] Collect PCH included via -include-pch
Bruno Cardoso Lopes [Mon, 12 Dec 2016 19:28:25 +0000 (19:28 +0000)]
[CrashReproducer] Collect PCH included via -include-pch

Collect the necessary input PCH files.

Do not try to validate the AST before copying it out because if the
crash is in this path, we won't be able to collect it. Instead only
check if it's a file containg an AST.

rdar://problem/27913709

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289460 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Frontend] Use vfs for directory iteration while searching PCHs. NFCI
Bruno Cardoso Lopes [Mon, 12 Dec 2016 19:28:21 +0000 (19:28 +0000)]
[Frontend] Use vfs for directory iteration while searching PCHs. NFCI

Use the vfs lookup instead of real filesytem and handle the case where
-include-pch is a directory and this dir is searched for a PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289459 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFix typo and remove unnecessary statement.
Samuel Antao [Mon, 12 Dec 2016 19:26:31 +0000 (19:26 +0000)]
Fix typo and remove unnecessary statement.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289458 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoBring back note about not supporting global register variables.
Michael Kuperstein [Mon, 12 Dec 2016 19:11:39 +0000 (19:11 +0000)]
Bring back note about not supporting global register variables.

This was accidentally removed in r260506, even though we only support
non-allocatable global register variables. The general (allocatable) case
is explicitly not supported.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289455 91177308-0d34-0410-b5e6-96231b3b80d8