Implement [dcl.align]p5 and C11 6.7.5/4: alignas cannot underalign.
Also support alignas(0), which C++11 and C11 require us to ignore.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174157 91177308-0d34-0410-b5e6-96231b3b80d8
Add a new -Wundefined-inline warning for inline functions which are used but not
defined. Fixes PR14993!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174158 91177308-0d34-0410-b5e6-96231b3b80d8
Fix diagnostic for bad alignas use: it can't be applied to functions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174160 91177308-0d34-0410-b5e6-96231b3b80d8
Revamp of the basic layouting algorithm in clang-format.

In order to end up with good solutions, clang-format needs to try
"all" combinations of line breaks, evaluate them and select the
best one. Before, we have done this using a DFS with memoization
and cut-off conditions. However, this approach is very limited
as shown by the huge static initializer in the attachment of
llvm.org/PR14959.

Instead, this new implementation uses a variant of Dijkstra's
algorithm to do a prioritized BFS over the solution space.

Some numbers:
lib/Format/TokenAnnotator.cpp: 1.5s -> 0.15s
Attachment of PR14959: 10min+ (didn't finish) -> 10s

No functional changes intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174166 91177308-0d34-0410-b5e6-96231b3b80d8
Hopefully fix windows build due to non-standard pair implementation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174169 91177308-0d34-0410-b5e6-96231b3b80d8
Use const visitors in ASTDumper.
http://llvm-reviews.chandlerc.com/D355
Patch by Philip Craig!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174171 91177308-0d34-0410-b5e6-96231b3b80d8
Re-design the convenience interfaces on MatchFinder.

First, this implements a match() method on MatchFinder; this allows us
to get rid of the findAll implementation, as findAll is really a special
case of recursive matchers on match.

Instead of findAll, provide a convenience function match() that lets
users iterate easily over the results instead of needing to implement
callbacks.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174172 91177308-0d34-0410-b5e6-96231b3b80d8
libclang: introduce cxstring::createNull()


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174173 91177308-0d34-0410-b5e6-96231b3b80d8
libclang: itroduce cxstring::createEmpty()


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174174 91177308-0d34-0410-b5e6-96231b3b80d8
Revise unit testing for -fno-altivec, -mno-altivec.

As suggested, reverted the end-to-end test and added variations to an
existing Driver test.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174176 91177308-0d34-0410-b5e6-96231b3b80d8
Fix PR14881 by implementing conversion rules between int and complex int.

Prior to the patch, Clang does not properly promote types when a complex
integer operand is combined with an integer via a binary operator, or when
one is assigned to the other in either order.  This patch detects when
promotion is needed (and permissible) and generates the necessary code.

The test assmes no target has the same size operands for "char" and
"long long," and that no target performs arithmetic on char operands without
extending them to a larger format first.  If there are any targets for
which this is not the case, they should be XFAILed.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174181 91177308-0d34-0410-b5e6-96231b3b80d8
Fixed segmentation fault when a CFGBlock has NULL successor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174182 91177308-0d34-0410-b5e6-96231b3b80d8
Fix a string not seen without asserts

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174183 91177308-0d34-0410-b5e6-96231b3b80d8
Add check for @foo

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174185 91177308-0d34-0410-b5e6-96231b3b80d8
Introduce SourceManager::PredefinesFileID, to allow each checking of whether
a source location came from the predefines buffer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174190 91177308-0d34-0410-b5e6-96231b3b80d8
For ModuleLoader::makeModuleVisible() also pass the source location where the
module import occurred.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174191 91177308-0d34-0410-b5e6-96231b3b80d8
[modules] Introduce ModuleFile::DirectImportLoc which is the source location
where the module was explicitly or implicitly imported in the local translation unit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174192 91177308-0d34-0410-b5e6-96231b3b80d8
libclang: add comments for CXStringFlag


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174194 91177308-0d34-0410-b5e6-96231b3b80d8
libclang: document the purpose of createNull()


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174195 91177308-0d34-0410-b5e6-96231b3b80d8
Fix comments: these are not trailing comments


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