]> granicus.if.org Git - clang/log
clang
8 years agoVisual Studio Visualizers for clang::FunctionDecl
Mike Spertus [Sun, 20 Mar 2016 20:15:23 +0000 (20:15 +0000)]
Visual Studio Visualizers for clang::FunctionDecl

Readably displays a FunctionDecl in the Visual Studio Locals Window something like:
  void g(int, double d, struct A && arr)

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

8 years ago[tsan] Allow -fsanitize=thread for iOS-style simulator targets
Devin Coughlin [Sun, 20 Mar 2016 18:24:33 +0000 (18:24 +0000)]
[tsan] Allow -fsanitize=thread for iOS-style simulator targets

Update the clang driver to allow -fsanitize=thread when targeting x86_64 iOS and tvOS
simulators. Also restrict TSan targeting OS X to only be supported on x86_64 and not i386.

Differential Revision: http://reviews.llvm.org/D18280

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

8 years ago[VFS] Fix test to use more restrict set of headers
Bruno Cardoso Lopes [Sun, 20 Mar 2016 18:08:32 +0000 (18:08 +0000)]
[VFS] Fix test to use more restrict set of headers

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

8 years agoAST: Fix some bogus indentation. NFC
Justin Bogner [Sun, 20 Mar 2016 16:58:03 +0000 (16:58 +0000)]
AST: Fix some bogus indentation. NFC

Noticed by Liu Xin. Thanks!

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

8 years agoFixed -Wdocumentation warning
Simon Pilgrim [Sun, 20 Mar 2016 16:25:23 +0000 (16:25 +0000)]
Fixed -Wdocumentation warning

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

8 years agoMark C++ features implemented in Clang 3.8 as done now that 3.8 has released.
Richard Smith [Sun, 20 Mar 2016 10:37:12 +0000 (10:37 +0000)]
Mark C++ features implemented in Clang 3.8 as done now that 3.8 has released.

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

8 years agoP0184R0: Allow types of 'begin' and 'end' expressions in range-based for loops to...
Richard Smith [Sun, 20 Mar 2016 10:33:40 +0000 (10:33 +0000)]
P0184R0: Allow types of 'begin' and 'end' expressions in range-based for loops to differ.

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

8 years agoReapply [2] [VFS] Add 'overlay-relative' field to YAML files
Bruno Cardoso Lopes [Sun, 20 Mar 2016 02:08:48 +0000 (02:08 +0000)]
Reapply [2] [VFS] Add 'overlay-relative' field to YAML files

This reapplies r261552 and r263748. Fixed testcase to reapply.

The VFS overlay mapping between virtual paths and real paths is done through
the 'external-contents' entries in YAML files, which contains hardcoded paths
to the real files.

When a module compilation crashes, headers are dumped into <name>.cache/vfs
directory and are mapped via the <name>.cache/vfs/vfs.yaml. The script
generated for reproduction uses -ivfsoverlay pointing to file to gather the
mapping between virtual paths and files inside <name>.cache/vfs. Currently, we
are only capable of reproducing such crashes in the same machine as they
happen, because of the hardcoded paths in 'external-contents'.

To be able to reproduce a crash in another machine, this patch introduces a new
option in the VFS yaml file called 'overlay-relative'. When it's equal to
'true' it means that the provided path to the YAML file through the
-ivfsoverlay option should also be used to prefix the final path for every
'external-contents'.

Example, given the invocation snippet "... -ivfsoverlay
<name>.cache/vfs/vfs.yaml" and the following entry in the yaml file:

"overlay-relative": "true",
"roots": [
...
  "type": "directory",
  "name": "/usr/include",
  "contents": [
    {
      "type": "file",
      "name": "stdio.h",
      "external-contents": "/usr/include/stdio.h"
    },
...

Here, a file manager request for virtual "/usr/include/stdio.h", that will map
into real path "/<absolute_path_to>/<name>.cache/vfs/usr/include/stdio.h.

This is a useful feature for debugging module crashes in machines other than
the one where the error happened.

Differential Revision: http://reviews.llvm.org/D17457

rdar://problem/24499339

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

8 years agoBetter visualization of clang::BuiltinType in VisualStudio
Mike Spertus [Sun, 20 Mar 2016 00:32:30 +0000 (00:32 +0000)]
Better visualization of clang::BuiltinType in VisualStudio

Whenever possible, use C++ names for visualizing builtin types. E.g., "long double" instead of "LongDouble"

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

8 years agoVisual Studio Visualizer for clang::FunctionProtoType
Mike Spertus [Sun, 20 Mar 2016 00:20:43 +0000 (00:20 +0000)]
Visual Studio Visualizer for clang::FunctionProtoType

Displays return type and parameters for the Function Protoype object in the Locals window.

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

8 years ago[Sema] Make type deduction work with some overloadable functions
George Burgess IV [Sat, 19 Mar 2016 21:51:45 +0000 (21:51 +0000)]
[Sema] Make type deduction work with some overloadable functions

Some functions can't have their address taken. If we encounter an
overload set where only one of the candidates can have its address
taken, we should automatically select that candidate's type in type
deduction.

Differential Revision: http://reviews.llvm.org/D15591

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

8 years ago[Sema] Allow casting of some overloaded functions
George Burgess IV [Sat, 19 Mar 2016 21:36:10 +0000 (21:36 +0000)]
[Sema] Allow casting of some overloaded functions

Some functions can't have their address taken. If we encounter an
overload set where only one of the candidates can have its address
taken, we should automatically select that candidate in cast
expressions.

Differential Revision: http://reviews.llvm.org/D17701

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

8 years ago[TLS on Darwin] use CXX_FAST_TLS calling convention for tls_init.
Manman Ren [Fri, 18 Mar 2016 23:35:21 +0000 (23:35 +0000)]
[TLS on Darwin] use CXX_FAST_TLS calling convention for tls_init.

This makes sure we don't generate a lot of code to spill/reload
CSRs when calling tls_init from the access functions.

This helps performance when tls_init is not inlined into the access
functions.

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

8 years ago[OPENMP] Implementation of codegen for firstprivate clause of target directive
Carlo Bertolli [Fri, 18 Mar 2016 21:43:32 +0000 (21:43 +0000)]
[OPENMP] Implementation of codegen for firstprivate clause of target directive

This patch implements the following aspects:

It extends sema to check that a variable is not reference in both a map clause and firstprivate or private. This is needed to ensure correct functioning at codegen level, apart from being useful for the user.
It implements firstprivate for target in codegen. The implementation applies to both host and nvptx devices.
It adds regression tests for codegen of firstprivate, host and device side when using the host as device, and nvptx side.
Please note that the regression test for nvptx codegen is missing VLAs. This is because VLAs currently require saving and restoring the stack which appears not to be a supported operation by nvptx backend.

It adds a check in sema regression tests for target map, firstprivate, and private clauses.

http://reviews.llvm.org/D18203

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

8 years agoFix printing of anonymous struct typedefs.
Steven Watanabe [Fri, 18 Mar 2016 21:35:59 +0000 (21:35 +0000)]
Fix printing of anonymous struct typedefs.

clang -cc1 -ast-print put the struct
definition in the wrong place, like this:

  struct {} typedef S;

The reason that this happens is that the printing code
first prints the struct definition, and then tells the next
declaration to leave out the type. This behavior
is correct for simple variable declarations, but fails for
typedefs (or extern, mutable, etc).

The patch address this problem by skipping the struct
declaration when we first see it, and then telling the first
subsequent declaration that it needs to print out the full
struct definition.

Differential Revision: http://reviews.llvm.org/D17285

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

8 years ago[Objective-c] Fix a crash in WeakObjectProfileTy::getBaseInfo.
Akira Hatanaka [Fri, 18 Mar 2016 19:03:50 +0000 (19:03 +0000)]
[Objective-c] Fix a crash in WeakObjectProfileTy::getBaseInfo.

The crash occurs in WeakObjectProfileTy::getBaseInfo when getBase() is
called on an ObjCPropertyRefExpr object whose receiver is an interface.
This commit fixes the crash by checking the type of the receiver and
setting IsExact to true if it is an interface.

rdar://problem/25208167

Differential Revision: http://reviews.llvm.org/D18268

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

8 years ago[clang-cl] Allow use of -gline-tables-only
Reid Kleckner [Fri, 18 Mar 2016 18:42:56 +0000 (18:42 +0000)]
[clang-cl] Allow use of -gline-tables-only

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

8 years agoAdd -fnative-half-arguments-and-returns
Pirama Arumuga Nainar [Fri, 18 Mar 2016 16:58:36 +0000 (16:58 +0000)]
Add -fnative-half-arguments-and-returns

Summary:
r246764 handled __fp16 arguments and returns for AAPCS, but skipped this
handling for OpenCL.  Simlar to OpenCL, RenderScript also handles __fp16
type natively.

This patch adds the -fnative-half-arguments-and-returns command line
flag to allow such languages to skip this coercion of __fp16.

Reviewers: srhines, olista01

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D18138

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

8 years agoShow members of DeclContexts (i.e., class members) in Visual Studio native visualizers
Mike Spertus [Fri, 18 Mar 2016 16:38:34 +0000 (16:38 +0000)]
Show members of DeclContexts (i.e., class members) in Visual Studio native visualizers

This change shows members of DeclContext objects in the Visual Studio debugger. It will also cast a TagType like a class or a struct to a DeclContext, so its methods and fields are visualized.

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

8 years agoMake LookupResult movable again.
Benjamin Kramer [Fri, 18 Mar 2016 13:31:00 +0000 (13:31 +0000)]
Make LookupResult movable again.

We lost copy semantics in r263730, because it only worked for a few very
specific cases. Move semantics don't have this issue. Sadly the
implementation is a bit messy but I don't know how to clean it up
without losing support for msvc 2013 :/

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

8 years agoRevert r263783 as buildbot failure is being investigated.
Arpith Chacko Jacob [Fri, 18 Mar 2016 12:39:40 +0000 (12:39 +0000)]
Revert r263783 as buildbot failure is being investigated.

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

8 years ago[OpenMP] Base support for target directive codegen on NVPTX device.
Arpith Chacko Jacob [Fri, 18 Mar 2016 11:47:43 +0000 (11:47 +0000)]
[OpenMP] Base support for target directive codegen on NVPTX device.

Summary:
Reworked test case after buildbot failure on windows.

This patch adds base support for codegen of the target directive on the NVPTX device.

Reviewers: ABataev

Differential Revision: http://reviews.llvm.org/D17877

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

8 years agoRemove usage of LLVM_PREFIX.
Chaoren Lin [Fri, 18 Mar 2016 00:05:37 +0000 (00:05 +0000)]
Remove usage of LLVM_PREFIX.

Summary: LLVM_PREFIX could be undefined if CMAKE_INSTALL_PREFIX were set to empty.

Reviewers: kparzysz, bkramer, chandlerc

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D17784

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

8 years agoRevert r263687 for ubsan bot failure.
Manman Ren [Thu, 17 Mar 2016 22:13:50 +0000 (22:13 +0000)]
Revert r263687 for ubsan bot failure.

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

8 years agoRevert "Reapply [VFS] Add 'overlay-relative' field to YAML files"
Bruno Cardoso Lopes [Thu, 17 Mar 2016 21:30:55 +0000 (21:30 +0000)]
Revert "Reapply [VFS] Add 'overlay-relative' field to YAML files"

Tests failing on
http://bb.pgr.jp/builders/cmake-clang-x86_64-linux/builds/46102

This reverts commit a1683cd6c9e07359c09f86e98a4db6b4e1bc51fc.

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

8 years agoReapply [VFS] Add 'overlay-relative' field to YAML files
Bruno Cardoso Lopes [Thu, 17 Mar 2016 21:11:23 +0000 (21:11 +0000)]
Reapply [VFS] Add 'overlay-relative' field to YAML files

This reapplies r261552.

The VFS overlay mapping between virtual paths and real paths is done through
the 'external-contents' entries in YAML files, which contains hardcoded paths
to the real files.

When a module compilation crashes, headers are dumped into <name>.cache/vfs
directory and are mapped via the <name>.cache/vfs/vfs.yaml. The script
generated for reproduction uses -ivfsoverlay pointing to file to gather the
mapping between virtual paths and files inside <name>.cache/vfs. Currently, we
are only capable of reproducing such crashes in the same machine as they
happen, because of the hardcoded paths in 'external-contents'.

To be able to reproduce a crash in another machine, this patch introduces a new
option in the VFS yaml file called 'overlay-relative'. When it's equal to
'true' it means that the provided path to the YAML file through the
-ivfsoverlay option should also be used to prefix the final path for every
'external-contents'.

Example, given the invocation snippet "... -ivfsoverlay
<name>.cache/vfs/vfs.yaml" and the following entry in the yaml file:

"overlay-relative": "true",
"roots": [
...
  "type": "directory",
  "name": "/usr/include",
  "contents": [
    {
      "type": "file",
      "name": "stdio.h",
      "external-contents": "/usr/include/stdio.h"
    },
...

Here, a file manager request for virtual "/usr/include/stdio.h", that will map
into real path "/<absolute_path_to>/<name>.cache/vfs/usr/include/stdio.h.

This is a useful feature for debugging module crashes in machines other than
the one where the error happened.

Differential Revision: http://reviews.llvm.org/D17457

rdar://problem/24499339

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

8 years agoRe-add (user defined) move ops to UnresolvedSetImpl to allow UnresolvedSet to be...
David Blaikie [Thu, 17 Mar 2016 20:45:38 +0000 (20:45 +0000)]
Re-add (user defined) move ops to UnresolvedSetImpl to allow UnresolvedSet to be implicitly movable

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

8 years agoRevert "For MS ABI, emit dllexport friend functions defined inline in class"
Reid Kleckner [Thu, 17 Mar 2016 20:06:58 +0000 (20:06 +0000)]
Revert "For MS ABI, emit dllexport friend functions defined inline in class"

This reverts commit r263738.

This appears to cause a failure in
CXX/temp/temp.decls/temp.friend/p1.cpp

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

8 years agoFor MS ABI, emit dllexport friend functions defined inline in class
Reid Kleckner [Thu, 17 Mar 2016 19:52:20 +0000 (19:52 +0000)]
For MS ABI, emit dllexport friend functions defined inline in class

Summary: ...as that is apparently what MSVC does

Reviewers: rnk

Patch by Stephan Bergmann

Differential Revision: http://reviews.llvm.org/D15267

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

8 years agoRemove defaulted move ops, the type is zero-cost copyable anyway, so there's no need...
David Blaikie [Thu, 17 Mar 2016 18:28:16 +0000 (18:28 +0000)]
Remove defaulted move ops, the type is zero-cost copyable anyway, so there's no need for specific move ops

(addresses MSVC build error, since MSVC 2013 can't generate default move
ops)

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

8 years agoFix implicit copy ctor and copy assignment operator warnings when -Wdeprecated passed.
David Blaikie [Thu, 17 Mar 2016 18:05:07 +0000 (18:05 +0000)]
Fix implicit copy ctor and copy assignment operator warnings when -Wdeprecated passed.

Fix implicit copy ctor and copy assignment operator warnings
when -Wdeprecated passed.

Patch by Don Hinton!

Differential Revision: http://reviews.llvm.org/D18123

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

8 years agoUse a simpler set of mock headers for the vfs+modules crash recovery tests.
Benjamin Kramer [Thu, 17 Mar 2016 16:19:51 +0000 (16:19 +0000)]
Use a simpler set of mock headers for the vfs+modules crash recovery tests.

The System/ mock is large and too complex for this test. It can cause
the tests to fail in mysterious ways as it depends on the resource dir
being present, which is not really supported for driver tests (using
%clang instead of %clang_cc1). Copy the tree and trim out all the
%unnecessary fat.

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

8 years agoclang-format: [JS] Make requoting of JavaScript string literals only
Daniel Jasper [Thu, 17 Mar 2016 13:03:41 +0000 (13:03 +0000)]
clang-format: [JS] Make requoting of JavaScript string literals only
change affected ranges.

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

8 years agoclang-format: [JS] Fix incorrect spacing around contextual keywords.
Daniel Jasper [Thu, 17 Mar 2016 12:17:59 +0000 (12:17 +0000)]
clang-format: [JS] Fix incorrect spacing around contextual keywords.

Before:
  x.of ();

After:
  x.of();

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

8 years agoclang-format: Slightly weaken AlignAfterOpenBracket=AlwaysBreak.
Daniel Jasper [Thu, 17 Mar 2016 12:00:22 +0000 (12:00 +0000)]
clang-format: Slightly weaken AlignAfterOpenBracket=AlwaysBreak.

If a call takes a single argument, using AlwaysBreak can lead to lots
of wasted lines and additional indentation without improving the
readability in a significant way.

Before:
  caaaaaaaaaaaall(
      caaaaaaaaaaaall(
          caaaaaaaaaaaall(
              caaaaaaaaaaaaaaaaaaaaaaall(aaaaaaaaaaaaaaaaaaaaaaa))));

After:
  caaaaaaaaaaaall(caaaaaaaaaaaall(caaaaaaaaaaaall(
      caaaaaaaaaaaaaaaaaaaaaaall(aaaaaaaaaaaaaaaaaaaaaaa))));

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

8 years ago[OPENMP 4.5] Allow to use private data members in 'copyprivate' clause.
Alexey Bataev [Thu, 17 Mar 2016 10:50:17 +0000 (10:50 +0000)]
[OPENMP 4.5] Allow to use private data members in 'copyprivate' clause.

OpenMP 4.5 allows privatization of non-static data members in non-static
member functions. This patch adds support of private data members in
'copyprivate' clauses.

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

8 years ago[OPENMP 4.0] Use 'declare reduction' constructs in 'reduction' clauses.
Alexey Bataev [Thu, 17 Mar 2016 10:19:46 +0000 (10:19 +0000)]
[OPENMP 4.0] Use 'declare reduction' constructs in 'reduction' clauses.

OpenMP 4.0 allows to define custom reduction operations using '#pragma
omp declare reduction' construct. Patch allows to use this custom
defined reduction operations in 'reduction' clauses.

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

8 years agoMinor code cleanups. NFC.
Junmo Park [Thu, 17 Mar 2016 06:41:27 +0000 (06:41 +0000)]
Minor code cleanups. NFC.

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

8 years ago[VFS] Remove wrong header include
Bruno Cardoso Lopes [Thu, 17 Mar 2016 04:59:52 +0000 (04:59 +0000)]
[VFS] Remove wrong header include

Follow up from r263686. Forgot to remove the wrong header file.

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

8 years ago[index] Make sure that declarations of builtin functions are indexed.
Argyrios Kyrtzidis [Thu, 17 Mar 2016 04:28:19 +0000 (04:28 +0000)]
[index] Make sure that declarations of builtin functions are indexed.

rdar://25154630

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

8 years agoAdd an optional named argument (replacement = "xxx") to AvailabilityAttr.
Manman Ren [Thu, 17 Mar 2016 03:09:55 +0000 (03:09 +0000)]
Add an optional named argument (replacement = "xxx") to AvailabilityAttr.

This commit adds a named argument to AvailabilityAttr, while r263652 adds an
optional string argument to __attribute__((deprecated)). This enables the
compiler to provide Fix-Its for deprecated declarations.

rdar://20588929

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

8 years agoReapply [2]: [VFS] Add support for handling path traversals
Bruno Cardoso Lopes [Thu, 17 Mar 2016 02:20:43 +0000 (02:20 +0000)]
Reapply [2]: [VFS] Add support for handling path traversals

This was applied twice r261551 and 263617 and later reverted because:

(1) Windows bot failing on unittests. Change the current behavior to do
not handle path traversals on windows.

(2) Windows bot failed to include llvm/Config/config.h in order to use
HAVE_REALPATH. Use LLVM_ON_UNIX instead, as done in lib/Basic/FileManager.cpp.

Handle ".", ".." and "./" with trailing slashes while collecting files
to be dumped into the vfs overlay directory.

Include the support for symlinks into components. Given the path:

/install-dir/bin/../lib/clang/3.8.0/include/altivec.h, if "bin"
component is a symlink, it's not safe to use `path::remove_dots` here,
and `realpath` is used to get the right answer. Since `realpath`
is expensive, we only do it at collecting time (which only happens
during the crash reproducer) and cache the base directory for fast lookups.

Overall, this makes the input to the VFS YAML file to be canonicalized
to never contain traversal components.

Differential Revision: http://reviews.llvm.org/D17104

rdar://problem/24499339

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

8 years ago[OPENMP] Support for codegen of private clause of target, host side
Carlo Bertolli [Wed, 16 Mar 2016 19:04:22 +0000 (19:04 +0000)]
[OPENMP] Support for codegen of private clause of target, host side

This patch adds support for codegen of private clause of target and a regression test for host code generation, when the host is used as target device. I believe that code generation for nvptx backend would not require anything additional or different to what is done for the host.

http://reviews.llvm.org/D18105

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

8 years agoAdd an optional string argument to DeprecatedAttr for Fix-It.
Manman Ren [Wed, 16 Mar 2016 18:50:49 +0000 (18:50 +0000)]
Add an optional string argument to DeprecatedAttr for Fix-It.

We only add this to __attribute__((deprecated)).

Differential Revision: http://reviews.llvm.org/D17865

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

8 years agoAdd attributes for preserve_mostcc/preserve_allcc calling conventions to the C/C...
Roman Levenstein [Wed, 16 Mar 2016 18:00:46 +0000 (18:00 +0000)]
Add attributes for preserve_mostcc/preserve_allcc calling conventions to the C/C++ front-end

Till now, preserve_mostcc/preserve_allcc calling convention attributes were only
available at the LLVM IR level. This patch adds attributes for
preserve_mostcc/preserve_allcc calling conventions to the C/C++ front-end.

The code was mostly written by Juergen Ributzka.
I just added support for the AArch64 target and tests.

Differential Revision: http://reviews.llvm.org/D18025

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

8 years agoFix destructor definition of invalid classes
Olivier Goffart [Wed, 16 Mar 2016 14:36:11 +0000 (14:36 +0000)]
Fix destructor definition of invalid classes

The declaration of the destructor of an invalid class was not properly marked
as noexcept. As a result, the definition of the same destructor, which was
properly implicitly marked as noexcept, would not match the definition.
This would cause the definition CXXDestructorDecl to be matked as invalid
and omited from the AST.

Differential Revision: http://reviews.llvm.org/D17988

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

8 years agoAdd visualizers for more clang types. Create more C++-like visualizations for existin...
Mike Spertus [Wed, 16 Mar 2016 14:27:50 +0000 (14:27 +0000)]
Add visualizers for more clang types. Create more C++-like visualizations for existing Clang types

Created visualizer for PointerType, LValueReferenceType, RValueReferenceType, and TemplateParmType.
In addition, cleaned up the display of existing types to be more C++-like. For example, instead of

  SubstTemplateTypeParmType: {Identifier (("T"))} => Record (25), {Identifier (("A"))}

it now displays more readably as

  SubstTemplateTypeParmType: {typename T <= struct A}

The <expand> sections still can be used for all the gory details if necessary.

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

8 years agoRevert r263617, "Reapply: [VFS] Add support for handling path traversals"
NAKAMURA Takumi [Wed, 16 Mar 2016 12:15:29 +0000 (12:15 +0000)]
Revert r263617, "Reapply: [VFS] Add support for handling path traversals"

It broke standalone clang build.

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

8 years agoDirectly get the canonical Type instead of going around through a CanQualType tempora...
Yaron Keren [Wed, 16 Mar 2016 12:14:43 +0000 (12:14 +0000)]
Directly get the canonical Type instead of going around through a CanQualType temporary, NFC.

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

8 years ago[modules] Fix adding a templated friend functions to a namespace from another module.
Vassil Vassilev [Wed, 16 Mar 2016 11:17:04 +0000 (11:17 +0000)]
[modules] Fix adding a templated friend functions to a namespace from another module.

When clang adds argument dependent lookup candidates, it can perform template
instantiation. For example, it can instantiate a templated friend function and
register it in the enclosing namespace's lookup table.

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

Reviewed by Richard Smith.

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

8 years agoAdd more ARM Cortex-R8 regression tests to Clang.
Pablo Barrio [Wed, 16 Mar 2016 10:21:04 +0000 (10:21 +0000)]
Add more ARM Cortex-R8 regression tests to Clang.

Summary:
This patch adds Clang tests for Cortex-R8 related to FP capabilities and
hardware integer divide.

Reviewers: rengolin, bsmith

Subscribers: aemerson, cfe-commits, rengolin

Differential Revision: http://reviews.llvm.org/D18193

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

8 years agoAvoid using LookupResult's implicit copy ctor and assignment operator to avoid warnings
Marina Yatsina [Wed, 16 Mar 2016 09:56:58 +0000 (09:56 +0000)]
Avoid using LookupResult's implicit copy ctor and assignment operator to avoid warnings

The purpose of this patch is to keep the same functionality without using LookupResult's implicit copy ctor and assignment operator, because they cause warnings when -Wdeprecated is passed.
This patch is meant to help the following review: http://reviews.llvm.org/D18123.
The functionality is covered by the tests in my original commit (255890)
The test case in this patch was added to test a bug caught in the review of the first version of this fix.

Differential Revision: http://reviews.llvm.org/D18175

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

8 years agoRevert r263622, "clang/lib/Frontend/ModuleDependencyCollector.cpp: Use clang/Config...
NAKAMURA Takumi [Wed, 16 Mar 2016 08:44:37 +0000 (08:44 +0000)]
Revert r263622, "clang/lib/Frontend/ModuleDependencyCollector.cpp: Use clang/Config/config.h instead of llvm's."

I'll commit better fix(es) later. "llvm/Config/config.h" shouldn't be available here.

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

8 years agoclang/lib/Frontend/ModuleDependencyCollector.cpp: Use clang/Config/config.h instead...
NAKAMURA Takumi [Wed, 16 Mar 2016 08:28:55 +0000 (08:28 +0000)]
clang/lib/Frontend/ModuleDependencyCollector.cpp: Use clang/Config/config.h instead of llvm's.

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

8 years agoReapply: [VFS] Add support for handling path traversals
Bruno Cardoso Lopes [Wed, 16 Mar 2016 04:39:38 +0000 (04:39 +0000)]
Reapply: [VFS] Add support for handling path traversals

This is originally r261551, reverted because of windows bots failing on
unittests. Change the current behavior to do not handle path traversals
on windows.

Handle ".", ".." and "./" with trailing slashes while collecting files
to be dumped into the vfs overlay directory.

Include the support for symlinks into components. Given the path:

/install-dir/bin/../lib/clang/3.8.0/include/altivec.h, if "bin"
component is a symlink, it's not safe to use `path::remove_dots` here,
and `realpath` is used to get the right answer. Since `realpath`
is expensive, we only do it at collecting time (which only happens
during the crash reproducer) and cache the base directory for fast lookups.

Overall, this makes the input to the VFS YAML file to be canonicalized
to never contain traversal components.

Differential Revision: http://reviews.llvm.org/D17104

rdar://problem/24499339

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

8 years agoConvert some ObjC msgSends to runtime calls.
Pete Cooper [Wed, 16 Mar 2016 00:33:21 +0000 (00:33 +0000)]
Convert some ObjC msgSends to runtime calls.

It is faster to directly call the ObjC runtime for methods such as retain/release instead of sending a message to those functions.

This patch adds support for converting messages to retain/release/alloc/autorelease to their equivalent runtime calls.

Tests included for the positive case of applying this transformation, negative tests that we ensure we only convert "alloc" to objc_alloc, not "alloc2", and also a driver test to ensure we enable this only for supported runtime versions.

Reviewed by John McCall.

Differential Revision: http://reviews.llvm.org/D14737

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

8 years agoMyriad: define __myriad2 macro automatically
Douglas Katzman [Tue, 15 Mar 2016 22:34:02 +0000 (22:34 +0000)]
Myriad: define __myriad2 macro automatically

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

8 years agoRevert commit http://reviews.llvm.org/D17877 to fix tests on x86.
Arpith Chacko Jacob [Tue, 15 Mar 2016 21:26:34 +0000 (21:26 +0000)]
Revert commit http://reviews.llvm.org/D17877 to fix tests on x86.

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

8 years ago[OpenMP] Base support for target directive codegen on NVPTX device.
Arpith Chacko Jacob [Tue, 15 Mar 2016 21:04:57 +0000 (21:04 +0000)]
[OpenMP] Base support for target directive codegen on NVPTX device.

Summary:
This patch adds base support for codegen of the target directive on the NVPTX device.

Reviewers: ABataev

Differential Revision: http://reviews.llvm.org/D17877

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

8 years agoMove the fixit for -Wformat-security to a note.
Bob Wilson [Tue, 15 Mar 2016 20:56:38 +0000 (20:56 +0000)]
Move the fixit for -Wformat-security to a note.

r263299 added a fixit for the -Wformat-security warning, but that runs
into complications with our guideline that error recovery should be done
as-if the fixit had been applied. Putting the fixit on a note avoids that.

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

8 years ago[cfi] Don't emit checks for disabled CFI kinds.
Evgeniy Stepanov [Tue, 15 Mar 2016 20:19:29 +0000 (20:19 +0000)]
[cfi] Don't emit checks for disabled CFI kinds.

In the cross-DSO CFI mode clang emits __cfi_check_fail that handles
errors triggered from other modules with targets in the current
module. With this change, __cfi_check_fail will handle errors for
CFI kinds that are not enabled in the current module as if they
have the trapping behaviour (-fsanitize-trap=...).

This fixes a bug where some combinations of -fsanitize* flags may
result in a link failure due to a missing sanitizer runtime library
for the diagnostic calls in __cfi_check_fail.

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

8 years agoTest commit - Remove some trailing whitespace
Pablo Barrio [Tue, 15 Mar 2016 19:03:09 +0000 (19:03 +0000)]
Test commit - Remove some trailing whitespace

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

8 years ago[CMake] Updating Apple build configurations
Chris Bieneman [Tue, 15 Mar 2016 18:27:28 +0000 (18:27 +0000)]
[CMake] Updating Apple build configurations

This updates Apple build configurations to adapt to r263566 & r263570, which added a PACKAGE_VENDOR variable.

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

8 years ago[CMake] Defaulting CLANG_VENDOR to PACKAGE_VENDOR
Chris Bieneman [Tue, 15 Mar 2016 18:25:36 +0000 (18:25 +0000)]
[CMake] Defaulting CLANG_VENDOR to PACKAGE_VENDOR

LLVM r263566 adds a generic PACKAGE_VENDOR configuration which can be used to specify the vendor for LLVM toolchain tools. This change defaults the CLANG_VENDOR to the PACKAGE_VENDOR so that you don't have to specify both when building a package.

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

8 years agoFix a bot I broke.
Chris Bieneman [Tue, 15 Mar 2016 18:17:48 +0000 (18:17 +0000)]
Fix a bot I broke.

The builtin library isn't added by the driver unless it exists, so we shouldn't check for it. I've marked this as a FIXME, because we probably should have a way to test this.

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

8 years ago[Driver] [Darwin] Fix linking libclang_rt.profile_*sim.a
Chris Bieneman [Tue, 15 Mar 2016 18:08:20 +0000 (18:08 +0000)]
[Driver] [Darwin] Fix linking libclang_rt.profile_*sim.a

Summary: isTarget*() calls are order-dependent. This is because iOS Sim *is* iOS. This means checks for the simulator version of the platform must always be ahead of checks for the embedded platform.

Reviewers: zaks.anna, bogner

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D17947

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

8 years agoMyriad: Pass -mcpu to movi{Compile,Asm}
Douglas Katzman [Tue, 15 Mar 2016 16:41:31 +0000 (16:41 +0000)]
Myriad: Pass -mcpu to movi{Compile,Asm}

Differential Revision: http://reviews.llvm.org/D18186

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

8 years agoReverted http://reviews.llvm.org/D17877 to fix tests.
Arpith Chacko Jacob [Tue, 15 Mar 2016 16:19:13 +0000 (16:19 +0000)]
Reverted http://reviews.llvm.org/D17877 to fix tests.

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

8 years ago[OpenMP] Base support for target directive codegen on NVPTX device.
Arpith Chacko Jacob [Tue, 15 Mar 2016 15:24:52 +0000 (15:24 +0000)]
[OpenMP] Base support for target directive codegen on NVPTX device.

Summary:
This patch adds base support for codegen of the target directive on the NVPTX device.

Reviewers: ABataev

Differential Revision: http://reviews.llvm.org/D17877

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

8 years agoMake it possible for AST plugins to enable themselves by default
John Brawn [Tue, 15 Mar 2016 12:51:40 +0000 (12:51 +0000)]
Make it possible for AST plugins to enable themselves by default

Currently when an AST plugin is loaded it must then be enabled by passing
-plugin pluginname or -add-plugin pluginname to the -cc1 command line. This
patch adds a method to PluginASTAction which allows it to declare that the
action happens before, instead of, or after the main AST action, plus the
relevant changes to make the plugin action happen at that time automatically.

Differential Revision: http://reviews.llvm.org/D17959

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

8 years agoRestrict the hack from r263429 to asan and msan.
Benjamin Kramer [Tue, 15 Mar 2016 09:41:39 +0000 (09:41 +0000)]
Restrict the hack from r263429 to asan and msan.

The other sanitizers don't have backend passes that rely on value names.
Avoid paying the compile time cost of names there.

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

8 years ago[ThinLTO] Clang side of renaming of function index (NFC)
Teresa Johnson [Tue, 15 Mar 2016 00:04:44 +0000 (00:04 +0000)]
[ThinLTO] Clang side of renaming of function index (NFC)

This is the companion to an LLVM patch that renamed the function index
data structures and files to use the more general module summary index.

(Recommit after fixing LLVM side to add back missed file)

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

8 years agoclang/test/CodeGenCXX/virtual-function-attrs.cpp: Appease i686-mingw32 to expect...
NAKAMURA Takumi [Mon, 14 Mar 2016 23:00:44 +0000 (23:00 +0000)]
clang/test/CodeGenCXX/virtual-function-attrs.cpp: Appease i686-mingw32 to expect x86_thiscallcc.

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

8 years agoRevert "[ThinLTO] Clang side of renaming of function index (NFC)"
Teresa Johnson [Mon, 14 Mar 2016 21:18:17 +0000 (21:18 +0000)]
Revert "[ThinLTO] Clang side of renaming of function index (NFC)"

This reverts commit r263491. Missed a file on the LLVM side.

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

8 years ago[ThinLTO] Clang side of renaming of function index (NFC)
Teresa Johnson [Mon, 14 Mar 2016 21:06:06 +0000 (21:06 +0000)]
[ThinLTO] Clang side of renaming of function index (NFC)

This is the companion to an LLVM patch that renamed the function index
data structures and files to use the more general module summary index.

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

8 years ago[CMake] Updating Apple Clang CMake caches
Chris Bieneman [Mon, 14 Mar 2016 20:23:21 +0000 (20:23 +0000)]
[CMake] Updating Apple Clang CMake caches

This is a big update that gets the public configurations more in line with the ones we're actually using internally to ship Clang in Xcode.

From here forward I expect most of the changes in these files to be incremental as the changes get made internally.

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

8 years agoRelax test introduced in r263464 to accept ARM ABI output.
Peter Collingbourne [Mon, 14 Mar 2016 20:13:59 +0000 (20:13 +0000)]
Relax test introduced in r263464 to accept ARM ABI output.

Should fix ARM bots.

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

8 years agoclang-format: [JS] Handle certain cases of ASI.
Daniel Jasper [Mon, 14 Mar 2016 19:21:36 +0000 (19:21 +0000)]
clang-format: [JS] Handle certain cases of ASI.

Automatic Semicolon Insertion can only be properly handled by parsing
source code. However conservatively catching just a few, common
situations prevents breaking code during development, which greatly
improves usability.

JS code should still use semicolons, and ASI code should be flagged by
a compiler or linter.

Patch by Martin Probst. Thank you.

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

8 years agoCodeGen: Use 32-bit gep offsets to address vtable address points.
Peter Collingbourne [Mon, 14 Mar 2016 19:07:10 +0000 (19:07 +0000)]
CodeGen: Use 32-bit gep offsets to address vtable address points.

The relative vtable ABI will use a struct rather than an array as the type
of a vtable. LLVM only allows 32-bit integers as struct indices, so we need
to use 32-bit integers to get addresses of address points. In order to keep
the code simple, we might as well do that unconditionally.

It's probably a reasonable implementation limit to support no more than 2
billion virtual functions per class.

This change causes quite a bit of churn in the test suite, so I'm making
it separately.

Differential Revision: http://reviews.llvm.org/D18113

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

8 years agoCodeGen: Mark functions used in vtables as unnamed_addr.
Peter Collingbourne [Mon, 14 Mar 2016 18:41:59 +0000 (18:41 +0000)]
CodeGen: Mark functions used in vtables as unnamed_addr.

This marks virtual function declarations, as well as runtime library functions
__cxa_pure_virtual, __cxa_deleted_virtual and _purecall, as unnamed_addr. This
will allow us to correctly form relative references to them from vtables in
the relative vtable ABI.

Differential Revision: http://reviews.llvm.org/D18071

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

8 years ago[modules] Don't diagnose non-modular includes from modular files that are
Richard Smith [Mon, 14 Mar 2016 17:52:37 +0000 (17:52 +0000)]
[modules] Don't diagnose non-modular includes from modular files that are
implementation units of modules rather than interface units.

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

8 years ago[OpenMP] Replace offloading option that start with -o with -fo.
Samuel Antao [Mon, 14 Mar 2016 15:57:41 +0000 (15:57 +0000)]
[OpenMP] Replace offloading option that start with -o with -fo.

Summary:
The current offloading implementation is using -omptargets and -omp-host-ir-file-path options in the frontend. This causes the user a lot of trouble due to to the conflicts with the -o option. E.g. if the user misspells  omptargets he will end up with a file with a weird name.

This patches replaces these two options with  -fomptargets and -fomp-host-ir-file-path to avoid these issues, and it is also more consistent with the other options like -fopenmp.

Reviewers: hfinkel, carlo.bertolli, arpith-jacob, kkwli0, ABataev

Subscribers: cfe-commits, caomhin, fraggamuffin

Differential Revision: http://reviews.llvm.org/D18112

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

8 years agoRevert "Recommitted r261634 "Supporting all entities declared in lexical scope in...
Benjamin Kramer [Mon, 14 Mar 2016 14:58:28 +0000 (14:58 +0000)]
Revert "Recommitted r261634 "Supporting all entities declared in lexical scope in LLVM debug info." After fixing PR26715 at r263379."

This reverts commit r263425. Breaks self-host.

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

8 years agoFix some more tests with CLANG_DEFAULT_CXX_STDLIB
Jonas Hahnfeld [Mon, 14 Mar 2016 14:34:10 +0000 (14:34 +0000)]
Fix some more tests with CLANG_DEFAULT_CXX_STDLIB

Also use -stdlib=platform instead of -stdlib=libstdc++ when testing if Clang
chooses the correct default for the given platform.

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

8 years agoMake FreeBSD and NetBSD use CLANG_DEFAULT_CXX_STDLIB
Jonas Hahnfeld [Mon, 14 Mar 2016 14:34:04 +0000 (14:34 +0000)]
Make FreeBSD and NetBSD use CLANG_DEFAULT_CXX_STDLIB

Also introduce -stdlib=platform to override the configured value
and use it to make the tests always pass.

Differential Revision: http://reviews.llvm.org/D17286

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

8 years ago[Frontend] Disable value name discarding for all sanitizers.
Benjamin Kramer [Mon, 14 Mar 2016 13:23:58 +0000 (13:23 +0000)]
[Frontend] Disable value name discarding for all sanitizers.

ASan also relies on names on allocas and will emit unhelpful output if
they're not present. Just force-enable value names for now. Should
unbreak release builds of asan.

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

8 years agoRecommitted r261634 "Supporting all entities declared in lexical scope in LLVM debug...
Amjad Aboud [Mon, 14 Mar 2016 12:03:55 +0000 (12:03 +0000)]
Recommitted r261634 "Supporting all entities declared in lexical scope in LLVM debug info."
After fixing PR26715 at r263379.

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

8 years ago[Driver] Enable --rtlib option for MSVC target
Andrey Turetskiy [Mon, 14 Mar 2016 11:19:43 +0000 (11:19 +0000)]
[Driver] Enable --rtlib option for MSVC target

This enables "--rtlib compiler-rt" option under MSVC environment.

Patch by Roman Shirokiy.

Differential Revision: http://reviews.llvm.org/D17453

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

8 years agoTemporarily make discard value names depend on whether or not we're
Eric Christopher [Mon, 14 Mar 2016 08:10:47 +0000 (08:10 +0000)]
Temporarily make discard value names depend on whether or not we're
trying to track origins in the memory sanitizer since the backend
instrumentation pass currently takes names from the Instruction.

Fixes all of the origin tracking tests in compiler-rt after the
-discard-value-name option was added.

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

8 years agoGive the test a temporary output so it can be cleaned up.
Eric Christopher [Mon, 14 Mar 2016 06:21:07 +0000 (06:21 +0000)]
Give the test a temporary output so it can be cleaned up.

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

8 years agoTry to get cl-pch-showincludes passing on AArch64 bots.
Nico Weber [Sun, 13 Mar 2016 22:26:26 +0000 (22:26 +0000)]
Try to get cl-pch-showincludes passing on AArch64 bots.

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

8 years agoRemove compile time PreserveName in favor of a runtime cc1 -discard-value-names option
Mehdi Amini [Sun, 13 Mar 2016 21:05:23 +0000 (21:05 +0000)]
Remove compile time PreserveName in favor of a runtime cc1 -discard-value-names option

Summary:
This flag is enabled by default in the driver when NDEBUG is set. It
is forwarded on the LLVMContext to discard all value names (but
GlobalValue) for performance purpose.

This an improved version of D18024

Reviewers: echristo, chandlerc

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D18127

From: Mehdi Amini <mehdi.amini@apple.com>

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

8 years agoAdded test that covers changes in r263379.
Amjad Aboud [Sun, 13 Mar 2016 11:12:57 +0000 (11:12 +0000)]
Added test that covers changes in r263379.

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

8 years agoUpdate for new argument to scalbn
Matt Arsenault [Sun, 13 Mar 2016 05:12:47 +0000 (05:12 +0000)]
Update for new argument to scalbn

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

8 years agoAlso test that the pch file is not printed in /showIncludes
Nico Weber [Sun, 13 Mar 2016 03:04:46 +0000 (03:04 +0000)]
Also test that the pch file is not printed in /showIncludes

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

8 years agoMake test a bit stricter to check not just the file basename is printed.
Nico Weber [Sun, 13 Mar 2016 02:48:51 +0000 (02:48 +0000)]
Make test a bit stricter to check not just the file basename is printed.

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

8 years agoclang-cl: Add /Yc argument to /showIncludes output.
Nico Weber [Sun, 13 Mar 2016 02:44:13 +0000 (02:44 +0000)]
clang-cl: Add /Yc argument to /showIncludes output.

To make this work, delay printing of ExtraDeps in HeaderIncludesCallback a bit,
so that it happens after CompilerInstance::InitializeSourceManager() has run.

General /FI arguments are still missing from /showIncludes output, this still
needs to be fixed.

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

8 years agoclang-cl: Add a test for the interaction of /Yc and /showIncludes.
Nico Weber [Sat, 12 Mar 2016 19:55:59 +0000 (19:55 +0000)]
clang-cl: Add a test for the interaction of /Yc and /showIncludes.

We almost get this right, but not completely (see FIXME).  It looks like /FI
headers generally aren't included in /showIncludes yet, but they should be.
But it seems good to have test coverage for the bits that already work.

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

8 years agoTemporarily revert these patches:
Eric Christopher [Sat, 12 Mar 2016 01:47:11 +0000 (01:47 +0000)]
Temporarily revert these patches:

commit 60d9845f6a037122d9be9a6d92d4de617ef45b04
Author: Mehdi Amini <mehdi.amini@apple.com>
Date:   Fri Mar 11 18:48:02 2016 +0000

    Fix clang crash: when CodeGenAction is initialized without a
    context, use the member and not the parameter

    From: Mehdi Amini <mehdi.amini@apple.com>

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

commit af7ce3bf04a75ad5124b457b805df26006bd215b
Author: Mehdi Amini <mehdi.amini@apple.com>
Date:   Fri Mar 11 17:32:58 2016 +0000

    Fix build: use -> with pointers and not .

    Silly typo.

    From: Mehdi Amini <mehdi.amini@apple.com>

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

commit d0eea119192814954e7368c77d0dc5a9eeec1fbb
Author: Mehdi Amini <mehdi.amini@apple.com>
Date:   Fri Mar 11 17:15:44 2016 +0000

    Remove compile time PreserveName switch based on NDEBUG

    Summary:
    Following r263086, we are now relying on a flag on the Context to
    discard Value names in release builds.

    Reviewers: chandlerc

    Subscribers: cfe-commits

    Differential Revision: http://reviews.llvm.org/D18024

    From: Mehdi Amini <mehdi.amini@apple.com>

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

until we can fix the Release builds.

This reverts commits 263257, 263267, 263273

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

8 years agoMake functions in altivec.h be __inline__. As they are all also marked
Daniel Jasper [Fri, 11 Mar 2016 22:13:28 +0000 (22:13 +0000)]
Make functions in altivec.h be __inline__. As they are all also marked
__always_inline__, this has likely been meant from the start.

Review: http://reviews.llvm.org/D18015

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