]> granicus.if.org Git - clang/log
clang
7 years ago[analyzer] Avoid an allocation in Std C function modelling
Gabor Horvath [Fri, 12 May 2017 06:53:55 +0000 (06:53 +0000)]
[analyzer] Avoid an allocation in Std C function modelling

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

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

7 years ago[tooling] RefactoringCallbacks code cleanup
Alexander Shaposhnikov [Fri, 12 May 2017 00:16:56 +0000 (00:16 +0000)]
[tooling] RefactoringCallbacks code cleanup

This diff
 1. adds missing "explicit" for single argument constructors
 2. adds missing std::move in ReplaceNodeWithTemplate constructor

Test plan: make check-all

Differential revision: https://reviews.llvm.org/D33061

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

7 years agoFix uninitialized bool read causing x86_64-mno-sse.c test failure
Reid Kleckner [Fri, 12 May 2017 00:10:49 +0000 (00:10 +0000)]
Fix uninitialized bool read causing x86_64-mno-sse.c test failure

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

7 years agoRemove unnecessary mapping from SourceLocation to Module.
Richard Smith [Thu, 11 May 2017 23:11:16 +0000 (23:11 +0000)]
Remove unnecessary mapping from SourceLocation to Module.

When we parse a redefinition of an entity for which we have a hidden existing
declaration, make it visible in the current module instead of mapping the
current source location to its containing module.

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

7 years agoModule Debug Info: Emit namespaced C++ forward decls in the correct module.
Adrian Prantl [Thu, 11 May 2017 22:59:19 +0000 (22:59 +0000)]
Module Debug Info: Emit namespaced C++ forward decls in the correct module.

The AST merges NamespaceDecls, but for module debug info it is
important to put a namespace decl (or rather its children) into the
correct (sub-)module, so we need to use the parent module of the decl
that triggered this namespace to be serialized as a second key when
looking up DINamespace nodes.

rdar://problem/29339538

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

7 years agoIssue diagnostics when returning FP values on x86_64 without SSE1/2
Reid Kleckner [Thu, 11 May 2017 22:43:02 +0000 (22:43 +0000)]
Issue diagnostics when returning FP values on x86_64 without SSE1/2

Avoid using report_fatal_error, because it will ask the user to file a
bug. If the user attempts to disable SSE on x86_64 and them use floating
point, that's a bug in their code, not a bug in the compiler.

This is just a start. There are other ways to crash the backend in this
configuration, but they should be updated to follow this pattern.

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

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

7 years agoXFAIL this test for Hexagon.
Richard Smith [Thu, 11 May 2017 21:18:27 +0000 (21:18 +0000)]
XFAIL this test for Hexagon.

It's failing due to Hexagon calling convention lowering being broken (empty
structs are not passed even if they have nontrivial destructors / copy ctors).

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

7 years agoWork around different -std= default for PS4 target.
Richard Smith [Thu, 11 May 2017 19:17:54 +0000 (19:17 +0000)]
Work around different -std= default for PS4 target.

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

7 years agoPR22877: When constructing an array via a constructor with a default argument
Richard Smith [Thu, 11 May 2017 18:58:24 +0000 (18:58 +0000)]
PR22877: When constructing an array via a constructor with a default argument
in list-initialization, run cleanups for the default argument after each
iteration of the initialization loop.

We previously only ran the destructor for any temporary once, at the end of the
complete loop, rather than once per iteration!

Re-commit of r302750, reverted in r302776.

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

7 years agoAdd a test that local submodule visibility has no effect on debug info
Adrian Prantl [Thu, 11 May 2017 16:40:48 +0000 (16:40 +0000)]
Add a test that local submodule visibility has no effect on debug info

rdar://problem/27876262

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

7 years ago[CodeCompletion] Provide member completions for dependent expressions whose
Alex Lorenz [Thu, 11 May 2017 13:48:57 +0000 (13:48 +0000)]
[CodeCompletion] Provide member completions for dependent expressions whose
type is a TemplateSpecializationType or InjectedClassNameType

Fixes PR30847. Partially fixes PR20973 (first position only).

PR17614 is still not working, its expression has the dependent
builtin type. We'll have to teach the completion engine how to "resolve"
dependent expressions to fix it.

rdar://29818301

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

7 years ago[CodeCompletion] NFC, extract a function that generates member
Alex Lorenz [Thu, 11 May 2017 13:41:00 +0000 (13:41 +0000)]
[CodeCompletion] NFC, extract a function that generates member
completion results for records

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

7 years agoFix two-stage build on windows using DistributionExample cmake cache
NAKAMURA Takumi [Thu, 11 May 2017 13:19:24 +0000 (13:19 +0000)]
Fix two-stage build on windows using DistributionExample cmake cache

Thanks to Matthew Larionov <matthewtff@gmail.com>

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

7 years agoReverted r302775
Serge Pavlov [Thu, 11 May 2017 08:25:22 +0000 (08:25 +0000)]
Reverted r302775

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

7 years agoRevert "PR22877: When constructing an array via a constructor with a default argument...
Diana Picus [Thu, 11 May 2017 08:10:41 +0000 (08:10 +0000)]
Revert "PR22877: When constructing an array via a constructor with a default argument in list-initialization, run cleanups for the default argument after each iteration of the initialization loop."

Revert "clang/test/CodeGenCXX/array-default-argument.cpp: Satisfy targets that have x86_thiscallcc."

