New round of fixes for "Always compile debuginfo-tests for the host triple"

clang tests were breaking, at least when compiling clang only, from an
installed llvm. Make the lit.cfg script deal with the case when we don't
have a host_triple available.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220148 91177308-0d34-0410-b5e6-96231b3b80d8
CodeGen: ConstStructBuilder must verify packed constraints after padding

Before, ConstStructBuilder::AppendBytes would check packed constraints
prior to padding being added before the field's offset.  However, adding
this padding might force our struct to be packed.  Because we wouldn't
check *after* adding padding, ConstStructBuilder would be in an
inconsistent state leading to a crash.

This fixes PR21300.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220153 91177308-0d34-0410-b5e6-96231b3b80d8
Use the triple's isiOS() method instead of checking the value directly. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220158 91177308-0d34-0410-b5e6-96231b3b80d8
[analyzer] Tweak MallocSizeOfChecker to not warn when using sizeof(void*) to allocate a bunch of any pointer type.

This suppresses a common false positive when analyzing libc++.

Along the way, introduce some tests to show this checker actually
works with C++ static_cast<>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220160 91177308-0d34-0410-b5e6-96231b3b80d8
clang/test/Layout/itanium-union-bitfield.cpp: Appease i686.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220166 91177308-0d34-0410-b5e6-96231b3b80d8
[complex] Teach the complex math IR gen to emit direct math and
a NaN-test prior to the call to the library function.

This should automatically make fastmath (including just non-NaNs) able to avoid
the expensive libcalls and also open the door to more advanced folding in LLVM
based on the rules for complex math.

Two important notes to remember: first is that this isn't yet a proper
limited range mode, it's still just improving the unlimited range mode.
Also, it isn't really perfecet w.r.t. what an unlimited range mode
should be doing because it isn't quite handling the flags produced by
all the operations in the way desirable for that mode, but then neither
is compiler-rt's libcall. When the compiler-rt libcall is improved to
carefully manage flags, the code emitted here should be improved
correspondingly. And it is still a long-term desirable thing to add
a limited range mode to Clang that would be able to use direct math
without library calls here.

Special thanks to Steve Canon for the careful review on this patch and
teaching me about these issues. =D

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220167 91177308-0d34-0410-b5e6-96231b3b80d8
Revert r220153: "CodeGen: ConstStructBuilder must verify packed constraints after padding"

This commit caused two tests in LNT to regress. I'm able to reproduce on
any platform and will send reproduction steps to the original commit
log. This should restore the LNT bots that have been failing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220169 91177308-0d34-0410-b5e6-96231b3b80d8
Preprocessor.h: Suppress a warning in SkipMainFilePreamble. [-Wsign-compare]

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220170 91177308-0d34-0410-b5e6-96231b3b80d8
CodeGen: ConstStructBuilder must verify packed constraints after padding

This reverts commit r220169 which reverted r220153.  However, it also
contains additional changes:
- We may need to add padding *after* we've packed the struct.  This
  occurs when the aligned next field offset is greater than the new
  field's offset.  When this occurs, we make the struct packed.
  *However*, once packed the next field offset might be less than the
  new feild's offset.  It is in this case that we might further pad the
  struct.
- We would pad structs which were perfectly sized!  This behavior is
  immensely old.  This behavior came from blindly subtracting
  NextFieldOffsetInChars from RecordSize.  This doesn't take into
  account the fact that the struct might have a greater overall
  alignment than the last field.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220175 91177308-0d34-0410-b5e6-96231b3b80d8
[modules] Add support for #include_next.

#include_next interacts poorly with modules: it depends on where in the list of
include paths the current file was found. Files covered by module maps are not
found in include search paths when building the module (and are not found in
include search paths when @importing the module either), so this isn't really
meaningful. Instead, we fake up the result that #include_next *should* have
given: find the first path that would have resulted in the given file being
picked, and search from there onwards.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220177 91177308-0d34-0410-b5e6-96231b3b80d8
CodeGen: Update for LLVM API change

Callers of DataLayout::RoundUpAlignment should switch to
RoundUpToAlignment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220188 91177308-0d34-0410-b5e6-96231b3b80d8
Commit to test commit access

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220189 91177308-0d34-0410-b5e6-96231b3b80d8
clang-format: Fix indentation of struct definitions with array init.

Before:
  struct {
    int x;
    int y;
  } points[] = {
        {1, 2}, {2, 3},
  };

After:
  struct {
    int x;
    int y;
  } points[] = {
      {1, 2}, {2, 3},
  };

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220195 91177308-0d34-0410-b5e6-96231b3b80d8
clang-format: [ObjC] Fix using selector names as macro arguments.

Before:
  [self aaaaa:MACRO(a, b :, c :)];

After:
  [self aaaaa:MACRO(a, b:, c:)];

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220197 91177308-0d34-0410-b5e6-96231b3b80d8
D5823: Fix typo in Clang test arm-cortex-cpus.c; patch by Gabor Ballabas!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220201 91177308-0d34-0410-b5e6-96231b3b80d8
clang-format: Fix overloaded operator edge case.

Before:
  template <class F>
  void Call(F f) {
    f.template operator() <int>();
  }

After:
  template <class F>
  void Call(F f) {
    f.template operator()<int>();
  }

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220202 91177308-0d34-0410-b5e6-96231b3b80d8
Don't add ID mappings for offsets with no entities in a module

This is a better fix for 'duplicate key' problems in module continuous
range maps (vs what I added in r215810) by not adding any mappings at
all when there are no local entities. Now it also covers selectors,
which were not always being bumped because the record SELECTOR_OFFSET is
not always emitted.  I'll back out most of r215810 in a future commit,
since it should no longer be needed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220207 91177308-0d34-0410-b5e6-96231b3b80d8
Revert most of r215810, which is no longer needed

Now that we no longer add mappings when there are no local entities,
there is no need to always bump the size of the tables that correspond
to ContinuousRangeMaps.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220208 91177308-0d34-0410-b5e6-96231b3b80d8
Add RestrictQualifierLoc to DeclaratorChunk::FunctionTypeInfo

Clang supports __restrict__ as a function qualifier, but
DeclaratorChunk::FunctionTypeInfo lacked a field to track the qualifier's
source location (as we do with volatile, etc.). This was the subject of a FIXME
in GetFullTypeForDeclarator (in SemaType.cpp). This should also prove useful as
we add more warnings regarding questionable uses of the restrict qualifier.

There is no significant functional change (except for an improved source range
associated with the err_invalid_qualified_function_type diagnostic fixit
generated by GetFullTypeForDeclarator).

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

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