]> granicus.if.org Git - clang/log
clang
8 years agoclang/test/Driver/darwin-multiarch-arm.c: Appease the case that "ld.exe" exists on...
NAKAMURA Takumi [Sat, 16 Jan 2016 08:35:53 +0000 (08:35 +0000)]
clang/test/Driver/darwin-multiarch-arm.c: Appease the case that "ld.exe" exists on %PATH% on win32.

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

8 years agoFix buildbot bustage in Driver/darwin-multiarch-arm.c caused by r257983.
Justin Lebar [Sat, 16 Jan 2016 04:50:13 +0000 (04:50 +0000)]
Fix buildbot bustage in Driver/darwin-multiarch-arm.c caused by r257983.

The test was too loose; "ld" was matching directories named "build" in
the path.

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

8 years ago[Cygwin] Use -femulated-tls by default since r257718 introduced the new pass.
NAKAMURA Takumi [Sat, 16 Jan 2016 03:44:52 +0000 (03:44 +0000)]
[Cygwin] Use -femulated-tls by default since r257718 introduced the new pass.

FIXME: Add more targets to use emutls into clang/test/Driver/emulated-tls.cpp.
FIXME: Add cygwin tests into llvm/test/CodeGen/X86. Working in progress.

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

8 years agoRespect bound archs, even when they don't alter the toolchain.
Justin Lebar [Sat, 16 Jan 2016 03:30:08 +0000 (03:30 +0000)]
Respect bound archs, even when they don't alter the toolchain.

Summary:
It's possible to BindArch without changing the toolchain at all.  For
example, armv7 and armv7s have exactly the same toolchain triple.

Therefore the code in the Driver that checks that we're not creating a
job for the same Action twice needs to consider (Action, Toolchain,
BoundArch) tuples.

Reviewers: tra

Subscribers: aemerson, echristo, beanz, cfe-commits

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

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

8 years ago[libclang] Add missing CINDEX_LINKAGE from some new APIs in Index.h.
Argyrios Kyrtzidis [Sat, 16 Jan 2016 03:01:20 +0000 (03:01 +0000)]
[libclang] Add missing CINDEX_LINKAGE from some new APIs in Index.h.

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

8 years agoIntroduce -fsanitize-stats flag.
Peter Collingbourne [Sat, 16 Jan 2016 00:31:22 +0000 (00:31 +0000)]
Introduce -fsanitize-stats flag.

This is part of a new statistics gathering feature for the sanitizers.
See clang/docs/SanitizerStats.rst for further info and docs.

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

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

8 years ago[libclang] Introduce APIs for evaluating a cursor and checking if a macro is builtin...
Argyrios Kyrtzidis [Sat, 16 Jan 2016 00:20:02 +0000 (00:20 +0000)]
[libclang] Introduce APIs for evaluating a cursor and checking if a macro is builtin/function.

rdar://24091595

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

8 years agoOpaquePtr: Use nullptr construction for ParsedType OpaquePtr typedef
David Blaikie [Fri, 15 Jan 2016 23:43:34 +0000 (23:43 +0000)]
OpaquePtr: Use nullptr construction for ParsedType OpaquePtr typedef

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

8 years agoOpaquePtr: Use nullptr construction for TemplateTy OpaquePtr typedef
David Blaikie [Fri, 15 Jan 2016 23:43:28 +0000 (23:43 +0000)]
OpaquePtr: Use nullptr construction for TemplateTy OpaquePtr typedef

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

8 years agoOpaquePtr: Use nullptr construction for DeclGroupPtrTy OpaquePtr typedef
David Blaikie [Fri, 15 Jan 2016 23:43:25 +0000 (23:43 +0000)]
OpaquePtr: Use nullptr construction for DeclGroupPtrTy OpaquePtr typedef

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

8 years agoOpaquePtr: Provide conversion-from-nullptr_t to make default construction simpler...
David Blaikie [Fri, 15 Jan 2016 23:43:21 +0000 (23:43 +0000)]
OpaquePtr: Provide conversion-from-nullptr_t to make default construction simpler to read/write

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

8 years ago[CMake] Fix bots broken by including order file generation in check-all
Chris Bieneman [Fri, 15 Jan 2016 22:44:18 +0000 (22:44 +0000)]
[CMake] Fix bots broken by including order file generation in check-all

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

8 years agoAvoid self-assignment of SmallString, trigger UB behavior down the road.
Joerg Sonnenberger [Fri, 15 Jan 2016 22:29:34 +0000 (22:29 +0000)]
Avoid self-assignment of SmallString, trigger UB behavior down the road.

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

8 years agoMake -Wdelete-non-virtual-dtor warn on explicit `a->~A()` dtor calls too.
Nico Weber [Fri, 15 Jan 2016 21:45:31 +0000 (21:45 +0000)]
Make -Wdelete-non-virtual-dtor warn on explicit `a->~A()` dtor calls too.

-Wdelete-non-virtual-dtor warns if A is a type with virtual functions but
without virtual dtor has its constructor called via `delete a`. This makes the
warning also fire if the dtor is called via `a->~A()`. This would've found a
security bug in Chromium at compile time. Fixes PR26137.

To fix the warning, add a virtual destructor, make the class final, or remove
its other virtual methods.  If you want to silence the warning, there's also
a fixit that shows how:

test.cc:12:3: warning: destructor called on 'B' ... [-Wdelete-non-virtual-dtor]
  b->~B();
  ^
test.cc:12:6: note: qualify call to silence this warning
  b->~B();
     ^
     B::

