[analyzer] Restart path diagnostic generation if any of the visitors change the report configuration while walking the path.

This required adding a change count token to BugReport, but also allowed us to ditch ImmutableList as the BugReporterVisitor data type.

Also, remove the hack from MallocChecker, now that visitors appear in the opposite order. This is not exactly a fix, but the common case -- custom diagnostics after generic ones -- is now the default behavior.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153369 91177308-0d34-0410-b5e6-96231b3b80d8
[analyzer] Tighten up the realloc() failure path note generation...make sure we get the right realloc()!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153370 91177308-0d34-0410-b5e6-96231b3b80d8
On i386 the alignment of i64 is 4, not 8.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153380 91177308-0d34-0410-b5e6-96231b3b80d8
Don't cast away constness.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153381 91177308-0d34-0410-b5e6-96231b3b80d8
Revert r153360 (and r153380), "Second part of PR12251. Produce the range metadata in clang for booleans and".

For i686 targets (eg. cygwin), I saw "Range must not be empty!" in verifier.

It produces (i32)[0x80000000:0x80000000) from (uint64_t)[0xFFFFFFFF80000000ULL:0x0000000080000000ULL), for signed i32 on MDNode::Range.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153382 91177308-0d34-0410-b5e6-96231b3b80d8
Add back r153360 with a fix for enums that cover all the 32 bit values.
Thanks to NAKAMURA Takumi for finding it!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153383 91177308-0d34-0410-b5e6-96231b3b80d8
moderin objc translator: remove 'const' from remaining
fields in _class_ro_t metadata. //  rdar://11079898



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153384 91177308-0d34-0410-b5e6-96231b3b80d8
Fix copy and pasto.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153385 91177308-0d34-0410-b5e6-96231b3b80d8
remove declaration of _objc_empty_vtable no longer
used in modern objc translator. // rdar://11105680



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153386 91177308-0d34-0410-b5e6-96231b3b80d8
Simplify some users of DenseMap::erase.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153389 91177308-0d34-0410-b5e6-96231b3b80d8
test/Driver/cpath.c: Escape a few args that contain %{pathsep}.

On msys bash, with %pathsep==os.pathsep==';', I can see lines like below in this script;

    env DIR=X:/foo%{pathsep}X:/bar

Then it is expanded to;

    env DIR=X:/foo;X:/bar

It should be with quote;

    env "DIR=X:/foo;X:/bar"

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153402 91177308-0d34-0410-b5e6-96231b3b80d8
clang/lib/Analysis/CFG.cpp: Fix memory leak since r153297.

evaluateAsBooleanConditionNoCache(S) might update the map and invalidate the iterator.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153406 91177308-0d34-0410-b5e6-96231b3b80d8
clang/lib/Analysis/CFG.cpp: Get rid of early insertion of placeholder to the map.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153407 91177308-0d34-0410-b5e6-96231b3b80d8
No longer hard coding paths to the MinGW include directories; using a regular expression instead.

Patch thanks to Nikola Smiljanic

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153413 91177308-0d34-0410-b5e6-96231b3b80d8
Since this change is generating a considerable amount of discussion (and possibly even a regression for known bad versions), I'm reverting it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153420 91177308-0d34-0410-b5e6-96231b3b80d8
Delay checking of dependent underlying types for redeclarations of member
enumerations in templates until the template is instantiated.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153426 91177308-0d34-0410-b5e6-96231b3b80d8
Handle instantiations of redeclarations of forward-declared enumerations within
templated functions. Build a redeclaration chain, and only instantiate the
definition of the enum when visiting the defining declaration.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153427 91177308-0d34-0410-b5e6-96231b3b80d8
ThreadSafetyReporter: Manage diagnostics in a std::list.

std::list is expensive, but so is std::sorting a SmallVector of SmallVectors of
heavyweight PartialDiagnostics.

Saves ~30k in a i386-linux-Release+Asserts clang build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153437 91177308-0d34-0410-b5e6-96231b3b80d8
Driver: Factor string vector push_back into a helper class and optimize it.

Due to lack of move semantics we would create a temporary std::string from the
string literal, copy it into the vector and discard the temporary. This leads
to massive code bloat, optimizing it saves 50k on i386-linux-Release+Asserts.

While there add a two-element overload for push_back, simplifying code a bit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153441 91177308-0d34-0410-b5e6-96231b3b80d8
Canonicalize the declaration we write to a PCH file for an
InjectedClassNameType; otherwise, it won't be properly wired to the
original (canonical) declaration when it is deserialized. Fixes
<rdar://problem/11112464>.


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