This reverts commit r302750 and its fixup r302757 because the test is
still breaking on some of the ARM bots.

array-default-argument.cpp:20:12: error: expected string not found in input
 // CHECK: {{call|invoke}}[[THISCALL:( x86_thiscallcc)?]] void @_ZN1AC1Ev([[TEMPORARY:.*]])
           ^
<stdin>:18:1: note: scanning from here
arrayctor.loop: ; preds = %arrayctor.loop, %entry
^
<stdin>:28:2: note: possible intended match here
 call void @_Z1fv()
 ^

--

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

7 years agoDriver must return non-zero code on errors in command line
Serge Pavlov [Thu, 11 May 2017 08:00:33 +0000 (08:00 +0000)]
Driver must return non-zero code on errors in command line

Now if clang driver is given wrong arguments, in some cases it
continues execution and returns zero code. This change fixes this
behavior.

The fix revealed some errors in clang test set.

File test/Driver/gfortran.f90 added in r118203 checks forwarding
gfortran flags to GCC. Now driver reports error on this file, because
the option -working-directory implemented in clang differs from the
option with the same name implemented in gfortran, in clang the option
requires argument, in gfortran does not.

In the file test/Driver/arm-darwin-builtin.c clang is called with
options -fbuiltin-strcat and -fbuiltin-strcpy. These option were removed
in r191435 and now clang reports error on this test.

File arm-default-build-attributes.s uses option -verify, which is not
supported by driver, it is cc1 option.

Similarly, the file split-debug.h uses options -fmodules-embed-all-files
and -fmodule-format=obj, which are not supported by driver.

Other revealed errors are mainly mistypes.

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

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

7 years agoMake tests from r302765 windows friendly
Bruno Cardoso Lopes [Thu, 11 May 2017 07:06:52 +0000 (07:06 +0000)]
Make tests from r302765 windows friendly

and appease:
http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/2030

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

7 years ago[Sema] Improve redefinition errors pointing to the same header
Bruno Cardoso Lopes [Thu, 11 May 2017 06:20:07 +0000 (06:20 +0000)]
[Sema] Improve redefinition errors pointing to the same header

Diagnostics related to redefinition errors that point to the same header
file do not provide much information that helps users fixing the issue.

- In the modules context, it usually happens because of non modular
includes.
- When modules aren't involved it might happen because of the lack of
header guards.

Enhance diagnostics in these scenarios.

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

rdar://problem/31669175

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

7 years agoPrune unused \param(s) of clang::Parser::ParseTemplateIdAfterTemplateName() in r30273...
NAKAMURA Takumi [Thu, 11 May 2017 02:43:47 +0000 (02:43 +0000)]
Prune unused \param(s) of clang::Parser::ParseTemplateIdAfterTemplateName() in r302737. [-Wdocumentation]

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

7 years agoclang/test/CodeGenCXX/array-default-argument.cpp: Satisfy targets that have x86_thisc...
NAKAMURA Takumi [Thu, 11 May 2017 02:39:30 +0000 (02:39 +0000)]
clang/test/CodeGenCXX/array-default-argument.cpp: Satisfy targets that have x86_thiscallcc.

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

7 years agoPR22877: When constructing an array via a constructor with a default argument
Richard Smith [Thu, 11 May 2017 00:17:17 +0000 (00:17 +0000)]
PR22877: When constructing an array via a constructor with a default argument
in list-initialization, run cleanups for the default argument after each
iteration of the initialization loop.

We previously only ran the destructor for any temporary once, at the end of the
complete loop, rather than once per iteration!

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

7 years agoclang/lib/Tooling/RefactoringCallbacks.cpp: Avoid std::errc::bad_message.
NAKAMURA Takumi [Wed, 10 May 2017 22:30:44 +0000 (22:30 +0000)]
clang/lib/Tooling/RefactoringCallbacks.cpp: Avoid std::errc::bad_message.

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

7 years agoPartially revert r302685 and swith Apple-style full LTO builds to
Adrian Prantl [Wed, 10 May 2017 22:14:23 +0000 (22:14 +0000)]
Partially revert r302685 and swith Apple-style full LTO builds to
-gline-tables-only. The memory consumption is apparently still too
much for some of the green dragon builders.

<rdar://problem/28672159>

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

7 years ago[Myriad] Pass -Xclang and -mllvm flags to moviCompile
James Y Knight [Wed, 10 May 2017 21:48:13 +0000 (21:48 +0000)]
[Myriad] Pass -Xclang and -mllvm flags to moviCompile

Patch by Walter Lee.

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

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

7 years agoChanges missed from r302732.
Richard Smith [Wed, 10 May 2017 21:47:30 +0000 (21:47 +0000)]
Changes missed from r302732.

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

7 years agoImprove diagnosis of unknown template name.
Richard Smith [Wed, 10 May 2017 21:32:16 +0000 (21:32 +0000)]
Improve diagnosis of unknown template name.

When an undeclared identifier in a context that requires a type is followed by
'<', only look for type templates when typo-correcting, tweak the diagnostic
text to say that a template name (not a type name) was undeclared, and parse
the template arguments when recovering from the error.

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

7 years agoFix errored return value in CheckFunctionReturnType and add a fixit hint
Erich Keane [Wed, 10 May 2017 20:03:16 +0000 (20:03 +0000)]
Fix errored return value in CheckFunctionReturnType and add a fixit hint