http://reviews.llvm.org/D16206

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

8 years ago[analyzer] Check for return of nil in ObjC methods with nonnull return type.
Devin Coughlin [Fri, 15 Jan 2016 21:35:40 +0000 (21:35 +0000)]
[analyzer] Check for return of nil in ObjC methods with nonnull return type.

Update NullabilityChecker so that it checks return statements in ObjC methods.
Previously it was returning early because methods do not have a function type.

Also update detection of violated parameter _Nonnull preconditions to handle
ObjC methods.

rdar://problem/24200560

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

8 years ago[CMake] [Order-files] Use print_function as an attempt at being forward compatible.
Chris Bieneman [Fri, 15 Jan 2016 21:30:06 +0000 (21:30 +0000)]
[CMake] [Order-files] Use print_function as an attempt at being forward compatible.

Based on feedback from bogner.

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

8 years ago[CMake] Support generation of linker order files using dtrace
Chris Bieneman [Fri, 15 Jan 2016 21:21:12 +0000 (21:21 +0000)]
[CMake] Support generation of linker order files using dtrace

Summary:
This patch extends the lit-based perf-training tooling supplied for PGO data generation to also generate linker order files using dtrace.

This patch should work on any system that has dtrace. If CMake can find the dtrace tool it will generate a target 'generate-order-file' which will run the per-training tests wrapped by dtrace to capture function entries. There are several algorithms implemented for sorting the order files which can be experimented with for best performance. The dtrace wrapper also supports bot oneshot and pid probes.

The perf-helper.py changes to support order file construction are ported from internal changes by ddunbar; he gets all the credit for the hard work here, I just copy and pasted.

Note: I've tested these patches on FreeBSD and OS X 10.10.

Reviewers: ddunbar, bogner, silvas

Subscribers: llvm-commits, emaste

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

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

8 years agoAdd OpenMP dist_schedule clause to distribute directive and related regression tests.
Carlo Bertolli [Fri, 15 Jan 2016 18:50:31 +0000 (18:50 +0000)]
Add OpenMP dist_schedule clause to distribute directive and related regression tests.

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

8 years ago[analyzer] Provide .def-files and visitors for SVal/SymExpr/MemRegion, v2.
Artem Dergachev [Fri, 15 Jan 2016 15:22:05 +0000 (15:22 +0000)]
[analyzer] Provide .def-files and visitors for SVal/SymExpr/MemRegion, v2.

Provide separate visitor templates for the three hierarchies, and also
the `FullSValVisitor' class, which is a union of all three visitors.

Additionally, add a particular example visitor, `SValExplainer', in order to
test the visitor templates. This visitor is capable of explaining the SVal,
SymExpr, or MemRegion in a natural language.

Compared to the reverted r257605, this fixes the test that used to fail
on some triples, and fixes build failure under -fmodules.

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

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

8 years agoFix a -Wparentheses warning in ASTDiagnostic.cpp.
James Y Knight [Fri, 15 Jan 2016 05:57:41 +0000 (05:57 +0000)]
Fix a -Wparentheses warning in ASTDiagnostic.cpp.

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

8 years agoFixing more issues with template type diffing
Richard Trieu [Fri, 15 Jan 2016 05:48:38 +0000 (05:48 +0000)]
Fixing more issues with template type diffing

1) Print qualifiers for templates with zero arguments
2) Add a few more tests for the template type diffing refactoring.
Specifically, PR24587 has been fixed and has a test case from
http://reviews.llvm.org/D15384
3) Adds asserts to check the DiffTree is in correct state when moving nodes
4) Rename the field FromType and ToType since it is heavily used within
member functions.

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

8 years agoAdd new diff modes to template type diffing.
Richard Trieu [Fri, 15 Jan 2016 05:01:53 +0000 (05:01 +0000)]
Add new diff modes to template type diffing.

Remove an old assertion that does not hold.  It is possible for a template
argument to be a declaration in one instantiation and an integer in another.
Create two new diff kinds for these (decl vs int and int vs decl).

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

8 years agoPR26111: segmentation fault with __attribute__((mode(QI))) on function declaration...
Alexey Bataev [Fri, 15 Jan 2016 04:36:32 +0000 (04:36 +0000)]
PR26111: segmentation fault with __attribute__((mode(QI))) on function declaration, by Denis Zobnin
Allow "mode" attribute to be applied to VarDecl, not ValueDecl (which includes FunctionDecl and EnumConstantDecl), emit an error if this attribute is used with function declarations and enum constants.
Differential Revision: http://reviews.llvm.org/D16112

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

8 years ago[X86] Support 'interrupt' attribute for x86
Alexey Bataev [Fri, 15 Jan 2016 04:06:31 +0000 (04:06 +0000)]
[X86] Support 'interrupt' attribute for x86
This attribute may be attached to a function definition and instructs the backend to generate appropriate function entry/exit code so that
it can be used directly as an interrupt handler.
The IRET instruction, instead of the RET instruction, is used to return from interrupt or exception handlers. All registers, except for the EFLAGS register which is restored by the IRET instruction, are preserved by the compiler.
Any interruptible-without-stack-switch code must be compiled with -mno-red-zone since interrupt handlers can and will, because of the hardware design, touch
the red zone.

interrupt handler must be declared with a mandatory pointer argument:
struct interrupt_frame;

__attribute__ ((interrupt))
void f (struct interrupt_frame *frame) {
    ...
}
and user must properly define the structure the pointer pointing to.

exception handler:

