PR19346: Adding 0 to a null pointer has defined behavior in C++. Allow it in constant expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205757 91177308-0d34-0410-b5e6-96231b3b80d8
clang-format: Extend AllowShortFunctions.. to only merge inline functions.

Before AllowShortFunctionsOnASingleLine could either be true, merging
all functions, or false, merging no functions. This patch adds a third
value "Inline", which can be used to only merge short functions defined
inline in a class, i.e.:

  void f() {
    return 42;
  }

  class C {
    void f() { return 42; }
  };

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205760 91177308-0d34-0410-b5e6-96231b3b80d8
clang-format: Correctly understand arrays of pointers.

Before:
  A<int * []> a;

After:
  A<int *[]> a;

This fixes llvm.org/PR19360.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205761 91177308-0d34-0410-b5e6-96231b3b80d8
If a header is explicitly included in module A, and excluded from an umbrella
directory in module B, don't include it in module B!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205762 91177308-0d34-0410-b5e6-96231b3b80d8
clang-format: Fix incorrect multi-block-parameter computation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205763 91177308-0d34-0410-b5e6-96231b3b80d8
Have validate-system-headers override validate-once-per-build-session

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205773 91177308-0d34-0410-b5e6-96231b3b80d8
intrin.h: Fix up bugs in the cr3 and msr intrinsics

Don't include input and output regs in clobbers.  Prefix some
identifiers with __.  Add a memory constraint to __readcr3 to prevent
reordering.  This constraint is heavy handed, but conservatively
correct.

Thanks to PaX Team for the suggestions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205778 91177308-0d34-0410-b5e6-96231b3b80d8
Add support for MSVC's __FUNCSIG__

It is very similar to GCC's __PRETTY_FUNCTION__, except it prints the
calling convention.

Reviewers: majnemer

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205780 91177308-0d34-0410-b5e6-96231b3b80d8
Fix the funcsig test with an explicit triple

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205781 91177308-0d34-0410-b5e6-96231b3b80d8
Thread Safety Analysis.  Misc fixes to SExpr code, responding to code review
by Aaron Ballman.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205809 91177308-0d34-0410-b5e6-96231b3b80d8
[MS-ABI] Add support for #pragma section and related pragmas
This patch adds support for the msvc pragmas section, bss_seg, code_seg, 
const_seg and data_seg as well as support for __declspec(allocate()).

Additionally it corrects semantics and adds diagnostics for 
__attribute__((section())) and the interaction between the attribute 
and the msvc pragmas and declspec.  In general conflicts should now be 
well diganosed within and among these features.

In supporting the pragmas new machinery for uniform lexing for 
msvc pragmas was introduced.  The new machinery always lexes the 
entire pragma and stores it on an annotation token.  The parser 
is responsible for parsing the pragma when the handling the 
annotation token.

There is a known outstanding bug in this implementation in C mode.  
Because these attributes and pragmas apply _only_ to definitions, we 
process them at the time we detect a definition.  Due to tentative 
definitions in C, we end up processing the definition late.  This means 
that in C mode, everything that ends up in a BSS section will end up in 
the _last_ BSS section rather than the one that was live at the time of 
tentative definition, even if that turns out to be the point of actual 
definition.  This issue is not known to impact anything as of yet 
because we are not aware of a clear use or use case for #pragma bss_seg 
but should be fixed at some point.

Differential Revision=http://reviews.llvm.org/D3065#inline-16241 


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205810 91177308-0d34-0410-b5e6-96231b3b80d8
[MS-ABI] Lit fix for r205810
On linux strings have different linkage than on windows.  This 
patch makes the lit test more general.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205812 91177308-0d34-0410-b5e6-96231b3b80d8
[analyzer] When checking Foundation method calls, match the selectors exactly.

This also includes some infrastructure to make it easier to build multi-argument
selectors, rather than trying to use string matching on each piece. There's a bit
more setup code, but less cost at runtime.

PR18908

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205828 91177308-0d34-0410-b5e6-96231b3b80d8
Sema::SectionInfo: Prune "default" for now. Defaulted function is unavailable on msc17.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205840 91177308-0d34-0410-b5e6-96231b3b80d8
Sema::SectionInfo() should have an empty body. Sorry for the breakage.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205841 91177308-0d34-0410-b5e6-96231b3b80d8
clang-format: Add proto files and JavaScript to git-clang-format.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205842 91177308-0d34-0410-b5e6-96231b3b80d8
clang-format: Recognize lists ending in trailing commas correctly.

Previously, this did not look through trailing comments leading to a few
formatting oddities.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205843 91177308-0d34-0410-b5e6-96231b3b80d8
clang-format: Keep more trailing annotations on the same line.

More precisely keep all short annotations (<10 characters) on the same
line if possible. Previously, clang-format would only prefer to do so
for "const", "override" and "final". However, it seems to be generally
preferable, especially because some codebases have to wrap those in
macros for backwards compatibility.

Before:
  void someLongFunction(int someLongParameter)
      OVERRIDE {}

After:
  void someLongFunction(
      int someLongParameter) OVERRIDE {}

This fixes llvm.org/PR19363.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205845 91177308-0d34-0410-b5e6-96231b3b80d8
clang-format: Allow breaking between trailing annotations in more cases.

Before:
  void aaaaaaaaaaaaaa(aaaaaaaa aaa) override AAAAAAAAAAAAAAAAAAAAAAAA(
      aaaaaaaaaaaaaaa);

After:
  void aaaaaaaaaaaaaa(aaaaaaaa aaa) override
      AAAAAAAAAAAAAAAAAAAAAAAA(aaaaaaaaaaaaaaa);

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