As discovered by ChenWJ and listed on cfe-dev, the error for Objective C
return type ended up being wrong. This fixes that. Additionally, as a
"while we're there", the other usages of this error and the usage of the
FP above both use a FixItHint, so I'll add it here.

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

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

7 years ago[Sema] Objective-C++ support for type trait __is_base_of
Erik Pilkington [Wed, 10 May 2017 17:18:56 +0000 (17:18 +0000)]
[Sema] Objective-C++ support for type trait __is_base_of

rdar://24308607

Differential revision: https://reviews.llvm.org/D32891

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

7 years ago[AST] RecursiveASTVisitor should not crash on lambdas with type attributes
Alex Lorenz [Wed, 10 May 2017 16:21:00 +0000 (16:21 +0000)]
[AST] RecursiveASTVisitor should not crash on lambdas with type attributes

rdar://31960860

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

7 years agoBuild the Apple-style stage2 with full debug info
Adrian Prantl [Wed, 10 May 2017 15:58:22 +0000 (15:58 +0000)]
Build the Apple-style stage2 with full debug info

Green dragon had a green stage2 modules bot for a long time now[1] and
it is time to retire it and make a modules build the default for
Apple-style stage2 builds.

This patch switches the debug info generation from -gline-tables-only
to -g since full debug info does no longer cause any memory issues
even for full LTO builds [2].

[1] http://green.lab.llvm.org/green/job/clang-stage2-cmake-modulesRDA_build/
[2] http://llvm.org/devmtg/2015-10/#talk19
rdar://problem/28672159

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

7 years ago[libclang] Fix typo in doc-comment, NFC
Argyrios Kyrtzidis [Wed, 10 May 2017 15:48:16 +0000 (15:48 +0000)]
[libclang] Fix typo in doc-comment, NFC

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

7 years ago[libclang] Introduce clang_Cursor_isExternalSymbol that provides info about decls...
Argyrios Kyrtzidis [Wed, 10 May 2017 15:10:36 +0000 (15:10 +0000)]
[libclang] Introduce clang_Cursor_isExternalSymbol that provides info about decls marked with external_source_symbol attribute

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

7 years agoReland: [mips] Impose a threshold for coercion of aggregates
Petar Jovanovic [Wed, 10 May 2017 14:28:18 +0000 (14:28 +0000)]
Reland: [mips] Impose a threshold for coercion of aggregates

    Modified MipsABIInfo::classifyArgumentType so that it now coerces
    aggregate structures only if the size of said aggregate is less than
    16/64 bytes, depending on the ABI.

    Patch by Stefan Maksimovic.

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

with minor changes (use regexp instead of the hardcoded values) to the test.

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

7 years agoclang-format: refine calculating brace types.
Martin Probst [Wed, 10 May 2017 13:53:29 +0000 (13:53 +0000)]
clang-format: refine calculating brace types.

Summary:
For C++ code, opening parenthesis following a } indicate a braced init. For JavaScript and other languages, this is an invalid syntactical construct, unless the closing parenthesis belongs to a function - in which situation its a BK_Block.

This fixes indenting IIFEs following top level functions:

    function foo() {}
    (function() { codeHere(); }());

clang-format used to collapse these lines together.

Subscribers: klimek

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

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

7 years agoUse clang++-3.5 compatible initializer_list constructor
Serge Guelton [Wed, 10 May 2017 13:22:11 +0000 (13:22 +0000)]
Use clang++-3.5 compatible initializer_list constructor

Otherwise, a warning is issued.

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

7 years ago[OpenCL] Handle OpenCL specific subelement types
Egor Churaev [Wed, 10 May 2017 10:28:34 +0000 (10:28 +0000)]
[OpenCL] Handle OpenCL specific subelement types

Reviewers: Anastasia, cfe-commits

Reviewed By: Anastasia

Subscribers: bader, yaxunl

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

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

7 years ago[index] Index simple dependent declaration references
Alex Lorenz [Wed, 10 May 2017 09:47:41 +0000 (09:47 +0000)]
[index] Index simple dependent declaration references

This commit implements basic support for indexing of dependent declaration
references. Now the indexer tries to find a suitable match in the base template
for a dependent member ref/decl ref/dependent type.

rdar://29158210

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

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

7 years ago[OpenCL] Added checking OpenCL version for cl_khr_mipmap_image built-ins
Egor Churaev [Wed, 10 May 2017 08:23:01 +0000 (08:23 +0000)]
[OpenCL] Added checking OpenCL version for cl_khr_mipmap_image built-ins

Reviewers: Anastasia, cfe-commits

Reviewed By: Anastasia

Subscribers: bader, yaxunl

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

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

7 years agoAdd ASTMatchRefactorer and ReplaceNodeWithTemplate to RefactoringCallbacks
Eric Liu [Wed, 10 May 2017 07:48:45 +0000 (07:48 +0000)]
Add ASTMatchRefactorer and ReplaceNodeWithTemplate to RefactoringCallbacks

Summary: This is the first change as part of developing a clang-query based search and replace tool.

Reviewers: klimek, bkramer, ioeric, sbenza, jbangert

Reviewed By: ioeric, jbangert

Subscribers: sbenza, ioeric, cfe-commits

Patch by Julian Bangert!

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

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

