pass environment when invoking llvm-config and clang from lit.cfg

Use the same environment when invoking llvm-config from lit.cfg as
will be used when running tests, so that ASAN_OPTIONS, INCLUDE, etc.
are present.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@218404 91177308-0d34-0410-b5e6-96231b3b80d8
Thread Safety Analysis:  Update to documentation.

The attribute documentation now conforms to Aaron Ballman's renaming of the
thread safety attributes, as well as the new paper that is due to be published
in the conference on Source Code Analysis and Manipulation (SCAM 2014) later
this week.  In addition, recent changes to the analysis, such as checking
of references and negative capabilities, are now documented.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@218420 91177308-0d34-0410-b5e6-96231b3b80d8
Fix handling of preincrement on bit-fields. This gives a bit-field in C++, but
we were failing to find that bit-field when performing integer promotions. This
brings us closer to following the standard, and closer to GCC.

In C, this change is technically a regression: we get bit-field promotions
completely wrong in C, promoting cases that are categorically not bit-field
designators. This change makes us do so slightly more consistently, though.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@218428 91177308-0d34-0410-b5e6-96231b3b80d8
Add increment/decrement operators and compound assignment operators to the
uninitialized checkers that did not have them before.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@218435 91177308-0d34-0410-b5e6-96231b3b80d8
MS ABI: Avoid hashing back reference keys in mangler

This patch replaces the back reference StringMap from the MS mangler
with a SmallVector of strings. My previous patches reduced the number of
hashes involved in back reference lookups, this one removes them
completely. The back reference map contains at most 10 entries, which
are likely to be of varying sizes and different initial subsequences,
and which can easily became huge (due to templates and namespaces).

The solution presented is the simplest possible one. Nevertheless, it's
enough to reduce compilation times for a particular test case from 11.1s
to 9s, versus 8.58s for the Itanium ABI. Possible further improvements
include using a sorted vector (carefully to not introduce an extra
comparison), storing the string contents in a common arena, and/or keep
the string storage in the context for reuse.

Patch by Agustín Bergé.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@218461 91177308-0d34-0410-b5e6-96231b3b80d8
Move calls to ResolveExceptionSpec out of SetDeclDefaulted and into DefineImplicit*

This fixes an assertion failure in CodeGen where we were not resolving
an exception specification.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@218466 91177308-0d34-0410-b5e6-96231b3b80d8
Suggest fix-it for missing '{' after base-clause


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@218468 91177308-0d34-0410-b5e6-96231b3b80d8
Fix PR20886 - enforce CUDA target match in method calls

http://reviews.llvm.org/D5298



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@218482 91177308-0d34-0410-b5e6-96231b3b80d8
-ms-extensions: Implement __super scope specifier (PR13236).

We build a NestedNameSpecifier that records the CXXRecordDecl in which
__super appeared. Name lookup is performed in all base classes of the
recorded CXXRecordDecl. Use of __super is allowed only inside class and
member function scope.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@218484 91177308-0d34-0410-b5e6-96231b3b80d8
CGBuiltin: Use frem instruction rather than libcall to implement fmod

AFAICT the semantics of frem match libm's fmod.

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Tom Stellard <tom@stellard.net>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@218488 91177308-0d34-0410-b5e6-96231b3b80d8
Support the assume_aligned function attribute

In addition to __builtin_assume_aligned, GCC also supports an assume_aligned
attribute which specifies the alignment (and optional offset) of a function's
return value. Here we implement support for the assume_aligned attribute by making
use of the @llvm.assume intrinsic.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@218500 91177308-0d34-0410-b5e6-96231b3b80d8
Small fix for bug 18635.
(clang crashed in CodeGen in llvm::Module::getNamedValue on
 thread_local std::unique_ptr<int>).
Differential Revision: http://reviews.llvm.org/D5353


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@218503 91177308-0d34-0410-b5e6-96231b3b80d8
MS ABI: Assert that vftables should have a non-RTTI entry

No functional change intended.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@218507 91177308-0d34-0410-b5e6-96231b3b80d8
Fix an assertion failure trying to emit a trivial destructor in ObjC++

If a base class declares a destructor, we will add the implicit
destructor for the subclass in
ActOnFields -> AddImplicitlyDeclaredMembersToClass

But in Objective C++, we did not compute whether we have a trivial
destructor until after that in
CXXRecordDecl::completeDefinition()

This was leading to a mismatch between the class, which thought it had
no trivial destructor, and the CXXDestructorDecl, which considered
itself trivial. It turns out the reason we delayed setting this until
completeDefinition() was for a warning that has since been removed as
part of -Warc-abi, so we just do it eagerly now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@218520 91177308-0d34-0410-b5e6-96231b3b80d8
Don't link in sanitizer runtimes if -nostdlib/-nodefaultlibs is provided.

It makes no sense to link in sanitizer runtimes in this case: the user
probably doesn't want to see any system/toolchain libs in his link if he
provides these flags, and the link will most likely fail anyway - as sanitizer
runtimes depend on libpthread, libdl, libc etc.

Also, see discussion in https://code.google.com/p/address-sanitizer/issues/detail?id=344


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@218541 91177308-0d34-0410-b5e6-96231b3b80d8
Ensure that all module build failures get diagnosed

Otherwise we can end up silently skipping an import.  If we happen to be
building another module at the time, we may build a mysteriously broken
module and not know why it seems to be missing symbols.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@218552 91177308-0d34-0410-b5e6-96231b3b80d8
Add back checking for condition of conditional operator for -Wuninitialized


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@218556 91177308-0d34-0410-b5e6-96231b3b80d8
CodeGen: Don't crash when initializing pointer-to-member fields in bases

Clang uses two types to talk about a C++ class, the
NonVirtualBaseLLVMType and the LLVMType.  Previously, we would allow one
of these to be packed and the other not.

This is problematic.  If both don't agree on a common subset of fields,
then routines like getLLVMFieldNo will point to the wrong field.  Solve
this by copying the 'packed'-ness of the complete type to the
non-virtual subobject.  For this to work, we need to take into account
the non-virtual subobject's size and alignment when we are computing the
layout of the complete object.

This fixes PR21089.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@218577 91177308-0d34-0410-b5e6-96231b3b80d8
Run DR tests in C++17 mode too.


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