MIPS: Add tests for predefined macros for MIPS targets.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154168 91177308-0d34-0410-b5e6-96231b3b80d8
Fixed scoping error for late parsed attributes in nested classes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154173 91177308-0d34-0410-b5e6-96231b3b80d8
zext ivar offsets if required (GNU runtimes).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154175 91177308-0d34-0410-b5e6-96231b3b80d8
Fix using Clang as a cross compiler installed on a host machine and not
inside of a sysroot targeting a system+sysroot which is "similar" or
"compatible" with the host system. This shows up when trying to build
system images on largely compatible hardware as-if fully cross compiled.

The problem is that previously we *perfectly* mimiced GCC here, and it
turns out GCC has a bug that no one has really stumbled across. GCC will
try to look in thy system prefix ('/usr/local' f.ex.) into which it is
instaled to find libraries installed along side GCC that should be
preferred to the base system libraries ('/usr' f.ex.). This seems not
unreasonable, but it has a very unfortunate consequence when combined
with a '--sysroot' which does *not* contain the GCC installation we're
using to complete the toolchain. That results in some of the host
system's library directories being searched during the link.

Now, it so happens that most folks doing stuff like this use
'--with-sysroot' and '--disable-multilib' when configuring GCC. Even
better, they're usually not cross-compiling to a target that is similar
to the host. As a result, searching the host for libraries doesn't
really matter -- most of the time weird directories get appended that
don't exist (no arm triple lib directory, etc). Even if you're
cross-compiling from 32-bit to 64-bit x86 or vice-versa, disabling
multilib makes it less likely that you'll actually find viable libraries
on the host. But that's just luck. We shouldn't rely on this, and this
patch disables looking in the system prefix containing the GCC
installation if that system prefix is *outside* of the sysroot. For
empty sysroots, this has no effect. Similarly, when using the GCC
*inside* of the sysroot, we still track wherever it is installed within
the sysroot and look there for libraries. But now we can use a cross
compiler GCC installation outside the system root, and only look for the
crtbegin.o in the GCC installation, and look for all the other libraries
inside the system root.

This should fix PR12478, allowing Clang to be used when building
a ChromiumOS image without polluting the image with libraries from the
host system.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154176 91177308-0d34-0410-b5e6-96231b3b80d8
MIPS: Move tests check float ABI macros definitions to the more appropriate place.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154184 91177308-0d34-0410-b5e6-96231b3b80d8
Added a new attribute, objc_root_class, which informs the compiler when a root class is intentionally declared.
The warning this inhibits, -Wobjc-root-class, is opt-in for now. However, all clang unit tests that would trigger
the warning have been updated to use -Wno-objc-root-class. <rdar://problem/7446698>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154187 91177308-0d34-0410-b5e6-96231b3b80d8
Clear environment variables that might affect Clang before running tests.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154188 91177308-0d34-0410-b5e6-96231b3b80d8
Fix a Sema invariant bug that I recently introduced involving
the template instantiation of statement-expressions.

I think it was jyasskin who had a crashing testcase in this area;
hopefully this fixes it and he can find his testcase and check it in.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154189 91177308-0d34-0410-b5e6-96231b3b80d8
Rename GenerateCXXGlobalDtorFunc to GenerateCXXGlobalDtorsFunc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154190 91177308-0d34-0410-b5e6-96231b3b80d8
Use atexit when __cxa_atexit isn't available instead of adding a
global destructor entry.  For some reason this isn't enabled for
apple-kexts;  it'd be good to have documentation for that.

Based on a patch by Nakamura Takumi!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154191 91177308-0d34-0410-b5e6-96231b3b80d8
Test for r154189/PR12481

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154193 91177308-0d34-0410-b5e6-96231b3b80d8
[analyzer] Check that the arguments to NSOrderedSet creation methods are valid ObjC objects.

Patch by Sean McBride!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154194 91177308-0d34-0410-b5e6-96231b3b80d8
MIPS: Pass -EB/-EL argument to the assembler according to selected endian when compile for MIPS targets.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154195 91177308-0d34-0410-b5e6-96231b3b80d8
modern objective-c translator: translate array literal
expressions. // rdar://10803676


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154196 91177308-0d34-0410-b5e6-96231b3b80d8
Thread safety analysis: downgraded requirement that mutex expressions refer to a lockable type from error to warning.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154198 91177308-0d34-0410-b5e6-96231b3b80d8
MIPS: Provide a correct path to the dynamic linker when build for MIPS 64-bit targets.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154200 91177308-0d34-0410-b5e6-96231b3b80d8
SourceManager: Vectorize ComputeLineNumbers for SSE2.

This method is very hot, it is called when emitting diagnostics, in -E mode
and for many #pragma handlers. It scans through the whole source file to
count newlines, records and caches them in a vector.

The speedup from vectorization isn't very large, as we fall back to bytewise
scanning when we hit a newline. There might be a way to avoid leaving the sse
loop but everything I tried didn't work out because a call to push_back
clobbers xmm registers.

About 2% speedup on average on "clang -E > /dev/null" of all .cpp files in
clang's lib/Sema.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154204 91177308-0d34-0410-b5e6-96231b3b80d8
Rework ExprEngine::evalLoad and clients (e.g. VisitBinaryOperator) so that when we generate a new ExplodedNode
we use the same Expr* as the one being currently visited.  This is preparation for transitioning to having
ProgramPoints refer to CFGStmts.

This required a bit of trickery.  We wish to keep the old Expr* bindings in the Environment intact,
as plenty of logic relies on it and there is no reason to change it, but we sometimes want the Stmt* for
the ProgramPoint to be different than the Expr* being used for bindings.  This requires adding an extra
argument for some functions (e.g., evalLocation).  This looks a bit strange for some clients, but
it will look a lot cleaner when were start using CFGStmt* in the appropriate places.

As some fallout, the diagnostics arrows are a bit difference, since some of the node locations have changed.
I have audited these, and they look reasonable.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154214 91177308-0d34-0410-b5e6-96231b3b80d8
modern objective-c translation: support for 
dictionary literals. This concludes // rdar://10803676


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154218 91177308-0d34-0410-b5e6-96231b3b80d8
Implement support for null non-type template arguments for non-type
template parameters of pointer, pointer-to-member, or nullptr_t
type in C++11. Fixes PR9700 / <rdar://problem/11193097>.


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