From Vassil Vassilev:
Enable incremental parsing by the Preprocessor,
where more code can be provided after an EOF.
It mainly prevents the tearing down of the topmost lexer.
To be used like this:
PP.enableIncrementalProcessing();
while (getMoreSource()) {
  while (Parser.ParseTopLevelDecl(ADecl)) {...}
}
PP.enableIncrementalProcessing(false);


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152914 91177308-0d34-0410-b5e6-96231b3b80d8
Warn on flexible array members when in C89 mode, with -pedantic.
This fixes PR 4307.

Patch by Eitan Adler!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152918 91177308-0d34-0410-b5e6-96231b3b80d8
modern objective-c translator: writing @throw statement.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152931 91177308-0d34-0410-b5e6-96231b3b80d8
After r150615, which tablegens the group of a diagnostic as an index into the *.inc file, all diagnostic *.inc
files depend on all other diagnostic *.td files, because a diagnostic group can be introduced at any of the diagnostic
*.td files.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152937 91177308-0d34-0410-b5e6-96231b3b80d8
Skip through transparent contexts when deciding where to add a friend function.
This fixes g++.dg/parse/friend5.C.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152938 91177308-0d34-0410-b5e6-96231b3b80d8
Suppress macro expansion of NULL in NULL warnings.

For "int i = NULL;" we would produce:

null.cpp:5:11: warning: implicit conversion of NULL constant to integer [-Wconversion]
  int i = NULL;
      ~   ^~~~
null.cpp:1:14: note: expanded from macro 'NULL'
\#define NULL __null
              ^~~~~~

But we really shouldn't trace that macro expansion back into the header, yet we
still want macro back traces for code like this:

\#define FOO NULL
int i = FOO;

or

\#define FOO int i = NULL;
FOO

While providing appropriate tagging at different levels of the expansion, etc.

The included test case exercises these cases & does some basic validation (to
ensure we don't have macro expansion notes where we shouldn't, and do where we
should) - but doesn't go as far as to validate the source location/ranges
used in those notes and warnings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152940 91177308-0d34-0410-b5e6-96231b3b80d8
modern objective-c translator: write @synchronized.
// rdar://11063663


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152949 91177308-0d34-0410-b5e6-96231b3b80d8
Minor clean up of my last patch.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152950 91177308-0d34-0410-b5e6-96231b3b80d8
When "low alignment" is specified, then set the alignment of the aggregate's
store to 1. This allows code-gen to select a more appropriate alignment. If left
to zero, an alignment greater than the alignment of the pointer may be selected,
causing code-gen to use instructions which require an alignment greater than the
pointer guarantees.
<rdar://problem/11043589>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152951 91177308-0d34-0410-b5e6-96231b3b80d8
sink variable into assert

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152955 91177308-0d34-0410-b5e6-96231b3b80d8
Escape % in diagnostic message when compiling LLVM IR.

% is a common character in IR so we'd crash on almost any malformed IR. The
diagnostic formatter expects a formatting directive when it sees an unescaped %.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152956 91177308-0d34-0410-b5e6-96231b3b80d8
[analyzer] Add a statistic for the number of times we reach the max
number of steps in the work list.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152960 91177308-0d34-0410-b5e6-96231b3b80d8
[analyzer] +Comments

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152961 91177308-0d34-0410-b5e6-96231b3b80d8
[analyzer] Create symbol-aware stack hints (building upon r152837).

The symbol-aware stack hint combines the checker-provided message
with the information about how the symbol was passed to the callee: as
a parameter or a return value.

For malloc, the generated messages look like this :
"Returning from 'foo'; released memory via 1st parameter"
"Returning from 'foo'; allocated memory via 1st parameter"
"Returning from 'foo'; allocated memory returned"
"Returning from 'foo'; reallocation of 1st parameter failed"


(We are yet to handle cases when the symbol is a field in a struct or
an array element.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152962 91177308-0d34-0410-b5e6-96231b3b80d8
Make the storing variable's name generic.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152963 91177308-0d34-0410-b5e6-96231b3b80d8
[analyzer] Shorten the stack hint diagnostic.

Do not display the standard "Returning from 'foo'", when a stack hint is
available.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152964 91177308-0d34-0410-b5e6-96231b3b80d8
Fix crash on invalid code.  I've tried to produce a reduced test case, but when I do the specific crash is hidden.  Fixes <rdar://problem/11063594>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152968 91177308-0d34-0410-b5e6-96231b3b80d8
[analyzer] This test is breaking windows bots, make it darwin-specific.

(The plist output does not match the one we expect, specifically we do
not detect that the interesting symbol is returned by a call.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152969 91177308-0d34-0410-b5e6-96231b3b80d8
[analyzer] Add test case from PR10794 for using 'new' with Obj-C objects.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152975 91177308-0d34-0410-b5e6-96231b3b80d8
[analyzer] Don't claim an object was returned with +1 retain count before counting autoreleases. Fixes PR10376.

(Also, 80-column violations.)


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