]> granicus.if.org Git - clang/log
clang
7 years agoSilence buildbots by tweaking an IR codegen test to be less specific w register names.
Faisal Vali [Mon, 15 May 2017 02:56:02 +0000 (02:56 +0000)]
Silence buildbots by tweaking an IR codegen test to be less specific w register names.

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

7 years ago[NFC] Remove some comments (IR aid) from a test file erroneous committed in r303026
Faisal Vali [Mon, 15 May 2017 01:54:02 +0000 (01:54 +0000)]
[NFC] Remove some comments (IR aid) from a test file erroneous committed in r303026

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

7 years agoFix PR32933: crash on lambda capture of VLA
Faisal Vali [Mon, 15 May 2017 01:49:19 +0000 (01:49 +0000)]
Fix PR32933: crash on lambda capture of VLA

https://bugs.llvm.org/show_bug.cgi?id=32933

Turns out clang wasn't really handling vla's (*) in C++11's for-range entirely correctly.

For e.g. This would lead to generation of buggy IR:

  void foo(int b) {
    int vla[b];
    b = -1;  // This store would affect the '__end = vla + b'
    for (int &c : vla)
      c = 0;
  }

Additionally, code-gen would get confused when VLA's were reference-captured by lambdas, and then used in a for-range, which would result in an attempt to generate IR for '__end = vla + b' within the lambda's body - without any capture of 'b' - hence the assertion.

This patch modifies clang, so that for VLA's it translates the end pointer approximately into:
  __end = __begin + sizeof(vla)/sizeof(vla->getElementType())

As opposed to the __end = __begin + b;

I considered passing a magic value into codegen - or having codegen special case the '__end' variable when it referred to a variably-modified type, but I decided against that approach, because it smelled like I would be increasing a complicated form of coupling, that I think would be even harder to maintain than the above approach (which can easily be optimized (-O1) to refer to the run-time bound that was calculated upon array's creation or copied into the lambda's closure object).

(*) why oh why gcc would you enable this by default?! ;)

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

7 years ago[ASTImporter] Improve handling of incomplete types
Sean Callanan [Sat, 13 May 2017 00:46:33 +0000 (00:46 +0000)]
[ASTImporter] Improve handling of incomplete types

ASTImporter has some bugs when it's importing types
that themselves come from an ExternalASTSource. This
is exposed particularly in the behavior when
comparing complete TagDecls with forward
declarations. This patch does several things:

- Adds a test case making sure that conflicting
  forward-declarations are resolved correctly;
- Extends the clang-import-test harness to test
  two-level importing, so that we make sure we
  complete types when necessary; and
- Fixes a few bugs I found this way. Failure to
  complete types was one; however, I also discovered
  that complete RecordDecls aren't properly added to
  the redecls chain for existing forward
  declarations.

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

7 years agoAdd LangOptions method to query whether we are tracking the owning module for a local...
Richard Smith [Sat, 13 May 2017 00:00:16 +0000 (00:00 +0000)]
Add LangOptions method to query whether we are tracking the owning module for a local declaration.

In preparation for expanding this behavior to cover additional cases.

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

7 years agoRemove unused tracking of owning module for MacroInfo objects.
Richard Smith [Fri, 12 May 2017 23:40:52 +0000 (23:40 +0000)]
Remove unused tracking of owning module for MacroInfo objects.

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

7 years ago[modules] When creating a declaration, cache its owning module immediately
Richard Smith [Fri, 12 May 2017 23:27:00 +0000 (23:27 +0000)]
[modules] When creating a declaration, cache its owning module immediately
rather than waiting until it's queried.

Currently this is only applied to local submodule visibility mode, as we don't
yet allocate storage for the owning module in non-local-visibility modules
compilations.

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

7 years agoRevert r302932, as it appears to be breaking stage2 for some of our modules-enabled...
Richard Smith [Fri, 12 May 2017 20:42:54 +0000 (20:42 +0000)]
Revert r302932, as it appears to be breaking stage2 for some of our modules-enabled buildbots.

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

7 years ago[Sema] Silence buildbot failures introduced by r302935
Simon Dardis [Fri, 12 May 2017 19:55:32 +0000 (19:55 +0000)]
[Sema] Silence buildbot failures introduced by r302935

Attempt to silence buildbot failures by pinning the test to a given
triple rather than the host's triple.

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

7 years agoRemove ignore-empty-index-file option
Teresa Johnson [Fri, 12 May 2017 19:32:17 +0000 (19:32 +0000)]
Remove ignore-empty-index-file option

Summary:
Clang changes to remove this option and replace with a parameter
always set in the context of a ThinLTO distributed backend.

Depends on D33133.

Reviewers: pcc