7 years agoWhen we see a '<' operator, check whether it's a probable typo for a template-id.
Richard Smith [Wed, 10 May 2017 02:30:28 +0000 (02:30 +0000)]
When we see a '<' operator, check whether it's a probable typo for a template-id.

The heuristic that we use here is:
 * the left-hand side must be a simple identifier or a class member access
 * the right-hand side must be '<' followed by either a '>' or by a type-id that
   cannot be an expression (in particular, not followed by '(' or '{')
 * there is a '>' token matching the '<' token

The second condition guarantees the expression would otherwise be ill-formed.

If we're confident that the user intended the name before the '<' to be
interpreted as a template, diagnose the fact that we didn't interpret it
that way, rather than diagnosing that the template arguments are not valid
expressions.

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

7 years agoWhen instantiating a friend function template, don't forget to inherit default templa...
Richard Smith [Wed, 10 May 2017 00:01:13 +0000 (00:01 +0000)]
When instantiating a friend function template, don't forget to inherit default template arguments from other declarations.

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

7 years ago[ubsan] Mark overflow checks with !nosanitize
Vedant Kumar [Tue, 9 May 2017 23:34:49 +0000 (23:34 +0000)]
[ubsan] Mark overflow checks with !nosanitize

Sanitizer instrumentation generally needs to be marked with !nosanitize,
but we're not doing this properly for ubsan's overflow checks.

r213291 has more information about why this is needed.

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

7 years agoDon't mark a member as a member specialization until we know we're keeping the specia...
Richard Smith [Tue, 9 May 2017 23:02:10 +0000 (23:02 +0000)]
Don't mark a member as a member specialization until we know we're keeping the specialization.

This improves our behavior in a few ways:

 * We now guarantee that if a member is marked as being a member
   specialization, there will actually be a member specialization declaration
   somewhere on its redeclaration chain. This fixes a crash in modules builds
   where we would try to check that there was a visible declaration of the
   member specialization and be surprised to not find any declaration of it at
   all.

 * We don't set the source location of the in-class declaration of the member
   specialization to the out-of-line declaration's location until we have
   actually finished merging them. This fixes some very silly looking
   diagnostics, where we'd point a "previous declaration is here" note at the
   same declaration we're complaining about. Ideally we wouldn't mess with the
   prior declaration's location at all, but too much code assumes that the
   first declaration of an entity is a reasonable thing to use as an indication
   of where it was declared, and that's not really true for a member
   specialization unless we fake it like this.

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

7 years agoFix clang_cl argument in fsanitize.c driver test.
Evgeniy Stepanov [Tue, 9 May 2017 22:28:57 +0000 (22:28 +0000)]
Fix clang_cl argument in fsanitize.c driver test.

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

7 years ago[Sema] Implement Core 2094: Trivial copy/move constructor for class with volatile...
Eric Fiselier [Tue, 9 May 2017 22:21:24 +0000 (22:21 +0000)]
[Sema] Implement Core 2094: Trivial copy/move constructor for class with volatile member

Summary: This patch implements http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#2094 which reverts Core 496.

Reviewers: rsmith

Reviewed By: rsmith

Subscribers: cfe-commits

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

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

7 years agoUpdate Clang C++ DR documentation for new issue list
Eric Fiselier [Tue, 9 May 2017 22:17:23 +0000 (22:17 +0000)]
Update Clang C++ DR documentation for new issue list

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

7 years ago[asan] A clang flag to enable ELF globals-gc.
Evgeniy Stepanov [Tue, 9 May 2017 21:57:43 +0000 (21:57 +0000)]
[asan] A clang flag to enable ELF globals-gc.

This feature is subtly broken when the linker is gold 2.26 or
earlier. See the following bug for details:
  https://sourceware.org/bugzilla/show_bug.cgi?id=19002

Since the decision needs to be made at compilation time, we can not
test the linker version. The flag is off by default on ELF targets,
and on otherwise.

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

7 years agoRemove unnecessary calls to MakeArgString.
Evgeniy Stepanov [Tue, 9 May 2017 21:57:39 +0000 (21:57 +0000)]
Remove unnecessary calls to MakeArgString.

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

7 years agoFix CGObjCGNU::init bug introduced by r302572
Serge Guelton [Tue, 9 May 2017 21:19:44 +0000 (21:19 +0000)]
Fix CGObjCGNU::init bug introduced by r302572

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

7 years agoclang-format: [JS] Don't indent JavaScript IIFEs.
Martin Probst [Tue, 9 May 2017 20:04:09 +0000 (20:04 +0000)]
clang-format: [JS] Don't indent JavaScript IIFEs.

Because IIFEs[1] are often used like an anonymous namespace around large
sections of JavaScript code, it's useful not to indent to them (which
effectively reduces the column limit by the indent amount needlessly).

It's also common for developers to wrap these around entire files or
libraries. When adopting clang-format, changing the indent entire file
can reduce the usefulness of the blame annotations.

Patch by danbeam, thanks!

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

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

7 years agoUpdate testcase for upstream LLVM changes (r302469).
Adrian Prantl [Tue, 9 May 2017 19:47:41 +0000 (19:47 +0000)]
Update testcase for upstream LLVM changes (r302469).

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