The exception handler is very similar to the interrupt handler with a different mandatory function signature:
#ifdef __x86_64__
typedef unsigned long long int uword_t;
#else
typedef unsigned int uword_t;
#endif

struct interrupt_frame;

__attribute__ ((interrupt))
void f (struct interrupt_frame *frame, uword_t error_code) {
    ...
}
and compiler pops the error code off stack before the IRET instruction.

The exception handler should only be used for exceptions which push an error code and all other exceptions must use the interrupt handler.
The system will crash if the wrong handler is used.
Differential Revision: http://reviews.llvm.org/D15709

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

8 years ago[CodeGen] Attach attributes to thread local wrapper function.
Akira Hatanaka [Fri, 15 Jan 2016 03:34:06 +0000 (03:34 +0000)]
[CodeGen] Attach attributes to thread local wrapper function.

This commit is a follow-up to r251734, r251476, and r249735, which fixes
a bug where function attributes were not attached to thread local
wrapper functions.

rdar://problem/20828324

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

8 years agoWhen copying whitespace flags from the token naming a macro argument onto the
Richard Smith [Fri, 15 Jan 2016 03:24:18 +0000 (03:24 +0000)]
When copying whitespace flags from the token naming a macro argument onto the
first token of the expansion, don't forget to copy the "is at the start of a
line" token (which is always false, as newlines cannot appear within a macro
body); otherwise, stringizing the result can insert spurious whitespace.

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

8 years agoSave the integer type for integral template arguments.
Richard Trieu [Fri, 15 Jan 2016 02:55:17 +0000 (02:55 +0000)]
Save the integer type for integral template arguments.

Save the integer type when diffing integers in template type diffing.  When
integers are different sizes, print out the type along with the integer value.
Also with the type information, print true and false instead of 1 and 0 for
boolean values.

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

8 years agoMake template type diffing use the new desguared iterator.
Richard Trieu [Fri, 15 Jan 2016 01:08:56 +0000 (01:08 +0000)]
Make template type diffing use the new desguared iterator.

If available, use the canonical template argument to fill in information for
template type diffing instead of attempting to special case and evaluate Expr's
for the value.  Since those are the values used in template instantiation,
we don't have to worry about difference between our evaluator and theirs.  Also
move the nullptr template arguments from DiffKind::Expression to
DiffKind::Declaration and allow DiffKind::Declaration to set an Expr.  The only
effect that should result is that a named nullptr will show up as
'ptr aka nullptr' in diagnostics.

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

8 years ago[CUDA] Warn undeclared identifiers in CUDA kernel calls
Justin Lebar [Thu, 14 Jan 2016 23:31:30 +0000 (23:31 +0000)]
[CUDA] Warn undeclared identifiers in CUDA kernel calls

Value, type, and instantiation dependence were not being handled
correctly for CUDAKernelCallExpr AST nodes. As a result, if an
undeclared identifier was used in the triple-angle-bracket kernel call
configuration, there would be no error during parsing, and there would
be a crash during code gen. This patch makes sure that an error will be
issued during parsing in this case, just as there would be for any other
use of an undeclared identifier in C++.

Patch by Jason Henline.

Reviewers: jlebar, rsmith

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

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

8 years agoChange the TSTiterator in Template Type Diffing.
Richard Trieu [Thu, 14 Jan 2016 23:30:12 +0000 (23:30 +0000)]
Change the TSTiterator in Template Type Diffing.

Modify the TSTiterator to have two internal iterators, which will walk
the provided sugared type and the desugared type.  This will provide better
access to the template argument information.  No functional changes.

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

8 years agoRefactor template type diffing
Richard Trieu [Thu, 14 Jan 2016 22:56:39 +0000 (22:56 +0000)]
Refactor template type diffing

1) Instead of using pairs of From/To* fields, combine fields into a struct
TemplateArgInfo and have two in each DiffNode.
2) Use default initialization in DiffNode so that the constructor shows the
only field that is initialized differently on construction.
3) Use Set and Get functions per each DiffKind to make sure all fields for the
diff is set.  In one case, the Expr fields were not set.
4) Don't print boolean literals for boolean template arguments.  This prevents
printing 'false aka 0'

Only #3 has a functional change, which is reflected in the test change.

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

8 years ago[CMake] Move the install logic for libclang's headers into the libclang CMakelists
Chris Bieneman [Thu, 14 Jan 2016 22:48:45 +0000 (22:48 +0000)]
[CMake] Move the install logic for libclang's headers into the libclang CMakelists

This makes it so if you disable building libclang you won't install the headers as part of the 'install' target.

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

8 years ago[CMake] Set SVN_REVISION if CLANG_APPEND_VC_REV=On
Chris Bieneman [Thu, 14 Jan 2016 22:45:12 +0000 (22:45 +0000)]
[CMake] Set SVN_REVISION if CLANG_APPEND_VC_REV=On

This matches autoconf's ability to put clang revisions in the clang --version spew.

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

8 years ago[CUDA] Add test for compiling CUDA code with -S.
Justin Lebar [Thu, 14 Jan 2016 21:41:31 +0000 (21:41 +0000)]
[CUDA] Add test for compiling CUDA code with -S.

Reviewers: tra

Subscribers: cfe-commits, jhen

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

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

8 years ago[CUDA] Invoke ptxas and fatbinary during compilation.
Justin Lebar [Thu, 14 Jan 2016 21:41:27 +0000 (21:41 +0000)]
[CUDA] Invoke ptxas and fatbinary during compilation.

