If we're splitting the dwarf for fission and don't want to use the
integrated assembler then go ahead and still split the dwarf anyhow.

Add two tests, one to exercise existing behavior of not splitting
when we're just emitting assembly files and the other to test
that we split when we're not in integrated as mode.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183355 91177308-0d34-0410-b5e6-96231b3b80d8
[analyzer; new edges] Ignore self-edges, not all edges with the same location.

The edge optimizer needs to see edges for, say, implicit casts (which have
the same source location as their operand) to uniformly simplify the
entire path. However, we still don't want to produce edges from a statement
to /itself/, which could occur when two nodes in a row have the same
statement location.

This necessitated moving the check for redundant notes to after edge
optimization, since the check relies on notes being adjacent in the path.

<rdar://problem/14061675>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183357 91177308-0d34-0410-b5e6-96231b3b80d8
[analyzer; new edges] Don't crash if the top-level entry edge is missing.

We previously asserted that there was a top-level function entry edge, but
if the function decl's location is invalid (or within a macro) this edge
might not exist. Change the assertion to an actual check, and don't drop
the first path piece if it doesn't match.

<rdar://problem/14070304>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183358 91177308-0d34-0410-b5e6-96231b3b80d8
[analyzer] Fix a crash that occurs when processing an rvalue array.

When processing ArrayToPointerDecay, we expect the array to be a location, not a LazyCompoundVal.
Special case the rvalue arrays by using a location to represent them. This case is handled similarly
elsewhere in the code.

Fixes PR16206.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183359 91177308-0d34-0410-b5e6-96231b3b80d8
clang/unittests/Format/FormatTest.cpp: Suppress utf8 literals with _MSC_VER. MS cl.exe is unaware of BOM-less utf8 source files.

FIXME: Encode Cyrillic and CJK characters below to appease MS compilers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183366 91177308-0d34-0410-b5e6-96231b3b80d8
[analyzer] Improve debug output for PathDiagnosticPieces.

You can now dump a single PathDiagnosticPiece or PathDiagnosticLocation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183367 91177308-0d34-0410-b5e6-96231b3b80d8
[analyzer] Look through ExprWithCleanups to see if an expr's consumed.

We based decisions during analysis and during path generation on whether
or not an expression is consumed, so if a top-level expression has
cleanups it's important for us to look through that.

<rdar://problem/14076125>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183368 91177308-0d34-0410-b5e6-96231b3b80d8
Don't create a StringRef from a temporary string.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183372 91177308-0d34-0410-b5e6-96231b3b80d8
When a static storage duration temporary appears in a constant expression, it
must be initialized by a constant expression (not just a core constant
expression), because we're going to emit it as a global. Core issue for this is
pending.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183388 91177308-0d34-0410-b5e6-96231b3b80d8
Improve c-style cast detection.

Before:
return (my_int) aaaa;
template <> void f<int>(int i)SOME_ANNOTATION;
f("aaaa" SOME_MACRO(aaaa)"aaaa");

After:
return (my_int)aaaa;
template <> void f<int>(int i) SOME_ANNOTATION;
f("aaaa" SOME_MACRO(aaaa) "aaaa");

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183389 91177308-0d34-0410-b5e6-96231b3b80d8
Fix clang-format's expression parser for leading }s.

The leading "}" in the construct "} else if (..) {" was confusing the
expression parser. Thus, no fake parentheses were generated and the
indentation was broken in some cases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183393 91177308-0d34-0410-b5e6-96231b3b80d8
Disallow reinterpret_cast from pointer to bool on Windows

This became allowed by accident in r131201, but triggers an assert.
That patch added an exception to allow conversion from pointers to
narrow integral types for MSVC compatibility. However, a pointer can
already be converted to bool in a civilized manner; allowing conversion
via reinterpret_cast is a bad idea.

Fixes PR16222.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183394 91177308-0d34-0410-b5e6-96231b3b80d8
Implement DR1270: braces can be elided in all aggregate initialization, not
just copy-list-initialization in a variable declaration. This effectively
reverts r142147.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183397 91177308-0d34-0410-b5e6-96231b3b80d8
ClangTool: strip -o from the command line

Summary:
This patch creates a new ArgumentsAdjuster, which removes all -o parameters from
the command line. This adjuster is inserted by default into the ClangTool pipeline.

Reviewers: klimek

CC: cfe-commits, revane

Differential Revision: http://llvm-reviews.chandlerc.com/D925

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183398 91177308-0d34-0410-b5e6-96231b3b80d8
Add support for static analysis to clang-check

Summary:
This adds a command line argument '-analyze' to clang-check which runs the
clang static analyzer on the source files.

Reviewers: klimek

CC: cfe-commits, revane

Differential Revision: http://llvm-reviews.chandlerc.com/D926

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183399 91177308-0d34-0410-b5e6-96231b3b80d8
clang-check: Link the static analyzer in the Makefile build too.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183404 91177308-0d34-0410-b5e6-96231b3b80d8
clang-check: add missing space in Makefile

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183406 91177308-0d34-0410-b5e6-96231b3b80d8
Fix a crash with -Wassign-enum, where we didn't adjust the APInt type of the
constant. Also fix some spelling mistakes and formatting issues.

Reviewed by Richard Smith over IRC.

Fixes PR15069.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183409 91177308-0d34-0410-b5e6-96231b3b80d8
Fix incorrect line breaking before trailing block comments.

Before, clang-format would happily move a trailing block comment to a
new line, which normally changes the perceived binding of that comment.

E.g., it would move:
void f() { /* comment */
  ...
}
to:
void f() {
  /* comment */
  ...
}

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183420 91177308-0d34-0410-b5e6-96231b3b80d8
[libclang] CMake: add an option to control building libclang as a static library (off by default)

This avoids building libclang twice by default.

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