7 years agoSuppress all uses of LLVM_END_WITH_NULL. NFC.
Serge Guelton [Tue, 9 May 2017 19:31:30 +0000 (19:31 +0000)]
Suppress all uses of LLVM_END_WITH_NULL. NFC.

Use variadic templates instead of relying on <cstdarg> + sentinel.

This enforces better type checking and makes code more readable.

Differential revision: https://reviews.llvm.org/D32550

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

7 years ago[WebAssembly] Fix failing wasm-toolchain test
Sam Clegg [Tue, 9 May 2017 18:44:23 +0000 (18:44 +0000)]
[WebAssembly] Fix failing wasm-toolchain test

This test was broken in r302558.

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

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

7 years ago[X86][LWP] Remove MSVC LWP intrinsics stubs.
Simon Pilgrim [Tue, 9 May 2017 17:50:16 +0000 (17:50 +0000)]
[X86][LWP] Remove MSVC LWP intrinsics stubs.

Now provided in lwpintrin.h

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

7 years ago[WebAssembly] Fix location and -flavor when running lld
Sam Clegg [Tue, 9 May 2017 17:47:50 +0000 (17:47 +0000)]
[WebAssembly] Fix location and -flavor when running lld

Add the toolchain installation directory to the program
path so that lld can be found.

Change -flavor to wasm.  Although this new flavor hasn't
yet landed in upstream lld yet there are no point in
passing wasm objects the gnu flavor.

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

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

7 years ago[X86][LWP] Removing LWP todo comment. NFCI.
Simon Pilgrim [Tue, 9 May 2017 17:43:16 +0000 (17:43 +0000)]
[X86][LWP] Removing LWP todo comment. NFCI.

LWP / lwpintrin.h is now supported

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

7 years agoBuild the Apple-style stage2 with modules
Adrian Prantl [Tue, 9 May 2017 17:27:03 +0000 (17:27 +0000)]
Build the Apple-style stage2 with modules

Green dragon had a green stage2 modules bot for a long time now[1] and
it is time to retire it and make a modules build the default for
Apple-style stage2 builds.

This patch turns on LLVM_ENABLE_MODULES.

[1] http://green.lab.llvm.org/green/job/clang-stage2-cmake-modulesRDA_build/
rdar://problem/28672159

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

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

7 years agoRevert r302547 ([mips] Impose a threshold for coercion of aggregates)
Petar Jovanovic [Tue, 9 May 2017 17:20:06 +0000 (17:20 +0000)]
Revert r302547 ([mips] Impose a threshold for coercion of aggregates)

Reverting
  Modified MipsABIInfo::classifyArgumentType so that it now coerces
  aggregate structures only if the size of said aggregate is less than 16/64
  bytes, depending on the ABI.
as it broke clang-with-lto-ubuntu builder.

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

7 years ago[mips] Impose a threshold for coercion of aggregates
Petar Jovanovic [Tue, 9 May 2017 16:24:03 +0000 (16:24 +0000)]
[mips] Impose a threshold for coercion of aggregates

Modified MipsABIInfo::classifyArgumentType so that it now coerces aggregate
structures only if the size of said aggregate is less than 16/64 bytes,
depending on the ABI.

Patch by Stefan Maksimovic.

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

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

7 years ago[CodeCompletion] Complete platform names in @available expressions
Alex Lorenz [Tue, 9 May 2017 16:05:04 +0000 (16:05 +0000)]
[CodeCompletion] Complete platform names in @available expressions

rdar://32074504

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

7 years agoRevert r302476 "Update testcase for upstream LLVM changes."
Hans Wennborg [Tue, 9 May 2017 15:55:39 +0000 (15:55 +0000)]
Revert r302476 "Update testcase for upstream LLVM changes."

That test update was for r302469, which was reverted in r302533 due to PR32977.

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

7 years agoAdd support for pretty platform names to `@available`/
Alex Lorenz [Tue, 9 May 2017 15:34:46 +0000 (15:34 +0000)]
Add support for pretty platform names to `@available`/
`__builtin_available`

This commit allows us to use the macOS/iOS/tvOS/watchOS platform names in
`@available`/`__builtin_available`.

rdar://32067795

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

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

7 years agoclang-format: [JS] keep triple slash directives intact.
Martin Probst [Tue, 9 May 2017 12:45:48 +0000 (12:45 +0000)]
clang-format: [JS] keep triple slash directives intact.

Summary:
TypeScript uses triple slash directives of the form:
    /// <reference path="..."/>

For various non-source instructions that should not be wrapped.

Reference:
https://www.typescriptlang.org/docs/handbook/triple-slash-directives.html

Reviewers: djasper

Subscribers: cfe-commits, klimek

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

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

7 years agoPR5935: Adjust documentation.
Vassil Vassilev [Tue, 9 May 2017 12:37:15 +0000 (12:37 +0000)]
PR5935: Adjust documentation.

https://reviews.llvm.org/D31867

Patch by Johannes Altmanninger!

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

7 years agoReland "Warn about unused static file scope function template declarations."
Vassil Vassilev [Tue, 9 May 2017 11:25:41 +0000 (11:25 +0000)]
Reland "Warn about unused static file scope function template declarations."

This patch reinstates r299930, reverted in r299956, as a separate diagnostic
option (-Wunused-template).

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

7 years agoFix PR32638 : Make sure we switch Sema's CurContext to the substituted FunctionDecl...
Faisal Vali [Tue, 9 May 2017 04:17:15 +0000 (04:17 +0000)]
Fix PR32638 : Make sure we switch Sema's CurContext to the substituted FunctionDecl when instantiating the exception specification.

