Add -fsanitize=memory.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169124 91177308-0d34-0410-b5e6-96231b3b80d8
Make hasDeclaration work for enums.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169129 91177308-0d34-0410-b5e6-96231b3b80d8
Initial version of formatting library.

This formatting library will be used by a stand-alone clang-format tool
and can also be used when writing other refactorings.

Manuel's original design document:
https://docs.google.com/a/google.com/document/d/1gpckL2U_6QuU9YW2L1ABsc4Fcogn5UngKk7fE5dDOoA/edit

The library can already successfully format itself.

Review: http://llvm-reviews.chandlerc.com/D80

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169137 91177308-0d34-0410-b5e6-96231b3b80d8
Fix PR14474: don't emit debug info for interface types in -gline-tables-only mode.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169138 91177308-0d34-0410-b5e6-96231b3b80d8
libclangFormat is not libclangTooling, but it depends on it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169139 91177308-0d34-0410-b5e6-96231b3b80d8
Add Clang flags -fsanitize-blacklist and -fno-sanitize-blacklist. Make this flag usable for ASan. Blacklisting can be used to disable sanitizer checks for particular file/function/object.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169144 91177308-0d34-0410-b5e6-96231b3b80d8
Fixes a compile warning and crash in the tests.

The necessity of this fix points to a problem with the design
of the addToken during the optimiation phase, which we need to address
in a much more principled way.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169151 91177308-0d34-0410-b5e6-96231b3b80d8
Fix test failure when building Clang with g++4.7 -- don't use a Twine temporary
after its lifetime has ended!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169170 91177308-0d34-0410-b5e6-96231b3b80d8
clang/test/Driver/fsanitize-blacklist.c: Mark it as XFAIL:cygming, due to PR12920.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169187 91177308-0d34-0410-b5e6-96231b3b80d8
Have clang use LLVM IR's fast-math flags when in FastMath or FiniteMathOnly modes. Test cases included.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169191 91177308-0d34-0410-b5e6-96231b3b80d8
Testing objective-C declarations embedded in
<declaration> tag of Comment XML and fixed a
missing declaration of ivars private to @implementation
as result of the testing. // rdar://12378714


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169193 91177308-0d34-0410-b5e6-96231b3b80d8
clang/test/Index/comment-objc-decls.m: Try to fix r169193, to add x86_64-darwin.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169199 91177308-0d34-0410-b5e6-96231b3b80d8
Document the existence of -fsanitize=bounds.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169207 91177308-0d34-0410-b5e6-96231b3b80d8
Add a 'count' field to the DWARF subrange.

The count field is necessary because there isn't a difference between the 'lo'
and 'hi' attributes for a one-element array and a zero-element array. When the
count is '0', we know that this is a zero-element array. When it's >=1, then
it's a normal constant sized array. When it's -1, then the array is unbounded.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169219 91177308-0d34-0410-b5e6-96231b3b80d8
clang/test/CodeGenCXX/debug-info-zero-length-arrays.cpp: Add explicit triple, x86_64-unknown-unknown. It was incompatible to i686.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169220 91177308-0d34-0410-b5e6-96231b3b80d8
Introduce CompilationDatabase::getAllCompileCommands() that returns all
compile commands of the database and expose it via the libclang API.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169226 91177308-0d34-0410-b5e6-96231b3b80d8
[libclang] Avoid copying the CompileCommand related strings when wrapping them to a CXString.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169227 91177308-0d34-0410-b5e6-96231b3b80d8
In the PreprocessingRecord, to identify the different conditional directive regions
use the SourceLocation at the start of the respective region, instead of a unique integer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169228 91177308-0d34-0410-b5e6-96231b3b80d8
Refactor recording the preprocessor conditional directive regions out of
PreprocessingRecord and into its own class, PPConditionalDirectiveRecord.

Decoupling allows a client to use the functionality of PPConditionalDirectiveRecord
without needing a PreprocessingRecord.

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