[x86] Clean up the x86 builtin specs to reflect r217310 in LLVM which
made the 8-bit masks actually 8-bit arguments to these intrinsics.

These builtins are a mess. Many were missing the I qualifier which
I added where obviously correct. Most aren't tested, but I've updated
the relevant tests. I've tried to catch all the things that should
become 'c' in this round.

It's also frustrating because the set of these is really ad-hoc and
doesn't really map that cleanly to the set supported by either GCC or
LLVM. Oh well...

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217311 91177308-0d34-0410-b5e6-96231b3b80d8
Attempt to fix ARM bot. (The test references a typedef from x86 asm.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217313 91177308-0d34-0410-b5e6-96231b3b80d8
Move x86-specific bits of warn-unused-local-typedef.cpp into their own file.

That way, most of the test can run everywhere. Also give the new file an x86
triple in addition to a REQUIRES line.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217314 91177308-0d34-0410-b5e6-96231b3b80d8
MS format strings: parse the 'Z' printf conversion specifier (PR20808)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217326 91177308-0d34-0410-b5e6-96231b3b80d8
Try to green test/Sema/format-strings.c on Win bots

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217327 91177308-0d34-0410-b5e6-96231b3b80d8
Fix test to not write output to the test directory, as it may not be writable.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217337 91177308-0d34-0410-b5e6-96231b3b80d8
Avoid writing to the test directory as it may not be writable.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217339 91177308-0d34-0410-b5e6-96231b3b80d8
Adjust test/CodeGenCXX/pr12251.cpp

InstCombine just got a bit smarter about checking known bits of returned
values, and because this test runs the optimizer, it requires an update. We
should really rewrite this test to directly check the IR output from CodeGen.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217347 91177308-0d34-0410-b5e6-96231b3b80d8
Add __builtin_assume and __builtin_assume_aligned using @llvm.assume.

This makes use of the recently-added @llvm.assume intrinsic to implement a
__builtin_assume(bool) intrinsic (to provide additional information to the
optimizer). This hooks up __assume in MS-compatibility mode to mirror
__builtin_assume (the semantics have been intentionally kept compatible), and
implements GCC's __builtin_assume_aligned as assume((p - o) & mask == 0). LLVM
now contains special logic to deal with assumptions of this form.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217349 91177308-0d34-0410-b5e6-96231b3b80d8
Don't test really-large alignments for now

Temporarily comment out the test for really-large powers of two. This seems to
be host-sensitive for some reason... trying to fix the clang-i386-freebsd
builder.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217351 91177308-0d34-0410-b5e6-96231b3b80d8
clang/test/CodeGen/builtin-assume*.c: Fixup for -Asserts.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217352 91177308-0d34-0410-b5e6-96231b3b80d8
Add .clang-tidy configuration file to provide LLVM-optimized defaults for clang-tidy.

Reviewers: chandlerc, djasper, alexfh

Reviewed By: alexfh

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217366 91177308-0d34-0410-b5e6-96231b3b80d8
Handle constructors and destructors a bit more uniformly in CodeGen.

There were code paths that are duplicated for constructors and destructors just
because we have both CXXCtorType and CXXDtorsTypes.

This patch introduces an unified enum and reduces code deplication a bit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217383 91177308-0d34-0410-b5e6-96231b3b80d8
Add a comment for something that confused me.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217384 91177308-0d34-0410-b5e6-96231b3b80d8
Make FileEntry::getName() valid across calls to FileManager::getFile()

Because we may change the name of a FileEntry inside getFile, the name
returned by FileEntry::getName() could be destroyed.  This was causing a
use-after-free when searching the HeaderFileInfo on-disk hashtable for a
module or pch.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217385 91177308-0d34-0410-b5e6-96231b3b80d8
Remove a parameter that has been unused since r188481. No behavior change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217386 91177308-0d34-0410-b5e6-96231b3b80d8
Implement nonnull-attribute sanitizer

Summary:
This patch implements a new UBSan check, which verifies
that function arguments declared to be nonnull with __attribute__((nonnull))
are actually nonnull in runtime.

To implement this check, we pass FunctionDecl to CodeGenFunction::EmitCallArgs
(where applicable) and if function declaration has nonnull attribute specified
for a certain formal parameter, we compare the corresponding RValue to null as
soon as it's calculated.

Test Plan: regression test suite

Reviewers: rsmith

Reviewed By: rsmith

Subscribers: cfe-commits, rnk

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217389 91177308-0d34-0410-b5e6-96231b3b80d8
Report source location of returns_nonnull attribute in UBSan reports.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217400 91177308-0d34-0410-b5e6-96231b3b80d8
Fix PCHs that import more than one module

We were passing < to std::unique, but it expects ==. Since the input is
sorted, we were always trimming it to one entry.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217402 91177308-0d34-0410-b5e6-96231b3b80d8
Allow empty statements in naked functions in addition to ASM statements

Summary: This fixes PR20883.

Test Plan: The patch includes an automated test.

Reviewers: hansw

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

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