Summary:
Previously we compiled CUDA device code to PTX assembly and embedded
that asm as text in our host binary.  Now we compile to PTX assembly and
then invoke ptxas to assemble the PTX into a cubin file.  We gather the
ptx and cubin files for each of our --cuda-gpu-archs and combine them
using fatbinary, and then embed that into the host binary.

Adds two new command-line flags, -Xcuda_ptxas and -Xcuda_fatbinary,
which pass args down to the external tools.

Reviewers: tra, echristo

Subscribers: cfe-commits, jhen

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

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

8 years agoDon't build jobs for the same Action + ToolChain twice.
Justin Lebar [Thu, 14 Jan 2016 21:41:21 +0000 (21:41 +0000)]
Don't build jobs for the same Action + ToolChain twice.

Summary:
Right now if the Action graph is a DAG and we encounter an action twice,
we will run it twice.

This patch is difficult to test as-is, but I have testcases for this as
used within CUDA compilation.

Reviewers:

Subscribers:

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

8 years ago[CUDA] Add tests for compiling CUDA files with -E.
Justin Lebar [Thu, 14 Jan 2016 21:41:18 +0000 (21:41 +0000)]
[CUDA] Add tests for compiling CUDA files with -E.

Reviewers: tra

Subscribers: cfe-commits, jhen

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

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

8 years agoUpdate for LLVM function name change.
Rui Ueyama [Thu, 14 Jan 2016 21:00:27 +0000 (21:00 +0000)]
Update for LLVM function name change.

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

8 years ago[WebAssembly] Configure some simple include paths and runtime library settings.
Dan Gohman [Thu, 14 Jan 2016 16:00:13 +0000 (16:00 +0000)]
[WebAssembly] Configure some simple include paths and runtime library settings.

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

8 years ago[Hexagon] Change all builtins returning "bool" to return "int" instead
Krzysztof Parzyszek [Thu, 14 Jan 2016 14:26:36 +0000 (14:26 +0000)]
[Hexagon] Change all builtins returning "bool" to return "int" instead

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

8 years agoclang-format: Fix incorrectly enforced linebreak with ColumnLimit 0.
Daniel Jasper [Thu, 14 Jan 2016 13:36:46 +0000 (13:36 +0000)]
clang-format: Fix incorrectly enforced linebreak with ColumnLimit 0.

Before:
  aaaa[bbbb]
      .cccc();

After:
  aaaa[bbbb].cccc();

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

8 years ago[mips] Added support for -Wa,-mips32 and similar.
Scott Egerton [Thu, 14 Jan 2016 13:01:48 +0000 (13:01 +0000)]
[mips] Added support for -Wa,-mips32 and similar.

Reviewers: vkalintiris, dsanders

Subscribers: cfe-commits

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

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

8 years agoFix for armv7-a15 and thumbv7-a15 buildbot fails.
Andrey Bokhanko [Thu, 14 Jan 2016 11:53:50 +0000 (11:53 +0000)]
Fix for armv7-a15 and thumbv7-a15 buildbot fails.

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

8 years agoCorrect setting of UserLabelPrefix for MCU target.
Andrey Bokhanko [Thu, 14 Jan 2016 10:59:36 +0000 (10:59 +0000)]
Correct setting of UserLabelPrefix for MCU target.

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

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

8 years agoPR25910: clang allows two var definitions with the same mangled name
Andrey Bokhanko [Thu, 14 Jan 2016 10:41:16 +0000 (10:41 +0000)]
PR25910: clang allows two var definitions with the same mangled name

Proper diagnostic and resolution of mangled names' conflicts in variables.
When there is a declaration and a definition using the same name but different
types, we emit what is in the definition. When there are two conflicting
definitions, we issue an error.

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

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

8 years agoclang-format: [JS] Fix incorrect line break leading to semicolon insertion.
Daniel Jasper [Thu, 14 Jan 2016 05:37:52 +0000 (05:37 +0000)]
clang-format: [JS] Fix incorrect line break leading to semicolon insertion.

clang-format only works for JavaScript code, if all the semicolons are
present anyway, so this linebreak can never be desired.

Before (with appropriate statement lengths or column limit):
  return
      [ aaa ];

After:
  return [
    aaaa
  ];

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

8 years agoDriver: Remove SanitizerArgs::clear() function and SanitizerSet ctor,
Peter Collingbourne [Thu, 14 Jan 2016 02:49:51 +0000 (02:49 +0000)]
Driver: Remove SanitizerArgs::clear() function and SanitizerSet ctor,
replace with in-class initializers.

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

8 years agoCodeGen: Only emit CFI unrelated cast checks for bit casts.
Peter Collingbourne [Thu, 14 Jan 2016 02:49:48 +0000 (02:49 +0000)]
CodeGen: Only emit CFI unrelated cast checks for bit casts.

We were previously emitting them for no-op casts (e.g. implicit casts
to const).

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

8 years ago[Sema] Suppress diags in overload resolution.
George Burgess IV [Wed, 13 Jan 2016 23:36:34 +0000 (23:36 +0000)]
[Sema] Suppress diags in overload resolution.

We were emitting diagnostics from our shiny new C-only overload
resolution mode. This patch attempts to silence all such diagnostics.

This fixes PR26085.
Differential Revision: http://reviews.llvm.org/D16159

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

8 years agoUpdate cxx_dr_status for latest issues list.
Richard Smith [Wed, 13 Jan 2016 22:58:22 +0000 (22:58 +0000)]
Update cxx_dr_status for latest issues list.

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