This fixes the bug: https://bugs.llvm.org/show_bug.cgi?id=32638

  int main()
  {
    [](auto x) noexcept(noexcept(x)) { } (0);
  }

In the above code, prior to this patch, when substituting into the noexcept expression, i.e. transforming the DeclRefExpr that represents 'x' - clang attempts to capture 'x' because Sema's CurContext is still pointing to the pattern FunctionDecl (i.e. the templated-decl set in FinishTemplateArgumentDeduction) which does not match the substituted 'x's DeclContext, which leads to an attempt to capture and an assertion failure.

We fix this by adjusting Sema's CurContext to point to the substituted FunctionDecl under which the noexcept specifier's argument should be transformed, and so the ParmVarDecl that 'x' refers to has the same declcontext and no capture is attempted.

I briefly investigated whether the SwitchContext should occur right after VisitMethodDecl creates the new substituted FunctionDecl, instead of only during instantiating the exception specification - but seeing no other code that seemed to rely on that, I decided to leave it just for the duration of the exception specification instantiation.

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

7 years ago[Sema] Make typeof(OverloadedFunctionName) not a pointer.
George Burgess IV [Tue, 9 May 2017 04:06:24 +0000 (04:06 +0000)]
[Sema] Make typeof(OverloadedFunctionName) not a pointer.

We were sometimes doing a function->pointer conversion in
Sema::CheckPlaceholderExpr, which isn't the job of CheckPlaceholderExpr.

So, when we saw typeof(OverloadedFunctionName), where
OverloadedFunctionName referenced a name with only one function that
could have its address taken, we'd give back a function pointer type
instead of a function type. This is incorrect.

I kept the logic for doing the function pointer conversion in
resolveAndFixAddressOfOnlyViableOverloadCandidate because it was more
consistent with existing ResolveAndFix* methods.

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

7 years ago[ODRHash] Loosen checks on typedefs.
Richard Trieu [Tue, 9 May 2017 03:24:34 +0000 (03:24 +0000)]
[ODRHash] Loosen checks on typedefs.

When a type in a class is from a typedef, only check the canonical type.  Skip
checking the intermediate underlying types.  This is in response to PR 32965

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

7 years ago[Sema][ObjC] Clean up possible null dereference.
Akira Hatanaka [Tue, 9 May 2017 01:54:51 +0000 (01:54 +0000)]
[Sema][ObjC] Clean up possible null dereference.

It appears that the code is actually dead since unbridged-cast
placeholder types are created by calling CastOperation::complete and
ImplicitCastExprs are never passed to it.

Spotted by Vedant Kumar.

rdar://problem/31542226

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

7 years agodocs: Fix Sphinx detection with out-of-tree builds
Tom Stellard [Tue, 9 May 2017 01:42:33 +0000 (01:42 +0000)]
docs: Fix Sphinx detection with out-of-tree builds

Adapt to changes made in r302499.

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

7 years ago[CodeGen][ObjC] Emit @objc_retain at -O0 for variables captured by
Akira Hatanaka [Tue, 9 May 2017 01:20:05 +0000 (01:20 +0000)]
[CodeGen][ObjC] Emit @objc_retain at -O0 for variables captured by
blocks.

r302270 made changes to avoid emitting clang.arc.use at -O0 and instead
emit @objc_release. We also have to emit @objc_retain for the captured
variable at -O0 to match the @objc_release instead of just storing the
pointer to the capture field.

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

7 years ago[XRay] Add __xray_customeevent(...) as a clang-supported builtin
Dean Michael Berris [Tue, 9 May 2017 00:45:40 +0000 (00:45 +0000)]
[XRay] Add __xray_customeevent(...) as a clang-supported builtin

Summary:
We define the `__xray_customeevent` builtin that gets translated to
IR calls to the correct intrinsic. The default implementation of this is
a no-op function. The codegen side of this follows the following logic:

- When `-fxray-instrument` is not provided in the driver, we elide all
calls to `__xray_customevent`.
- When `-fxray-instrument` is enabled and a function is marked as "never
instrumented", we elide all calls to `__xray_customevent` in that
function; if either marked as "always instrumented" or subject to
threshold-based instrumentation, we emit a call to the
`llvm.xray.customevent` intrinsic from LLVM for each
`__xray_customevent` occurrence in the function.

This change depends on D27503 (to land in LLVM first).

Reviewers: echristo, rsmith

Subscribers: mehdi_amini, pelikan, lrl, cfe-commits

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

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

7 years ago[Modules] Allow umbrella frameworks to define private submodules for subframeworks
Bruno Cardoso Lopes [Tue, 9 May 2017 00:41:38 +0000 (00:41 +0000)]
[Modules] Allow umbrella frameworks to define private submodules for subframeworks

In r298391 we fixed the umbrella framework model to work when submodules
named "Private" are used. This complements the work by allowing the
umbrella framework model to work in general.

rdar://problem/31790067

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

7 years agoRename a method. NFC.
Vedant Kumar [Tue, 9 May 2017 00:12:33 +0000 (00:12 +0000)]
Rename a method. NFC.

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