Subscribers: mehdi_amini, eraman, cfe-commits

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

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

7 years ago[Sema] Support implicit scalar to vector conversions
Simon Dardis [Fri, 12 May 2017 19:11:06 +0000 (19:11 +0000)]
[Sema] Support implicit scalar to vector conversions

This patch teaches clang to perform implicit scalar to vector conversions
when one of the operands of a binary vector expression is a scalar which
can be converted to the element type of the vector without truncation
following GCC's implementation.

If the (constant) scalar is can be casted safely, it is implicitly casted to the
vector elements type and splatted to produce a vector of the same type.

Contributions from: Petar Jovanovic

Reviewers: bruno, vkalintiris

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

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

7 years ago[modules] Simplify module macro handling in non-local-submodule-visibility mode.
Richard Smith [Fri, 12 May 2017 18:56:03 +0000 (18:56 +0000)]
[modules] Simplify module macro handling in non-local-submodule-visibility mode.

When reaching the end of a module, we used to convert its macros to
ModuleMacros but also leave them in the MacroDirective chain for the
identifier. This meant that every lookup of such a macro would find two
(identical) definitions. It also made it difficult to determine the correct
owner for a macro when reaching the end of a module: the most recent
MacroDirective in the chain could be from an #included submodule rather than
the current module.

Simplify this: whenever we convert a MacroDirective to a ModuleMacro when
leaving a module, clear out the MacroDirective chain for that identifier, and
just rely on the ModuleMacro to provide the macro definition information.

(We don't want to do this for local submodule visibility mode, because in that
mode we maintain a distinct MacroDirective chain for each submodule, and we
need to keep around the prior MacroDirective in case we re-enter the submodule
-- for instance, if its header is #included more than once in a module build,
we need the include guard directive to stick around. But the problem doesn't
arise in this case for the same reason: each submodule has its own
MacroDirective chain, so the macros don't leak out of submodules in the first
place.)

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

7 years ago[index] Index template specialization arguments for function templats
Alex Lorenz [Fri, 12 May 2017 16:32:26 +0000 (16:32 +0000)]
[index] Index template specialization arguments for function templats

Also ensure that class template specialization arguments are covered

rdar://31812032

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

7 years agoSimplify DINamespace caching in CGDebugInfo
Adrian Prantl [Fri, 12 May 2017 16:23:53 +0000 (16:23 +0000)]
Simplify DINamespace caching in CGDebugInfo

This addresses review feedback from r302840.

By not canonicalizing namespace decls and using lexical decl context
instead of lookuing up the semantic decl context we can take advantage
of the fact that DINamespaces a reuniqued. This way non-module debug
info is unchanged and module debug info still gets distinct namespace
declarations when they ocur in different modules.

Thanks to Richard Smith for pointing this out!

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

7 years ago[SPARC] Support 'f' and 'e' inline asm constraints.
James Y Knight [Fri, 12 May 2017 16:01:23 +0000 (16:01 +0000)]
[SPARC] Support 'f' and 'e' inline asm constraints.

Patch by Patrick Boettcher.

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

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

7 years agoEnabling the /bigobj flag for SemaDeclAttr.cpp.
Aaron Ballman [Fri, 12 May 2017 14:30:49 +0000 (14:30 +0000)]
Enabling the /bigobj flag for SemaDeclAttr.cpp.

This resolves compile errors with MSVC 2015 x64 debug builds where SemaDeclAttr.cpp is hitting the section symbol limit.

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

7 years ago[Hexagon] Make sure to pass empty struct arguments with nontrivial ctors
Krzysztof Parzyszek [Fri, 12 May 2017 13:18:07 +0000 (13:18 +0000)]
[Hexagon] Make sure to pass empty struct arguments with nontrivial ctors

Thanks to Richard Smith for the suggested fix.

This fixes llvm.org/PR33009

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

7 years agoclang-format: [JS] support non-null assertions after all identifiers.
Martin Probst [Fri, 12 May 2017 13:00:33 +0000 (13:00 +0000)]
clang-format: [JS] support non-null assertions after all identifiers.

Summary:
Previously:
    x = namespace !;

Now:
    x = namespace!;

Reviewers: djasper

Subscribers: klimek

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

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

7 years agoFix an assertion failure (PR33020).
Alexander Kornienko [Fri, 12 May 2017 11:24:25 +0000 (11:24 +0000)]
Fix an assertion failure (PR33020).

Adding a test separately (tools/extra/test/clang-tidy/misc-use-after-move.cpp).

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

7 years ago[analyzer] Add modelling of __builtin_assume
Gabor Horvath [Fri, 12 May 2017 07:02:54 +0000 (07:02 +0000)]
[analyzer] Add modelling of __builtin_assume

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

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

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