8 years agoUpdate make_cxx_dr_status after the 3.8 branch.
Richard Smith [Wed, 13 Jan 2016 22:51:59 +0000 (22:51 +0000)]
Update make_cxx_dr_status after the 3.8 branch.

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

8 years agoUpdate cxx_dr_status.html after the 3.8 branch
Hans Wennborg [Wed, 13 Jan 2016 19:14:03 +0000 (19:14 +0000)]
Update cxx_dr_status.html after the 3.8 branch

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

8 years agoUpdate version to 3.9
Hans Wennborg [Wed, 13 Jan 2016 17:32:59 +0000 (17:32 +0000)]
Update version to 3.9

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

8 years agoclang-format: [ObjC+JS] Allow bin-packing of array literals.
Daniel Jasper [Wed, 13 Jan 2016 16:41:34 +0000 (16:41 +0000)]
clang-format: [ObjC+JS] Allow bin-packing of array literals.

After reading the style guides again, they don't actually say how to
pack or not pack array literals. Based on some user reports, array
initializers can unnecessarily get quite long if they contain many
small elements. Array literals with trailing commas are still formatted
one per line so that users have a way to opt out of the packing.

Before:
  var array = [
    aaaaaa,
    aaaaaa,
    aaaaaa,
    aaaaaa,
    aaaaaa,
    aaaaaa,
    aaaaaa,
    aaaaaa,
    aaaaaa,
    aaaaaa
  ];

After:
  var array = [
    aaaaaa, aaaaaa, aaaaaa, aaaaaa, aaaaaa, aaaaaa, aaaaaa, aaaaaa, aaaaaa,
    aaaaaa, aaaaaa
  ];

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

8 years agoRevert r257602 because it breaks integrated-as.s on mips hosts.
Scott Egerton [Wed, 13 Jan 2016 16:19:33 +0000 (16:19 +0000)]
Revert r257602 because it breaks integrated-as.s on mips hosts.

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

8 years agoRevert "[analyzer] Provide .def-files and visitors for SVal/SymExpr/MemRegion."
Artem Dergachev [Wed, 13 Jan 2016 15:52:25 +0000 (15:52 +0000)]
Revert "[analyzer] Provide .def-files and visitors for SVal/SymExpr/MemRegion."

This reverts commit r257605.

The test fails on architectures that use unsigned int as size_t.
SymbolManager.h fails with compile errors on some platforms.

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

8 years ago[analyzer] Provide .def-files and visitors for SVal/SymExpr/MemRegion.
Artem Dergachev [Wed, 13 Jan 2016 15:13:48 +0000 (15:13 +0000)]
[analyzer] Provide .def-files and visitors for SVal/SymExpr/MemRegion.

Provide separate visitor templates for the three hierarchies, and also
the `FullSValVisitor' class, which is a union of all three visitors.

Additionally, add a particular example visitor, `SValExplainer', in order to
test the visitor templates. This visitor is capable of explaining the SVal,
SymExpr, or MemRegion in a natural language.

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

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

8 years ago[mips] Added support for -Wa,-mips32 and similar.
Scott Egerton [Wed, 13 Jan 2016 14:27:59 +0000 (14:27 +0000)]
[mips] Added support for -Wa,-mips32 and similar.

Reviewers: vkalintiris, dsanders

Subscribers: cfe-commits

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

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

8 years ago[analyzer] Fix SVal/SymExpr/MemRegion class and enum names for consistency.
Artem Dergachev [Wed, 13 Jan 2016 13:49:29 +0000 (13:49 +0000)]
[analyzer] Fix SVal/SymExpr/MemRegion class and enum names for consistency.

The purpose of these changes is to simplify introduction of definition files
for the three hierarchies.