7 years agoUpdate testcase for upstream LLVM changes.
Adrian Prantl [Mon, 8 May 2017 22:44:00 +0000 (22:44 +0000)]
Update testcase for upstream LLVM changes.

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

7 years ago[Driver] Don't enable -fsanitize-use-after-scope when ASan is disabled
Vedant Kumar [Mon, 8 May 2017 21:11:55 +0000 (21:11 +0000)]
[Driver] Don't enable -fsanitize-use-after-scope when ASan is disabled

When enabling any sanitizer, -fsanitize-use-after-scope is enabled by
default. This doesn't actually turn ASan on, because we've been getting
lucky and there are extra checks in BackendUtil that stop this from
happening.

However, this has been causing a behavior change: extra lifetime markers
are emitted in some cases where they aren't needed or expected.

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

7 years agoIf we are building a module, and we read a second description of the same
Richard Smith [Mon, 8 May 2017 20:30:47 +0000 (20:30 +0000)]
If we are building a module, and we read a second description of the same
module from a different module map, ignore it.

This happens during builds of preprocessed modules (where it is harmless).

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

7 years ago[X86][LWP] Add __LWP__ macro tests
Simon Pilgrim [Mon, 8 May 2017 17:25:48 +0000 (17:25 +0000)]
[X86][LWP] Add __LWP__ macro tests

Missed in rL302418

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

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

7 years agoFix grammar in comment. NFC
Jonathan Roelofs [Mon, 8 May 2017 17:06:17 +0000 (17:06 +0000)]
Fix grammar in comment. NFC

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

7 years ago[AST] Fix copy&paste error in comment. NFC.
Malcolm Parsons [Mon, 8 May 2017 16:43:29 +0000 (16:43 +0000)]
[AST] Fix copy&paste error in comment. NFC.

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

7 years ago[Sema] Fix typos handling in an overloadable call.
Anastasia Stulova [Mon, 8 May 2017 16:05:54 +0000 (16:05 +0000)]
[Sema] Fix typos handling in an overloadable call.

In C typos in arguments in a call of an overloadable function lead
to a failure of construction of CallExpr and following recovery does
not handle created delayed typos. This causes an assertion fail in
Sema::~Sema since Sema::DelayedTypos remains not empty.

The patch fixes that behavior by handling a call with arguments
having dependant types in the way that C++ does.

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

Patch by Dmitry Borisenkov!

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

7 years ago[clang-format] Convert AlignEscapedNewlinesLeft to an enum, adding
Daniel Jasper [Mon, 8 May 2017 15:08:00 +0000 (15:08 +0000)]
[clang-format] Convert AlignEscapedNewlinesLeft to an enum, adding
DontAlign

This converts the clang-format option AlignEscapedNewlinesLeft from a
boolean to an enum, named AlignEscapedNewlines, with options Left (prev.
true), Right (prev. false), and a new option DontAlign.

When set to DontAlign, the backslashes are placed just after the last token in each line:
  #define EXAMPLE \
    do { \
        int x = aaaaa; \
        int b; \
        int dddddddddd; \
    } while (0)

Patch by jtbandes. Thank you!

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

7 years ago[clang-format] Don’t propagate AvoidBinPacking into argument
Daniel Jasper [Mon, 8 May 2017 15:07:52 +0000 (15:07 +0000)]
[clang-format] Don’t propagate AvoidBinPacking into argument
subexpressions

This is an attempt to fix the issue described in a recent email:
http://lists.llvm.org/pipermail/cfe-dev/2017-April/053632.html

Patch by jtbandes. Thank you!
Review: https://reviews.llvm.org/D32475

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

7 years agoCorrect the attribute spelling for guarded_var and pt_guarded_var.
Aaron Ballman [Mon, 8 May 2017 12:39:17 +0000 (12:39 +0000)]
Correct the attribute spelling for guarded_var and pt_guarded_var.

Patch by Roman Lebedev.

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

7 years ago[X86][LWP] Add clang support for LWP instructions.
Simon Pilgrim [Mon, 8 May 2017 12:09:45 +0000 (12:09 +0000)]
[X86][LWP] Add clang support for LWP instructions.

This patch adds support for the the LightWeight Profiling (LWP) instructions which are available on all AMD Bulldozer class CPUs (bdver1 to bdver4).

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

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

7 years ago[OpenCL] Check that global samplers are const
Sven van Haastregt [Mon, 8 May 2017 09:29:06 +0000 (09:29 +0000)]
[OpenCL] Check that global samplers are const

Patch by Simon Perretta.

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

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

7 years agoUpdate LanguageExtensions doc to refer to C++14 instead of C++1y
Eric Fiselier [Sat, 6 May 2017 23:26:04 +0000 (23:26 +0000)]
Update LanguageExtensions doc to refer to C++14 instead of C++1y

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

7 years ago[sanitizer-coverage] implement -fsanitize-coverage=no-prune,... instead of a hidden...
Kostya Serebryany [Fri, 5 May 2017 23:28:18 +0000 (23:28 +0000)]
[sanitizer-coverage] implement -fsanitize-coverage=no-prune,... instead of a hidden -mllvm flag. clang part.

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

7 years agoAArch64: fix weird edge case in ABI.
Tim Northover [Fri, 5 May 2017 22:36:06 +0000 (22:36 +0000)]
AArch64: fix weird edge case in ABI.

It turns out there are some sort-of-but-not-quite empty structs that break all
the rules. For example:

struct SuperEmpty { int arr[0]; };
struct SortOfEmpty { struct SuperEmpty e; };

Both of these have sizeof == 0, even in C++ mode, for GCC compatibility. The
first one also doesn't occupy a register when passed by value in GNU C++ mode,
unlike everything else.

On Darwin, we want to ignore the lot (and especially don't want to try to use
an i0 as we were).

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

7 years agoPermit keywords in module names in #pragma clang module *.
Richard Smith [Fri, 5 May 2017 22:34:07 +0000 (22:34 +0000)]
Permit keywords in module names in #pragma clang module *.

This is necessary to be able to build a libc++ module from preprocessed source
(due to the submodule std.new).

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

7 years agoAdd support for building modules from preprocessed source.
Richard Smith [Fri, 5 May 2017 22:18:51 +0000 (22:18 +0000)]
Add support for building modules from preprocessed source.

To support this, an optional marker "#pragma clang module contents" is
recognized in module map files, and the rest of the module map file from that
point onwards is treated as the source of the module. Preprocessing a module
map produces the input module followed by the marker and then the preprocessed
contents of the module.

Ignoring line markers, a preprocessed module might look like this:

  module A {
    header "a.h"
  }
  #pragma clang module contents
  #pragma clang module begin A
  // ... a.h ...
  #pragma clang module end

The preprocessed output generates line markers, which are not accepted by the
module map parser, so -x c++-module-map-cpp-output should be used to compile
such outputs.

A couple of major parts do not work yet:

1) The files that are listed in the module map must exist on disk, in order to
   build the on-disk header -> module lookup table in the PCM file. To fix
   this, we need the preprocessed output to track the file size and other stat
   information we might use to build the lookup table.

2) Declaration ownership semantics don't work properly yet, since mapping from
   a source location to a module relies on mapping from FileIDs to modules,
   which we can't do if module transitions can occur in the middle of a file.

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

7 years agoMultilib: add dump methods
Jonathan Roelofs [Fri, 5 May 2017 21:30:13 +0000 (21:30 +0000)]
Multilib: add dump methods

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

7 years agoAdd cxxStdInitializerListExpr AST matcher
Jakub Kuderski [Fri, 5 May 2017 21:01:12 +0000 (21:01 +0000)]
Add cxxStdInitializerListExpr AST matcher

Summary:
This adds a new ASTMatcher for CXXStdInitializerListExprs that matches C++ initializer list expressions.

The primary motivation is to use it to fix [[ https://bugs.llvm.org/show_bug.cgi?id=32896 | PR32896 ]] (review here [[ https://reviews.llvm.org/D32767 | D32767 ]]).

Reviewers: alexfh, Prazek, aaron.ballman

Reviewed By: alexfh, aaron.ballman

Subscribers: malcolm.parsons, cfe-commits, klimek

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

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

7 years ago[ODRHash] Fix typo, NFC
Richard Trieu [Fri, 5 May 2017 20:47:50 +0000 (20:47 +0000)]
[ODRHash] Fix typo, NFC

NestedNameSpecifer to NestedNameSpecifier.  This was not a problem before since
one of the included headers transitively brought in the definition of the class
and only manifested as a problem when using the typoed NestedNameSpecifer and
getting an incomplete type error instead of a typo correction.

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

7 years agoDo not redefine the THREAD_ANNOTATION_ATTRIBUTE__ macro in the documentation.
Aaron Ballman [Fri, 5 May 2017 19:56:09 +0000 (19:56 +0000)]
Do not redefine the THREAD_ANNOTATION_ATTRIBUTE__ macro in the documentation.

Patch by Roman Lebedev.

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

7 years ago[ARM] Limit the diagnose when an ISR calls a regular function
Weiming Zhao [Fri, 5 May 2017 19:25:29 +0000 (19:25 +0000)]
[ARM] Limit the diagnose when an ISR calls a regular function

Summary:
When the function is compiled with soft-float or on CPU with no FPU, we
don't need to diagnose for a call from an ISR to a regular function.

Reviewers: jroelofs, eli.friedman

Reviewed By: jroelofs

Subscribers: aemerson, rengolin, javed.absar, cfe-commits

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

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

7 years agoCodeGen: avoid use of @clang.arc.use intrinsic at O0
Saleem Abdulrasool [Fri, 5 May 2017 18:39:06 +0000 (18:39 +0000)]
CodeGen: avoid use of @clang.arc.use intrinsic at O0

The clang.arc.use intrinsic is removed via the ARC Contract Pass.  This
pass is only executed in optimized builds (>= opt level 1).  Prevent the
optimization implemented in SVN r301667 from triggering at optimization
level 0 like every other ARC use intrinsic usage.

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

7 years agoANSIfy more. Still no behavior change.
Nico Weber [Fri, 5 May 2017 17:16:58 +0000 (17:16 +0000)]
ANSIfy more. Still no behavior change.

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

7 years agoANSIfy. No behavior change.
Nico Weber [Fri, 5 May 2017 17:15:08 +0000 (17:15 +0000)]
ANSIfy. No behavior change.

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

7 years agoWarn that the [] spelling of uuid(...) is deprecated.
Nico Weber [Fri, 5 May 2017 17:05:56 +0000 (17:05 +0000)]
Warn that the [] spelling of uuid(...) is deprecated.

https://reviews.llvm.org/D32879

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