1. For every sub-class C of these classes, its kind in the relevant enumeration
is changed to "CKind" (or C##Kind in preprocessor-ish terms), eg:

  MemRegionKind   -> MemRegionValKind
  RegionValueKind -> SymbolRegionValueKind
  CastSymbolKind  -> SymbolCastKind
  SymIntKind      -> SymIntExprKind

2. MemSpaceRegion used to be inconsistently used as both an abstract base and
a particular region. This region class is now an abstract base and no longer
occupies GenericMemSpaceRegionKind. Instead, a new class, CodeSpaceRegion,
is introduced for handling the unique use case for MemSpaceRegion as
"the generic memory space" (when it represents a memory space that holds all
executable code).

3. BEG_ prefixes in memory region kind ranges are renamed to BEGIN_ for
consisitency with symbol kind ranges.

4. FunctionTextRegion and BlockTextRegion are renamed to FunctionCodeRegion and
BlockCodeRegion, respectively. The term 'code' is less jargony than 'text' and
we already refer to BlockTextRegion as a 'code region' in BlockDataRegion.

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

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

8 years ago[OPENMP] Fix for declarative/standalone directives use.
Alexey Bataev [Wed, 13 Jan 2016 11:18:54 +0000 (11:18 +0000)]
[OPENMP] Fix for declarative/standalone directives use.
Fixes processing of declarative directives and standalone executable directives. Declarative directives should not be allowed as an immediate statements and standalone executable directives are allowed to be used in case-stmt constructs.

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

8 years agoInstall scan-build and scan-view only if Static Analyzer was enabled.
Eugene Zelenko [Wed, 13 Jan 2016 02:03:50 +0000 (02:03 +0000)]
Install scan-build and scan-view only if Static Analyzer was enabled.

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

8 years ago[Bugfix] Fix ICE on constexpr vector splat.
George Burgess IV [Wed, 13 Jan 2016 01:52:39 +0000 (01:52 +0000)]
[Bugfix] Fix ICE on constexpr vector splat.

In {CG,}ExprConstant.cpp, we weren't treating vector splats properly.
This patch makes us treat splats more properly.

Additionally, this patch adds a new cast kind which allows a bool->int
cast to result in -1 or 0, instead of 1 or 0 (for true and false,
respectively), so we can sanely model OpenCL bool->int casts in the AST.

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

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

8 years ago[CUDA] Rename check-prefixes in cuda-options.cu and cuda-unused-arg-warning.cu.
Justin Lebar [Wed, 13 Jan 2016 01:24:35 +0000 (01:24 +0000)]
[CUDA] Rename check-prefixes in cuda-options.cu and cuda-unused-arg-warning.cu.

Summary:
Rename the args to be more human-readable.  Among other things, this
lets us get rid of a bunch of comments (e.g. "ensure we don't run the
linker"), greatly shortening these tests.

Also apply consistent formatting and fix some English nits while we're
at it.

Reviewers: tra

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

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

8 years agoGeneralize r256026 to apply to all MachO targets, not just Darwin targets.
Bob Wilson [Wed, 13 Jan 2016 01:19:02 +0000 (01:19 +0000)]
Generalize r256026 to apply to all MachO targets, not just Darwin targets.

The PIC default is set for the MachO toolchain, not just the Darwin toolchain,
so this treats those the same. The behavior with -static should be the same
for all MachO targets. rdar://24152327

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

8 years ago[CUDA] Report an error if code tries to mix incompatible CUDA attributes.
Justin Lebar [Wed, 13 Jan 2016 01:07:35 +0000 (01:07 +0000)]
[CUDA] Report an error if code tries to mix incompatible CUDA attributes.

Summary: Thanks to jhen for helping me figure this out.

Reviewers: tra, echristo

Subscribers: jhen

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

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

8 years ago[Darwin] Fix deployment target detection
Frederic Riss [Tue, 12 Jan 2016 23:47:59 +0000 (23:47 +0000)]
[Darwin] Fix deployment target detection

There was a thinko in the deployment target detection code that
made the -isysroot parsing have precedence over the environment
variable for tvOS. This patch makes this logic symetric for all
platforms (the env variable must have precedence).

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

8 years agoFollow-up to r257537: add test that majnemer asked about
Hans Wennborg [Tue, 12 Jan 2016 23:31:58 +0000 (23:31 +0000)]
Follow-up to r257537: add test that majnemer asked about

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

8 years agoclang-cl: Support /Dfoo#bar (PR25984)
Hans Wennborg [Tue, 12 Jan 2016 23:17:03 +0000 (23:17 +0000)]
clang-cl: Support /Dfoo#bar (PR25984)

Such flags will now be translated to -Dfoo=bar.

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

8 years agoD9600: Add scan-build python implementation
Laszlo Nagy [Tue, 12 Jan 2016 22:38:41 +0000 (22:38 +0000)]
D9600: Add scan-build python implementation

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

8 years ago[CUDA] Add explicit mapping from sm_XX to compute_YY.
Justin Lebar [Tue, 12 Jan 2016 22:23:04 +0000 (22:23 +0000)]
[CUDA] Add explicit mapping from sm_XX to compute_YY.

Summary: This is used by D16082 when it invokes fatbinary.

Reviewers: tra

Subscribers: cfe-commits, jhen, echristo

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

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

8 years agoImprove AST dumping:
Richard Smith [Tue, 12 Jan 2016 21:59:26 +0000 (21:59 +0000)]
Improve AST dumping:

 1) When dumping a declaration that declares a name for a type, also dump the named type.
 2) Add a #pragma clang __debug dump X, that dumps the lookup results for X in
    the current context.

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

8 years agoProperly track the end location of an exception specification.
Aaron Ballman [Tue, 12 Jan 2016 21:04:22 +0000 (21:04 +0000)]
Properly track the end location of an exception specification.

Patch by Adrian ZgorzaƂek

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

8 years agoModule debugging: Make the module format part of the module hash instead
Adrian Prantl [Tue, 12 Jan 2016 21:01:56 +0000 (21:01 +0000)]
Module debugging: Make the module format part of the module hash instead
of the file name. This is consistent with how other HeaderSearchOptions
are handled.

Due to the other inputs of the module hash (revision number) this is not
really testable in a meaningful way.

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

8 years agoDon't store CGOpenMPRegionInfo::CodeGen as a reference (PR26078)
Hans Wennborg [Tue, 12 Jan 2016 20:54:36 +0000 (20:54 +0000)]
Don't store CGOpenMPRegionInfo::CodeGen as a reference (PR26078)

The referenced llvm::function_ref<void(CodeGenFunction &)> object can go
away before CodeGen is used, resulting in a crash.

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

8 years ago[modules] Don't diagnose a conflict between two using-declarations that name equivale...
Richard Smith [Tue, 12 Jan 2016 20:34:32 +0000 (20:34 +0000)]
[modules] Don't diagnose a conflict between two using-declarations that name equivalent internal linkage entities.

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

8 years agoAdd a clang test for r257376 (Ensure -mcpu=xscale works for arm targets).
Dimitry Andric [Tue, 12 Jan 2016 19:40:55 +0000 (19:40 +0000)]
Add a clang test for r257376 (Ensure -mcpu=xscale works for arm targets).

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

8 years agofunction names start with a lower case letter ; NFC
Sanjay Patel [Tue, 12 Jan 2016 18:03:41 +0000 (18:03 +0000)]
function names start with a lower case letter ; NFC

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

8 years agoRevert r253898 and r253899, this breaks mingw compilation on openSUSE.
Ismail Donmez [Tue, 12 Jan 2016 10:41:20 +0000 (10:41 +0000)]
Revert r253898 and r253899, this breaks mingw compilation on openSUSE.
Will re-apply after llvm 3.8 is branched.

Original commit message:

Driver: fallback to the location of clang if no sysroot,

hard coding /usr makes little sense for mingw-w64.
If we have portable toolchains having /usr breaks that.
If the clang we use is in /usr/bin or /usr/sbin etc this will
still detect as though it was hard coded to /usr

This makes the most sense going forward for mingw-w64 toolchains
on both linux and mac

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

8 years ago[analyzer] Fix RangeConstraintManager's pinning of single value ranges.
Pierre Gousseau [Tue, 12 Jan 2016 10:40:45 +0000 (10:40 +0000)]
[analyzer] Fix RangeConstraintManager's pinning of single value ranges.

This fix a bug in RangeSet::pin causing single value ranges to be considered non conventionally ordered.

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

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

8 years ago[analyzer] Evaluate integral casts as cast symbols if truncations are detected.
Pierre Gousseau [Tue, 12 Jan 2016 10:07:56 +0000 (10:07 +0000)]
[analyzer] Evaluate integral casts as cast symbols if truncations are detected.

The current workaround for truncations not being modelled is that the evaluation of integer to integer casts are simply bypassed and so the original symbol is used as the new casted symbol (cf SimpleSValBuilder::evalCastFromNonLoc).
This lead to the issue described in PR25078, as the RangeConstraintManager associates ranges with symbols.

The new evalIntegralCast method added by this patch wont bypass the cast if it finds the range of the symbol to be greater than the maximum value of the target type.

The fix to RangeSet::pin mentioned in the initial review will be committed separately.

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

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

8 years agoPR18513: make gcc compatible layout for bit-fields with explicit aligned attribute...
Alexey Bataev [Tue, 12 Jan 2016 09:12:20 +0000 (09:12 +0000)]
PR18513: make gcc compatible layout for bit-fields with explicit aligned attribute, by Dmitry Polukhin
Fix binary compatibility issue with GCC.
Differential Revision: http://reviews.llvm.org/D14980

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

8 years agoFix infinite recursion for invalid declaration, by Dmitry Polukhin
Alexey Bataev [Tue, 12 Jan 2016 09:01:25 +0000 (09:01 +0000)]
Fix infinite recursion for invalid declaration, by Dmitry Polukhin
Fix for a case found by fuzzing PR23057 (comment #25 https://llvm.org/bugs/show_bug.cgi?id=23057#c25).
Differential Revision: http://reviews.llvm.org/D16065

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

8 years agoclang-format: [JS] Support exporting abstract classes.
Daniel Jasper [Tue, 12 Jan 2016 06:24:38 +0000 (06:24 +0000)]
clang-format: [JS] Support exporting abstract classes.

Before:
  export abstract class X {y: number;}
(and all sorts of other havoc in more complicated cases).

After:
  export abstract class X { y: number; }

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

8 years ago[CUDA] Reject values for --cuda-gpu-arch that are not of the form /sm_\d+/.
Justin Lebar [Mon, 11 Jan 2016 23:27:13 +0000 (23:27 +0000)]
[CUDA] Reject values for --cuda-gpu-arch that are not of the form /sm_\d+/.

Reviewers: tra

Subscribers: cfe-commits, jhen, echristo

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

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

8 years agoAdd an Action* member to InputInfo.
Justin Lebar [Mon, 11 Jan 2016 23:15:21 +0000 (23:15 +0000)]
Add an Action* member to InputInfo.

Summary:
The CUDA toolchain needs to know which Actions created which InputInfos,
because it needs to attach GPU archs to the various InputInfos.

Reviewers: echristo

Subscribers: jfb, dschuff, jhen, tra, cfe-commits

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

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

8 years agoMake Driver::BuildJobsForAction return an InputInfo, instead of using an outparam.
Justin Lebar [Mon, 11 Jan 2016 23:09:32 +0000 (23:09 +0000)]
Make Driver::BuildJobsForAction return an InputInfo, instead of using an outparam.

Summary: Explicit is better than implicit.

Reviewers: echristo

Subscribers: llvm-commits

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

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

8 years agoMove ownership of Action objects into Compilation.
Justin Lebar [Mon, 11 Jan 2016 23:07:27 +0000 (23:07 +0000)]
Move ownership of Action objects into Compilation.

Summary:
This makes constructing Action graphs which are DAGs much simpler.  It
also just simplifies in general the ownership semantics of Actions.

Depends on D15910.

Reviewers: echristo

Subscribers: klimek, cfe-commits

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

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

8 years agoclang-format: [JS] Teach clang-format about "export interface".
Daniel Jasper [Mon, 11 Jan 2016 22:57:40 +0000 (22:57 +0000)]
clang-format: [JS] Teach clang-format about "export interface".

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

8 years agoWhen a tag is declared in prototype scope in C, if we've decided that it
Richard Smith [Mon, 11 Jan 2016 22:41:53 +0000 (22:41 +0000)]
When a tag is declared in prototype scope in C, if we've decided that it
redeclares an existing tag but are creating a new declaration anyway (because
it has attributes or changes the visibility of the name), don't warn that it
won't be visible outside the current scope. That's not true.

Also narrow down the set of cases where we create these extra declarations when
building modules; previously, all tag declarations but the first in a module
header would get this treatment if -fmodules-local-submodule-visibility. (This
isn't a functional change, but we try to avoid creating these extra
declarations whenever we can.)

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

8 years agoPR26087: Use nonstandard MSVC extension for VS2015 as well.
James Y Knight [Mon, 11 Jan 2016 22:00:22 +0000 (22:00 +0000)]
PR26087: Use nonstandard MSVC extension for VS2015 as well.

In r256564, I had conditioned the workaround in has_getDecl to only be
used for MSVC before the 2015 release, believing that 2015 could handle
the standard code. But, that was incorrect.

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

8 years agoFix -Wmicrosoft-enum-value warning
Reid Kleckner [Mon, 11 Jan 2016 20:55:16 +0000 (20:55 +0000)]
Fix -Wmicrosoft-enum-value warning

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

8 years ago[Sema] Issue a warning for integer overflow in struct initializer
Akira Hatanaka [Mon, 11 Jan 2016 17:22:01 +0000 (17:22 +0000)]
[Sema] Issue a warning for integer overflow in struct initializer

Clang wasn't issuing a warning when compiling the following code:

struct s {
  unsigned x;
} s = {
  .x = 4 * 1024 * 1024 * 1024
};

rdar://problem/23399683

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

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

8 years ago[clang-format] Fix comment aligning when there are changes within the comment
Benjamin Kramer [Mon, 11 Jan 2016 16:27:16 +0000 (16:27 +0000)]
[clang-format] Fix comment aligning when there are changes within the comment

As soon as a comment had whitespace changes inside of the token, we
couldn't identify the whole comment as a trailing comment anymore and
alignment stopped working. Add a new boolean to Change for this special
case and fix trailing comment identification to use it.

This also changes WhitespaceManager to sum the length of all Changes
inside of a token into the first Change.

Before this fix

  int xy;  // a
  int z;   //b

became

  int xy;  // a
  int z;  // b

with this patch we immediately get to:

  int xy;  // a
  int z;   // b

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

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

8 years agoclang-format: Fix overloading "operator," definitions more thoroughly.
Daniel Jasper [Mon, 11 Jan 2016 12:55:33 +0000 (12:55 +0000)]
clang-format: Fix overloading "operator," definitions more thoroughly.

Before:
  aaaaaaaaaaaaaaaaaaaaaa operator,(aaaaaaaaaaaaaaaaaaaaa &
                                   aaaaaaaaaaaaaaaaaaaaaaaaaa) const;
After:
  aaaaaaaaaaaaaaaaaaaaaa operator,(
      aaaaaaaaaaaaaaaaaaaaa &aaaaaaaaaaaaaaaaaaaaaaaaaa) const;

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

8 years ago[WebAssembly] Fix a typo in a comment.
Dan Gohman [Mon, 11 Jan 2016 11:49:44 +0000 (11:49 +0000)]
[WebAssembly] Fix a typo in a comment.

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

8 years agoFix assert hit when tree-transforming template template parameter packs.
Manuel Klimek [Mon, 11 Jan 2016 11:39:00 +0000 (11:39 +0000)]
Fix assert hit when tree-transforming template template parameter packs.

Covers significantly more code in the template template pack argument
test and fixes the resulting assert problem.

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

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

8 years agoclang-format: Slightly row back on r257257.
Daniel Jasper [Mon, 11 Jan 2016 11:01:05 +0000 (11:01 +0000)]
clang-format: Slightly row back on r257257.

r257257 change the way clang-format enforces line breaks after a
templated type has been line-wrapped. This was to fix an incorrect line
break if BinPackParameters is set to false. However, it also leads to
an unwanted line break in a different case. Thus, for now, only do this
when BinPackParameters is false. This isn't ideal yet, but helps us
until we have a better solution.

With BinPackParameters:
Before:
  void fffffffffff(aaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaaaaaaaaaaaaaaaaaaa,
                                               aaaaaaaaaaaaaaaaaaaa);

After:
  void fffffffffff(
      aaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa>
          aaaaaaaaaa);

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

8 years agoclang-format: [JS] Improve line-flow when calling functions on array literals.
Daniel Jasper [Mon, 11 Jan 2016 11:00:58 +0000 (11:00 +0000)]
clang-format: [JS] Improve line-flow when calling functions on array literals.

Before:
  return [
    aaaaaaaaaaaaaaaaaaaaaa
  ].aaaaaaa(function() {
     //
   })
   .bbbbbb();

After:
  return [aaaaaaaaaaaaaaaaaaaaaa]
      .aaaaaaa(function() {
//
      })
      .bbbbbb();

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

8 years agoAnalysisConsumer: use canonical decl for both lookup and store of
Yury Gribov [Mon, 11 Jan 2016 09:38:48 +0000 (09:38 +0000)]
AnalysisConsumer: use canonical decl for both lookup and store of
visited decls.

Due to redeclarations, the function may have different declarations used
in CallExpr and in the definition. However, we need to use a unique
declaration for both store and lookup in VisitedCallees. This patch
fixes issues with analysis in topological order. A simple test is
included.

Patch by Alex Sidorin!

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

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

8 years agoAccidentally removed part of the file header. Restoring it back.
Ekaterina Romanova [Sun, 10 Jan 2016 16:18:09 +0000 (16:18 +0000)]
Accidentally removed part of the file header. Restoring it back.

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