Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 410 commits
  • 215 files changed
  • 0 comments
  • 28 contributors
This comparison is big! We're only showing the most recent 250 commits
Aug 17, 2011
Argyrios Kyrtzidis Make Lexer::GetBeginningOfToken able to handle macro arg expansion lo…
…cations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137795 91177308-0d34-0410-b5e6-96231b3b80d8
0e87062
Argyrios Kyrtzidis [libclang] Make clang_getCursor able to handle locations that point i…
…nside macro arguments.

e.g. for:

\define INVOKE(METHOD, CLASS) [CLASS METHOD]

void test2() {
  INVOKE(meth, MyClass);
}

Pointing at 'meth' will give a CXCursor_ObjCMessageExpr and pointing at 'MyClass'
will give a CXCursor_ObjCClassRef.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137796 91177308-0d34-0410-b5e6-96231b3b80d8
4b43b30
Argyrios Kyrtzidis [python] Add support for CXType to python bindings.
Patch by Anders Waldenborg!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137797 91177308-0d34-0410-b5e6-96231b3b80d8
d7933e6
Francois Pichet Add serialization support for ClassScopeFunctionSpecializationDecl.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137799 91177308-0d34-0410-b5e6-96231b3b80d8
bc84532
Jordy Rose [analyzer] Add basic support for pluggable checkers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137802 91177308-0d34-0410-b5e6-96231b3b80d8
77a33a7
NAKAMURA Takumi [MSVC] Fix a warning C4334 "'operator' : result of 32-bit shift impli…
…citly converted to 64 bits (was 64-bit shift intended?)".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137803 91177308-0d34-0410-b5e6-96231b3b80d8
01a429a
Jordy Rose [analyzer] Add some documentation for the new analyzer plugin infrast…
…ructure.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137805 91177308-0d34-0410-b5e6-96231b3b80d8
8e24049
Jordy Rose Don't use BuiltinBug in analyzer plugin example.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137811 91177308-0d34-0410-b5e6-96231b3b80d8
26fb4cb
Benjamin Kramer Silence compiler warnings by casting object pointers to function poin…
…ters via intptr_t.

This is ugly but ISO C++ doesn't allow direct casts.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137812 91177308-0d34-0410-b5e6-96231b3b80d8
6875325
Jordy Rose [analyzer] Add a warning for an incompatible plugin version.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137813 91177308-0d34-0410-b5e6-96231b3b80d8
a8fd0bc
Jordy Rose Fix typo.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137814 91177308-0d34-0410-b5e6-96231b3b80d8
b7b0608
Jordy Rose Hook up -W[no-]analyzer-incompatible-plugin to new warning, and unbre…
…ak buildbot.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137816 91177308-0d34-0410-b5e6-96231b3b80d8
8a01087
Chandler Carruth Introduce a new warning, -Wtop-level-comparison. This warning is
a complement to the warnings we provide in condition expressions. Much
like we warn on conditions such as:

  int x, y;
  ...
  if (x = y) ... // Almost always a typo of '=='

This warning applies the complementary logic to "top-level" statements,
or statements whose value is not consumed or used in some way:

  int x, y;
  ...
  x == y; // Almost always a type for '='

We also mirror the '!=' vs. '|=' logic.

The warning is designed to fire even for overloaded operators for two reasons:

1) Especially in the presence of widespread templates that assume
   operator== and operator!= perform the expected comparison operations,
   it seems unreasonable to suppress warnings on the offchance that
   a user has written a class that abuses these operators, embedding
   side-effects or other magic within them.
2) There is a trivial source modification to silence the warning for
   truly exceptional cases:

     (void)(x == y); // No warning

A (greatly reduced) form of this warning has already caught a number of
bugs in our codebase, so there is precedent for it actually firing. That
said, its currently off by default, but enabled under -Wall.

There are several fixmes left here that I'm working on in follow-up
patches, including de-duplicating warnings from -Wunused, sharing code
with -Wunused's implementation (and creating a nice place to hook
diagnostics on "top-level" statements), and handling cases where a proxy
object with a bool conversion is returned, hiding the operation in the
cleanup AST nodes.

Suggestions for any of this code more than welcome. Also, I'd really
love suggestions for better naming than "top-level".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137819 91177308-0d34-0410-b5e6-96231b3b80d8
9d8eb3b
Chandler Carruth Don't suggest assignment in implausible situation. We still warn, as the
code is very likely to be buggy, but its going to require more
significant changes on the part of the user to correct it in this case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137820 91177308-0d34-0410-b5e6-96231b3b80d8
50bf68f
Chandler Carruth Fix this test which had encoded the typo fixed in r137814.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137821 91177308-0d34-0410-b5e6-96231b3b80d8
579a052
Chandler Carruth Treating the unused equality comparisons as something other than part of
-Wunused was a mistake. It resulted in duplicate warnings and lots of
other hacks. Instead, this should be a special sub-category to
-Wunused-value, much like -Wunused-result is.

Moved to -Wunused-comparison, moved the implementation to piggy back on
the -Wunused-value implementation instead of rolling its own, different
mechanism for catching all of the "interesting" statements.

I like the unused-value mechanism for this better, but its currently
missing several top-level statements. For now, I've FIXME-ed out those
test cases. I'll enhance the generic infrastructure to catch these
statements in a subsequent patch.

This patch also removes the cast-to-void fixit hint. This hint isn't
available on any of the other -Wunused-value diagnostics, and if we want
it to be, we should add it generically rather than in one specific case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137822 91177308-0d34-0410-b5e6-96231b3b80d8
ec8058f
Chandler Carruth Whitelist operator== and operator!= as valid for unused value warnings,
even when overloaded and user-defined. These operators are both more
valuable to warn on (due to likely typos) and extremely unlikely to be
reasonable for use to trigger side-effects.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137823 91177308-0d34-0410-b5e6-96231b3b80d8
9b10683
Argyrios Kyrtzidis [python] Add test_type.py by Anders Waldenborg, which I forgot to com…
…mit in r137797.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137828 91177308-0d34-0410-b5e6-96231b3b80d8
2312f5f
Argyrios Kyrtzidis [python] Fix bug of the SourceLocation binding.
Patch by Anders Waldenborg!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137829 91177308-0d34-0410-b5e6-96231b3b80d8
6b04623
Nico Weber Add Gentoo gcc 4.3.4 include paths
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137834 91177308-0d34-0410-b5e6-96231b3b80d8
236a537
Add additional path to Linux toolchain. Patch by Will Dietz. PR10690.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137839 91177308-0d34-0410-b5e6-96231b3b80d8
cb6239a
[driver] Clang doesn't support -mkernel/-fapple-kext for i386, so it's
automatically invoking llvm-gcc's cc1plus, which doesn't support all options
supported by Clang.  Therefore, filter out unsupported options.
rdar://9964354


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137842 91177308-0d34-0410-b5e6-96231b3b80d8
285f9a2
Fix iterator end for r137842.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137849 91177308-0d34-0410-b5e6-96231b3b80d8
cc0de8c
Fix -ferror-limit= to properly emit notes following the last error
messages. Fi from David Blaikie, tests from Nikola Smiljanic!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137851 91177308-0d34-0410-b5e6-96231b3b80d8
f1d5948
Argyrios Kyrtzidis Mark objc methods that are implicitly declared for properties (not us…
…er-declared) as implicit.

This results in libclang ignoring such methods.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137852 91177308-0d34-0410-b5e6-96231b3b80d8
75cf3e8
Argyrios Kyrtzidis [libclang] Implicit objc methods are skipped, no need to check isSynt…
…hesized.

Plus, isSynthesized returning true does not mean that there is not a user-declared method declaration.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137858 91177308-0d34-0410-b5e6-96231b3b80d8
94fe9ee
Add a bit more comments to the BugReporter and friends.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137859 91177308-0d34-0410-b5e6-96231b3b80d8
38ca02e
Ted Kremenek Fix a handful of dead stores found by Clang's static analyzer. There'…
…s a bunch of others I haven't touched.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137867 91177308-0d34-0410-b5e6-96231b3b80d8
012614e
In the AST file format, eliminate the CHAINED_METADATA record. Instead,
all AST files have a normal METADATA record that has the same form
regardless of whether we refer to a chained PCH or any other kind of
AST file.

Introduce the IMPORTS record, which describes all of the AST files
that are imported by this AST file, and how (as a module, a PCH file,
etc.). Currently, we emit at most one entry to this record, to support
chained PCH.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137869 91177308-0d34-0410-b5e6-96231b3b80d8
e95b919
Ted Kremenek Fix incorrect code indentation and silence dead store warning due to …
…idiomatic code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137870 91177308-0d34-0410-b5e6-96231b3b80d8
07c682a
Jordy Rose [analyzer] Migrate assumption and binding handling from CFRefCount to…
… RetainReleaseChecker. This is mostly a textual move and required no supporting changes. No functionality change intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137874 91177308-0d34-0410-b5e6-96231b3b80d8
6704429
rjmccall Gather cleanups correctly in block return statements.
Thanks to Ted for finding this with magic tools.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137877 91177308-0d34-0410-b5e6-96231b3b80d8
d963c37
Argyrios Kyrtzidis Remove an unnecessary assignment (to InstFromD).
Caught by the static analyzer!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137878 91177308-0d34-0410-b5e6-96231b3b80d8
28fc50c
rjmccall Somehow I fouled up this test.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137882 91177308-0d34-0410-b5e6-96231b3b80d8
5d6a4ad
rjmccall Reorganize the return-type vs. expression checking code in
block returns; no functionality change.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137884 91177308-0d34-0410-b5e6-96231b3b80d8
0a7efe1
Ted Kremenek [libclang] Workaround potential race condition with code completion A…
…llocatedResults being freed after a CXTranslationUnit.

The Container USR's CXString had its underlying data owned by the CXTranslationUnit's string pool.  This
would result in trying to access freed memory.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137887 91177308-0d34-0410-b5e6-96231b3b80d8
baf82b0
Fix typo.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137893 91177308-0d34-0410-b5e6-96231b3b80d8
59f9b26
Remove EnhancedBugReport and RangedBugReport - pull all the extra fun…
…ctionality they provided into their parent BugReport. The only functional changes are: made getRanges() non const - it adds default range to Ranges if none are supplied, made getStmt() private, which was another FIXME.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137894 91177308-0d34-0410-b5e6-96231b3b80d8
e172e8b
Fix else style. No functionality change intended.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137896 91177308-0d34-0410-b5e6-96231b3b80d8
3060178
Remove DiagBugReport by pulling it into its parent BugReport.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137899 91177308-0d34-0410-b5e6-96231b3b80d8
b7530a4
Add more comments for BugReport.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137901 91177308-0d34-0410-b5e6-96231b3b80d8
e7c4c4c
Ted Kremenek Add experimental -Wstrlcpy-size warning that looks to see if the size…
… argument for strlcpy/strlcat is the size of the *source*, and not the size of the *destination*. This warning is off by default (for now).

Warning logic provided by Geoff Keating.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137903 91177308-0d34-0410-b5e6-96231b3b80d8
4b53117
Aug 18, 2011
Francois Pichet Downgrade "err_init_list_variable_narrowing" into a warning in Micros…
…oft mode even if c++0x is enabled. This necessary to parse MSVC code in C++0x mode.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137904 91177308-0d34-0410-b5e6-96231b3b80d8
b0a58cd
bcardosolopes "-mavx" should also enable all other SSE levels.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137905 91177308-0d34-0410-b5e6-96231b3b80d8
292772c
[driver] Don't generate diagnostics (i.e., preprocessed source) if re…
…ading

from stdin.  This allows Eli and the like to continue with their debugging 
trickery without loss of limb (or car) on my part. :)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137906 91177308-0d34-0410-b5e6-96231b3b80d8
90c8802
Add some more options that aren't handled by llvm-gcc on fallback.
This is going to be made a table.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137907 91177308-0d34-0410-b5e6-96231b3b80d8
81ae902
Argyrios Kyrtzidis For the MacroExpands preprocessor callback, also pass the SourceRange
of expansion (for function macros it includes the right paren).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137909 91177308-0d34-0410-b5e6-96231b3b80d8
1b2d536
Ted Kremenek Implement '-Weverything', which enables all warnings except those exp…
…licitly mapped to be ignored.

Currently this includes -pedantic warnings as well; we'll need to consider whether these should
be included.

This works as expected with -Werror.

Test cases were added to Sema/warn-unused-parameters.c, but they should probably be broken off into
their own test file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137910 91177308-0d34-0410-b5e6-96231b3b80d8
1e473cc
Ted Kremenek Add documentation on -Weverything.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137911 91177308-0d34-0410-b5e6-96231b3b80d8
f391fa7
[driver] Implement in a more table-like manner and add many more warn…
…ing options

that aren't handled by llvm-gcc on fallback.
Enhancement to rdar://9964354



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137912 91177308-0d34-0410-b5e6-96231b3b80d8
04225c1
Fix off by one.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137915 91177308-0d34-0410-b5e6-96231b3b80d8
f01f847
Chandler Carruth Remove the last FIXMEs on -Wunused-comparison since it got moved to
entirely use the existing -Wunused-value infrastructure. This also fixes
a few missed cases for -Wunused in general.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137916 91177308-0d34-0410-b5e6-96231b3b80d8
5440bfa
Fix a regression form r137894. Make sure the custom BugReporterVisito…
…rs get registred as they were in EnhancedBugReport. Would be good to add a test for this.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137917 91177308-0d34-0410-b5e6-96231b3b80d8
f19eef8
No seriously, remove the unsupported warning options.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137918 91177308-0d34-0410-b5e6-96231b3b80d8
7e9e74b
Ted Kremenek Revert r137903, "Add experimental -Wstrlcpy-size warning that looks t…
…o see if the size argument for strlcpy/strlcat is the size of the *source*, and not the size of the *destination*. This warning is off by default (for now)."

This currently doesn't work on Windows.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137920 91177308-0d34-0410-b5e6-96231b3b80d8
1cb4f66
Keep track of which modules have been loaded directly (e.g., via
-import-module) vs. loaded because some other module depends on
them. As part of doing this, pass down the module that caused a module
to be loaded directly, rather than assuming that we're loading a
chain. Finally, write out all of the directly-loaded modules when
serializing an AST file (using the new IMPORTS record), so that an AST
file can depend on more than one other AST file, all of which will be
loaded when that AST file is loaded. This allows us to form and load a
tree of modules, but we can't yet load a DAG of modules.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137923 91177308-0d34-0410-b5e6-96231b3b80d8
10bc00f
Teach ModuleManager::addModule() to check whether a particular module
has already been loaded before allocating a new Module structure. If
the module has already been loaded (uniquing based on file name), then
just return the existing module rather than trying to load it again.

This allows us to load a DAG of modules. Introduce a simple test case
that forms a diamond-shaped module graph, and illustrates that a
source file importing the bottom of the diamond can see declarations
in all four of the modules that make up the diamond.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137925 91177308-0d34-0410-b5e6-96231b3b80d8
a4c189f
Chandler Carruth Always mark friend function declarations in class templates as
implicitly instantiable, even if we don't see a body on the friend
function declaration. The body may simply have not yet been attached.
This fixes PR10666.

There may be an alternate, preferred implementation strategy, see my
FIXME. Review would definitely be appreciated Doug. =D

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137934 91177308-0d34-0410-b5e6-96231b3b80d8
80f5b16
Francois Pichet Add support for MSVC __unaligned attribute. Necessary to parse MSVC h…
…eaders in 64-bit mode (ie: when _M_IA64 or _M_AMD64 is defined)

more info: http://msdn.microsoft.com/en-us/library/ms177389.aspx

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137935 91177308-0d34-0410-b5e6-96231b3b80d8
3bd9aa4
klimek Fixes traversal of class template nodes on template instantiations.
Also fixes a spelling error.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137945 91177308-0d34-0410-b5e6-96231b3b80d8
1f89b40
Use StringRef, rather than C string APIs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137958 91177308-0d34-0410-b5e6-96231b3b80d8
8722a5d
Argyrios Kyrtzidis [libclang] Annotate correctly macro argument tokens.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137961 91177308-0d34-0410-b5e6-96231b3b80d8
a676379
Rework DiagnoseInvalidRedeclaration to add the ability to correct typ…
…os when

diagnosing invalid function redeclarations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137966 91177308-0d34-0410-b5e6-96231b3b80d8
5161163
Add a test for checking that custom diagnostic visitors are working.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137970 91177308-0d34-0410-b5e6-96231b3b80d8
647a751
Temporarily revert r137925 to appease buildbots. Original commit mess…
…age:

Teach ModuleManager::addModule() to check whether a particular module
has already been loaded before allocating a new Module structure. If
the module has already been loaded (uniquing based on file name), then
just return the existing module rather than trying to load it again.

This allows us to load a DAG of modules. Introduce a simple test case
that forms a diamond-shaped module graph, and illustrates that a
source file importing the bottom of the diamond can see declarations
in all four of the modules that make up the diamond.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137971 91177308-0d34-0410-b5e6-96231b3b80d8
870d1fe
Argyrios Kyrtzidis [libclang] Support code-completion inside macro arguments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137973 91177308-0d34-0410-b5e6-96231b3b80d8
5c5f03e
Ted Kremenek Reapply r137903, but fix the definition of size_t in the test case to…
… use __SIZE_TYPE__ (and hence be portable).

Also, change the warning to -Wstrl-incorrect-size.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137980 91177308-0d34-0410-b5e6-96231b3b80d8
bd5da9d
Ted Kremenek Remove main() *errors* from warning group.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137983 91177308-0d34-0410-b5e6-96231b3b80d8
3366582
Don't accept a typo correction if the corrected identifier is the sam…
…e as the

uncorrected identifier. Fixes a problem pointed out by Eli.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137987 91177308-0d34-0410-b5e6-96231b3b80d8
d2c8972
Ted Kremenek [libclang] Remove NestedNameSpecifierVisit, as Clang says that this c…
…ode is dead.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137999 91177308-0d34-0410-b5e6-96231b3b80d8
47695c8
Static Analyzer Diagnostics: Move custom diagnostic visitors from Bug…
…ReporterContext to BugReport.

One API change: I added BugReporter as an additional parameter to the BugReporterVisitor::VisitNode() method to allow visitors register other visitors with the report on the fly (while processing a node). This functionality is used by NilReceiverVisitor, which registers TrackNullOrUndefValue when the receiver is null.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138001 91177308-0d34-0410-b5e6-96231b3b80d8
8e6431a
Ted Kremenek Enhance -Wstrl-incorrect-size to not report a FIXIT for destinations …
…that are flexible arrays or have size 1.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138004 91177308-0d34-0410-b5e6-96231b3b80d8
8f74622
Aug 19, 2011
Add a completely hacky workaround for pch kext files with different e…
…xtensions

when falling back to cc1plus for our compile.

rdar://9963920


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138017 91177308-0d34-0410-b5e6-96231b3b80d8
88b7cf0
Chandler Carruth Fix an egregious formatting goof.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138023 91177308-0d34-0410-b5e6-96231b3b80d8
47eb2b6
Chandler Carruth Fix the rest of the indent goofiness here.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138024 91177308-0d34-0410-b5e6-96231b3b80d8
3d095fe
Fix a memory leak in the analyzer - BugReports didn't get freed. Plus…
…, remove invalid assert from the destructor which wasn't called previously due to the leak.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138027 91177308-0d34-0410-b5e6-96231b3b80d8
3b030a2
Teach ModuleManager::addModule() to check whether a particular module
has already been loaded before allocating a new Module structure. If
the module has already been loaded (uniquing based on file name), then
just return the existing module rather than trying to load it again.

This allows us to load a DAG of modules. Introduce a simple test case
that forms a diamond-shaped module graph, and illustrates that a
source file importing the bottom of the diamond can see declarations
in all four of the modules that make up the diamond.

Note that this version moves the file-opening logic into the module
manager, rather than splitting it between the module manager and the
AST reader. More importantly, it properly handles the
weird-but-possibly-useful case of loading an AST file from "-".


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138030 91177308-0d34-0410-b5e6-96231b3b80d8
fac4ece
Warn about and truncate UCNs that are too big for their character lit…
…eral type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138031 91177308-0d34-0410-b5e6-96231b3b80d8
0473cd5
Benjamin Kramer Reflow code. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138032 91177308-0d34-0410-b5e6-96231b3b80d8
7d23b4a
Ted Kremenek Rename -Wstrl-incorrect-size to -Wstrlcpy-strlcat-size. This warning …
…really is just specific to strlcpy and strlcat.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138038 91177308-0d34-0410-b5e6-96231b3b80d8
00fd773
objective-c: Bring objective-c handling of decl context
to modernity. Instead of passing down individual
context objects from parser to sema, establish decl
context in parser and have sema access current context
as needed. I still need to take of Doug's comment for
minor cleanups.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138040 91177308-0d34-0410-b5e6-96231b3b80d8
3dbf2f5
Revers r138040. Need to look at a few buildbot failures.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138049 91177308-0d34-0410-b5e6-96231b3b80d8
e6f07f5
objc-arc: @property definitions should default to (strong) when not
specified. // rdar://9971982


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138062 91177308-0d34-0410-b5e6-96231b3b80d8
bc03aea
Improve the correctness and accuracy of the message for -Wdynamic-cla…
…ss-memaccess

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138074 91177308-0d34-0410-b5e6-96231b3b80d8
5c5218e
nlewycky Do not depend on the standard library on the system. Replace the #inc…
…lude with

the relevant section of libcxx.

As an aside, I am not at all confident that this test is still testing that it's
supposed to.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138075 91177308-0d34-0410-b5e6-96231b3b80d8
1999c7c
Remove unused function ModuleManager::exportLookup()
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138079 91177308-0d34-0410-b5e6-96231b3b80d8
a3a0cf0
Remove another unused function from ModuleManager. We have no notion …
…of a 'last' module any more

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138081 91177308-0d34-0410-b5e6-96231b3b80d8
dcf3c0f
Migrate 2009-12-23-MissingSext.cpp from test/FrontendC++ and modify
for sext -> and difference.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138088 91177308-0d34-0410-b5e6-96231b3b80d8
8a8d6d8
Migrate 2009-10-27-crash.cpp from llvm/test/FrontendC++.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138089 91177308-0d34-0410-b5e6-96231b3b80d8
2c56377
Migrate 2009-09-09-packed-layout.cpp test from llvm/test/FrontendC++.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138090 91177308-0d34-0410-b5e6-96231b3b80d8
ea6de30
Migrate 2009-08-11-VectorRetTy.cpp from llvm/test/FrontendC++.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138095 91177308-0d34-0410-b5e6-96231b3b80d8
07881a2
Migrate 2009-07-16-Using.cpp from llvm/test/FrontendC++.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138096 91177308-0d34-0410-b5e6-96231b3b80d8
3592f64
Migrate 2009-08-05-ZeroInitWidth.cpp from llvm/test/FrontendC++.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138097 91177308-0d34-0410-b5e6-96231b3b80d8
59de683
Migrate 2009-07-16-PrivateCopyConstructor.cpp from llvm/test/Frontend…
…C++.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138098 91177308-0d34-0410-b5e6-96231b3b80d8
c0791f1
Migrate 2009-06-16-DebugInfoCrash.cpp from llvm/test/FrontendC++.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138099 91177308-0d34-0410-b5e6-96231b3b80d8
28e7d2a
Remove this test. It's failing and it's not that good of a test.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138106 91177308-0d34-0410-b5e6-96231b3b80d8
e90e9c3
Migrate 2009-04-23-bool2.cpp from llvm/test/FrontendC++.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138110 91177308-0d34-0410-b5e6-96231b3b80d8
f54a225
Migrate 2009-03-17-dbg.cpp from llvm/test/FrontendC++.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138111 91177308-0d34-0410-b5e6-96231b3b80d8
723665f
Migrate 2008-10-29-WrongOffset.cpp from llvm/test/FrontendC++.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138112 91177308-0d34-0410-b5e6-96231b3b80d8
7b9bb72
Migrate 2008-05-07-CrazyOffsetOf.cpp from llvm/test/FrontendC++.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138113 91177308-0d34-0410-b5e6-96231b3b80d8
3d88380
Migrate 2008-01-12-VecInit.cpp from llvm/test/FrontendC++.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138114 91177308-0d34-0410-b5e6-96231b3b80d8
44f609c
Migrate 2007-10-01-StructResize.cpp from llvm/test/FrontendC++.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138117 91177308-0d34-0410-b5e6-96231b3b80d8
97b02c5
Remove 2008-10-29-WrongOffset.cpp since it requires a header file on all
platforms.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138118 91177308-0d34-0410-b5e6-96231b3b80d8
e645278
Static Analyzer Diagnostics: Kill the addVisitorCreator(callbackTy, v…
…oid*) API in favor of addVisitor(BugReporterVisitor*).

1) Create a header file to expose the predefined visitors. And move the parent(BugReporterVisitor) there as well.

2) Remove the registerXXXVisitor functions - the Visitor constructors/getters can be used now to create the object. One exception is registerVarDeclsLastStore(), which registers more then one visitor, so make it static member of FindLastStoreBRVisitor.

3) Modify all the checkers to use the new API.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138126 91177308-0d34-0410-b5e6-96231b3b80d8
50bbc16
Argyrios Kyrtzidis Refactor common functionality into SourceManager::getFileIDSize, no f…
…unctionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138127 91177308-0d34-0410-b5e6-96231b3b80d8
54232ad
Argyrios Kyrtzidis Rename TokenLexer::getMacroExpansionLocation -> getExpansionLocForMac…
…roDefLoc, no functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138128 91177308-0d34-0410-b5e6-96231b3b80d8
ec3b538
Argyrios Kyrtzidis For assigning SourceLocations to macro arg tokens, reserve a single S…
…LocEntry

for tokens that are lexed consecutively from the same FileID, instead of creating
a SLocEntry for each token. e.g for

   assert(foo == bar);

there will be a single SLocEntry for the "foo == bar" chunk and locations
for the 'foo', '==', 'bar' tokens will point inside that chunk.

For parsing SemaExpr.cpp, this reduced the number of SLocEntries by 25%.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138129 91177308-0d34-0410-b5e6-96231b3b80d8
d60a34a
Migrate:
2007-01-06-PtrMethodInit.cpp
2007-04-05-PackedBitFields-1.cpp
2007-04-05-PackedBitFieldsOverlap-2.cpp
2007-04-05-PackedBitFieldsOverlap.cpp
2007-04-05-PackedBitFieldsSmall.cpp
2007-04-05-StructPackedFieldUnpacked.cpp
2007-04-10-PackedUnion.cpp
2007-04-14-FNoBuiltin.cpp
2007-05-03-VectorInit.cpp
2007-07-29-RestrictPtrArg.cpp
2007-07-29-RestrictRefArg.cpp
2007-09-10-RecursiveTypeResolution.cpp

from llvm/test/FrontendC++ and FileCheckize where appropriate.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138134 91177308-0d34-0410-b5e6-96231b3b80d8
335552e
Migrate 2007-01-02-UnboundedArray.cpp from llvm/test/FrontendC++.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138138 91177308-0d34-0410-b5e6-96231b3b80d8
3b20b9e
Try removing xfail and xtarget to see if this brings back a couple of…
… bots.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138139 91177308-0d34-0410-b5e6-96231b3b80d8
2ba4fde
Static Analyzer Diagnostics: Switch CFRefCount to using the new visit…
…or API. BugReport no longer needs to inherit from BugReporterVisitor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138142 91177308-0d34-0410-b5e6-96231b3b80d8
dc757b0
Add new test.
Remove one outdated test.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138144 91177308-0d34-0410-b5e6-96231b3b80d8
c0b850c
Migrate, FileCheckize and update:
2005-02-11-AnonymousUnion.cpp
2005-02-13-BadDynamicInit.cpp
2005-02-14-BitFieldOffset.cpp
2005-02-19-BitfieldStructCrash.cpp
2005-02-19-UnnamedVirtualThunkArgument.cpp
2005-02-20-BrokenReferenceTest.cpp
2006-03-01-GimplifyCrash.cpp
2006-03-06-C++RecurseCrash.cpp
2006-09-12-OpaqueStructCrash.cpp
2006-10-30-ClassBitfield.cpp
2006-11-20-GlobalSymbols.cpp
2006-11-20-GlobalSymbols.ll
2006-11-30-ConstantExprCrash.cpp

from llvm/test/FrontendC++.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138148 91177308-0d34-0410-b5e6-96231b3b80d8
16d482e
Remove dead file.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138150 91177308-0d34-0410-b5e6-96231b3b80d8
56a89ea
Modify the check line to be happier on windows.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138152 91177308-0d34-0410-b5e6-96231b3b80d8
51abac1
Aug 20, 2011
Migrate, FileCheckize and update:
2004-03-08-ReinterpretCastCopy.cpp
2004-03-09-UnmangledBuiltinMethods.cpp
2004-03-15-CleanupsAndGotos.cpp
2004-06-08-LateTemplateInstantiation.cpp
2004-09-27-CompilerCrash.cpp
2004-09-27-DidntEmitTemplate.cpp
2004-11-27-ExceptionCleanupAssertion.cpp
2004-11-27-FriendDefaultArgCrash.cpp
2005-01-03-StaticInitializers.cpp

from llvm/test/FrontendC++.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138157 91177308-0d34-0410-b5e6-96231b3b80d8
2368b6a
Migrate, FileCheckize and update:
2003-11-02-WeakLinkage.cpp
2003-11-18-PtrMemConstantInitializer.cpp
2003-11-25-ReturningOpaqueByValue.cpp
2003-11-27-MultipleInheritanceThunk.cpp
2003-11-29-DuplicatedCleanupTest.cpp
2003-12-08-ArrayOfPtrToMemberFunc.cpp
2004-01-11-DynamicInitializedConstant.cpp

from llvm/test/FrontendC++.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138162 91177308-0d34-0410-b5e6-96231b3b80d8
aeac10e
Remove this file, it's not much of a test and string headers cause
problems on windows.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138166 91177308-0d34-0410-b5e6-96231b3b80d8
f9a642f
Migrate and update:
2007-10-03-MetadataPointers.mm
2010-08-04-Template.mm
2010-08-06-X.Y-syntax.mm

from llvm/test/FrontendObjC++.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138167 91177308-0d34-0410-b5e6-96231b3b80d8
baa15d6
Migrate, FileCheckize and update:
2007-04-03-ObjcEH.m
2007-05-02-Strong.m
2007-10-18-ProDescriptor.m
2007-10-23-GC-WriteBarrier.m
2008-10-3-EhValue.m
2008-11-12-Metadata.m
2008-11-24-ConstCFStrings.m

from llvm/test/FrontendObjC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138172 91177308-0d34-0410-b5e6-96231b3b80d8
7bc54e5
Migrate, update and FileCheckize:
2008-11-25-Blocks.m
2009-01-26-WriteBarrier-2.m
2009-02-05-VolatileProp.m
2009-08-05-utf16.m

from llvm/test/FrontendObjC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138175 91177308-0d34-0410-b5e6-96231b3b80d8
a1032cc
Migrate, update and FileCheckize:
	 2010-02-01-utf16-with-null.m
	 2010-02-23-DbgInheritance.m
	 2010-03-17-StructRef.m
	 2011-03-08-IVarLookup.m

from llvm/test/FrontendObjC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138180 91177308-0d34-0410-b5e6-96231b3b80d8
89a179b
Remove XFAIL/XTARGET since this is passing on the other bots.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138182 91177308-0d34-0410-b5e6-96231b3b80d8
7be2f46
Ted Kremenek Remove dead code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138183 91177308-0d34-0410-b5e6-96231b3b80d8
e0e2933
Static Analyzer Diagnostics: Move the responsibility for generating t…
…he endOfPath diagnostic piece from BugReport to BugReporterVisitor. Switch CFRefCount to use visitors in order to generate the endOfPath piece.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138184 91177308-0d34-0410-b5e6-96231b3b80d8
23f395e
Introduce a module visitation function that starts at the top-level
modules (those that no other module depends on) and performs a search
over all of the modules, visiting a new module only when all of the
modules that depend on it have already been visited. The visitor can
abort the search for all modules that a module depends on, which
allows us to minimize the number of lookups necessary when performing
a search.

Switch identifier lookup from a linear walk over the set of modules to
this module visitation operation. The behavior is the same for simple
PCH and chained PCH, but provides the proper search order for
modules. Verified with printf debugging, since we don't have enough in
place to actually test this.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138187 91177308-0d34-0410-b5e6-96231b3b80d8
211f6e8
Clean out some minor cruft in the AST reader; no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138188 91177308-0d34-0410-b5e6-96231b3b80d8
90115a3
Make the loading of multiple records for the same identifier (from
different modules) more robust. It already handled (simple) merges of
the set of declarations attached to that identifier, so add a test
case that shows us getting two different declarations for the same
identifier (one struct, one function) from different modules, and are
able to use both of them.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138189 91177308-0d34-0410-b5e6-96231b3b80d8
0c02ada
NAKAMURA Takumi test/CodeGenCXX/2003-11-25-ReturningOpaqueByValue.cpp: Mark XFAIL: wi…
…n32.

FIXME: Avoid using system headers. clang cannot handle MS <vector> yet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138190 91177308-0d34-0410-b5e6-96231b3b80d8
3526e47
Ted Kremenek Rename CXXExprEngine.cpp to ExprEngineCXX.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138193 91177308-0d34-0410-b5e6-96231b3b80d8
5f76431
Ted Kremenek Start partitioning ExprEngine.cpp into separate .cpp files that handl…
…e different parts

of the analysis (e.g., analysis of C expressions, analysis of Objective-C expressions, and so on).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138194 91177308-0d34-0410-b5e6-96231b3b80d8
294fd0a
Ted Kremenek [analyzer] Simplify ExprEngine::VisitBinaryOperator() by removing rec…
…ursive visit to subexpressions (which is no longer needed).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138195 91177308-0d34-0410-b5e6-96231b3b80d8
d203c02
Ted Kremenek [analyzer] Handle reads of ObjCPropertyRefExprs implicitly in Environ…
…ment. No need to bind an explicit value and create a new node.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138196 91177308-0d34-0410-b5e6-96231b3b80d8
f8b5aae
Chandler Carruth Remove this test. It requires C++ standard library headers, which we'd
like to avoid within the Clang test suite, it doesn't verify the output
at all so it only servers as a test that Clang doesn't crash, and
finally all it does is declare a function that returns a vector and call
it. Probably the biggest thing being tested here is Clang's parsing of
the vector template, and we have lots of good template parsing tests. We
don't need another in codegen.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138197 91177308-0d34-0410-b5e6-96231b3b80d8
c44e941
Typo spotted by Ivan Krasin.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138200 91177308-0d34-0410-b5e6-96231b3b80d8
6b0baf9
NAKAMURA Takumi test/lit.cfg: Enable "crash-recovery" tests on Win32 hosts. CrashReco…
…veryContext supports Win32 since r138199.

FIXME: Shall we eliminate the feature "crash-recovery"?

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138201 91177308-0d34-0410-b5e6-96231b3b80d8
e1ffb15
Jordy Rose [analyzer] Move handling of hardcoded noreturn ("panic") methods from…
… CFRefCount to NoReturnFunctionChecker. No functionality change intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138210 91177308-0d34-0410-b5e6-96231b3b80d8
e62e87b
Jordy Rose Fix indentation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138211 91177308-0d34-0410-b5e6-96231b3b80d8
ab027fd
Jordy Rose [analyzer] RetainReleaseChecker always wants region change updates. T…
…here's no need for a flag, at least not right now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138212 91177308-0d34-0410-b5e6-96231b3b80d8
2f9a66d
Benjamin Kramer Fix compile on platforms that don't implicitly include stdarg.h here.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138214 91177308-0d34-0410-b5e6-96231b3b80d8
d9f5a70
Aug 21, 2011
Jordy Rose [analyzer] Replace calls to getNameAsString() with StringRef equivale…
…nts.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138215 91177308-0d34-0410-b5e6-96231b3b80d8
7df1234
Jordy Rose [analyzer] Migrate return value handling from CFRefCount to ExprEngin…
…e. This seems to result in a minor performance hit, but I think that will go away again once we eliminate TransferFuncs from function calls entirely.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138220 91177308-0d34-0410-b5e6-96231b3b80d8
500abad
Jordy Rose [analyzer] Remove FIXME; Ted reminded me that -init is not guaranteed…
… to return its receiver and pretending that it does won't actually buy us anything. (Comment change only.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138221 91177308-0d34-0410-b5e6-96231b3b80d8
df0fcdd
Jordy Rose [analyzer] Migrate the aliasing effects of CFRetain and CFMakeCollect…
…able from CFRefCount to RetainReleaseChecker. No intended functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138223 91177308-0d34-0410-b5e6-96231b3b80d8
76c506f
Argyrios Kyrtzidis Boost the efficiency of SourceManager::getMacroArgExpandedLocation.
Currently getMacroArgExpandedLocation is very inefficient and for the case
of a location pointing at the main file it will end up checking almost all of
the SLocEntries. Make it faster:

-Use a map of macro argument chunks to their expanded source location. The map
 is for a single source file, it's stored in the file's ContentCache and lazily
 computed, like the source lines cache.
-In SLocEntry's FileInfo add an 'unsigned NumCreatedFIDs' field that keeps track
 of the number of FileIDs (files and macros) that were created during preprocessing
 of that particular file SLocEntry. This is useful when computing the macro argument
 map in skipping included files while scanning for macro arg FileIDs that lexed from
 a specific source file. Due to padding, the new field does not increase the size
 of SLocEntry.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138225 91177308-0d34-0410-b5e6-96231b3b80d8
d9d2b67
Argyrios Kyrtzidis Fix gcc build.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138226 91177308-0d34-0410-b5e6-96231b3b80d8
21032df
Aug 22, 2011
Fix typo.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138227 91177308-0d34-0410-b5e6-96231b3b80d8
ec5bc81
Restore patch I reversed in r138040. Known buildbot
failures are resolved.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138234 91177308-0d34-0410-b5e6-96231b3b80d8
a28948f
Argyrios Kyrtzidis Fix a bug in objc @encoding of C++ classes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138235 91177308-0d34-0410-b5e6-96231b3b80d8
cb8061e
objc- checking for objc decl context range is unreliable and
subject to change. Check for equality instead.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138238 91177308-0d34-0410-b5e6-96231b3b80d8
80f7753
Chandler Carruth Fix a crash-on-valid that has been here for a very long time:
  const int &x = x;

This crashed by inifinetly recursing within the lvalue evaluation
routine. I've added a (somewhat) braindead way of preventing this
recursion. If folks have better suggestions for how to avoid it I'm all
ears.

That said, we have some work to do. This doesn't trigger a single
warning for uninitialized, self-initialized or otherwise completely
wrong code. In some senses, the crash was almost better.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138239 91177308-0d34-0410-b5e6-96231b3b80d8
0124839
Nico Weber Warn on missing [super dealloc] calls.
This matches gcc's logic. Half of PR10661.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138240 91177308-0d34-0410-b5e6-96231b3b80d8
9a1ecf0
objc - Simplify switing objc decl context by using
a context switching object.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138248 91177308-0d34-0410-b5e6-96231b3b80d8
9735c5e
objc - minor comment fix up and cleanup.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138253 91177308-0d34-0410-b5e6-96231b3b80d8
58a7649
Don't warn on varaidic macros in C++0x mode.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138257 91177308-0d34-0410-b5e6-96231b3b80d8
70c7b10
Clean up the CFRefBugReport - remove the members, which got moved to …
…the CFRefReportVisitors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138259 91177308-0d34-0410-b5e6-96231b3b80d8
edf4dae
Ted Kremenek Do not perform check for missing '[super dealloc]' under ARC as calli…
…ng -dealloc is illegal in that mode.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138261 91177308-0d34-0410-b5e6-96231b3b80d8
4eb14ca
objc - use existing API for temporary switch of
objc's decl context.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138267 91177308-0d34-0410-b5e6-96231b3b80d8
7939418
Static Analyzer Diagnostics: Allow checkers to add ExtraDescriptiveTe…
…xt, now renamed into ExtraText, to the diagnostic without subclassing BugReport.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138272 91177308-0d34-0410-b5e6-96231b3b80d8
7f2531c
objc refactoring - minor clean up.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138276 91177308-0d34-0410-b5e6-96231b3b80d8
2f64cfe
[analyzer] MacOSKeychainAPIChecker: Users of KeyChain API often use f…
…ree() to deallocate the password. Catch this error explicitly and generate the error message at the place where free() is called.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138296 91177308-0d34-0410-b5e6-96231b3b80d8
7bbd166
Jordy Rose [analyzer] Migrate the handling of retain-count-related RetEffects an…
…d ArgEffects from CFRefCount to RetainReleaseChecker. No intended functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138309 91177308-0d34-0410-b5e6-96231b3b80d8
294396b
Make sure we don't inline functions marked with __attribute__((naked)…
…). <rdar://problem/9973228>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138310 91177308-0d34-0410-b5e6-96231b3b80d8
2873aee
Aug 23, 2011
Jordy Rose [analyzer] Rename CFRefCount's evalSummary method to evalCallOrMessag…
…e, since it no longer, uh, evaluates call summaries.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138313 91177308-0d34-0410-b5e6-96231b3b80d8
6fa7dbe
block IRgen - Fixes a crash when determining if given block variable
is captured by a given statement expression. // rdar://10001085


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138314 91177308-0d34-0410-b5e6-96231b3b80d8
b9dbab1
Fix an incorrect note.
For the test case added to function-redecl.cpp, we were previously complaining
about a mismatch in the parameter types, since the definition used the
typedef'd type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138318 91177308-0d34-0410-b5e6-96231b3b80d8
903d6dc
Jordy Rose [analyzer] Only allocate retain summaries for interesting functions/m…
…essages. This is a minor saving of memory but doesn't seem to cost any performance.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138320 91177308-0d34-0410-b5e6-96231b3b80d8
4df54fe
Nico Weber enable -fstack-protector on 10.5 for usermode binaries by default.
This matches gcc's behavior.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138324 91177308-0d34-0410-b5e6-96231b3b80d8
2fef111
checking for __block variable captured by given
stmt expression, recursively walk down all substatements 
of the stmt expression. // rdar://10001085


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138334 91177308-0d34-0410-b5e6-96231b3b80d8
5033be1
Add support for a verifier to the driver. Currently only verifies debug
output on darwin so is hard coded there.

As a note this will need a little bit of refactoring in the class
hierarchy to separate it out for different verifiers based on input type.

Fixes rdar://8256258.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138343 91177308-0d34-0410-b5e6-96231b3b80d8
f857186
Thread-safety analysis: adding in a basic lockset tracking system. This
system flags an error when unlocking a lock which was not held, locking
the same lock twice, having a different lockset on each iteration of a
loop, or going out of scope while still holding a lock. In order to
successfully use the lockset, this patch also makes sure that attribute
arguments are attached correctly for later parsing.

This patch was also worked on by DeLesley Hutchins.

Note: This patch has been reviewed by Chandler Carruth and Jeffrey
Yasskin. Feel free to provide post-commit review comments for a
subsequent patch.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138350 91177308-0d34-0410-b5e6-96231b3b80d8
3ac1fbc
Jordy Rose [analyzer] Move symbol death leak analysis from CFRefCount to RetainR…
…eleaseChecker.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138353 91177308-0d34-0410-b5e6-96231b3b80d8
38f17d6
Jordy Rose [analyzer] Move ReturnStmt retain-count analysis from CFRefCount to R…
…etainReleaseChecker. Tweak CFRefReport to reflect that fact that ReturnStmt checks are pre-statement, not post-statement. No intended functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138358 91177308-0d34-0410-b5e6-96231b3b80d8
f53e8c7
Jordy Rose [analyzer] Move helper method handleAutoreleaseCounts from CFRefCount…
… to RetainReleaseChecker. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138365 91177308-0d34-0410-b5e6-96231b3b80d8
8d22863
Remove function parameter which always used the default value.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138368 91177308-0d34-0410-b5e6-96231b3b80d8
629f118
Cleanup to use helper.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138369 91177308-0d34-0410-b5e6-96231b3b80d8
dbff1a0
Jordy Rose [analyzer] Move helper method Update from CFRefCount to RetainRelease…
…Checker. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138370 91177308-0d34-0410-b5e6-96231b3b80d8
e0a5d32
Ted Kremenek Fix regression in -Wuninitialized involving VLAs. It turns out that w…
…e were modeling sizeof(VLAs)

incorrectly in the CFG, and also the static analyzer.  This patch regresses the analyzer a bit, but
that needs to be followed up with a better solution.

Fixes <rdar://problem/10008112>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138372 91177308-0d34-0410-b5e6-96231b3b80d8
540dda6
Jordy Rose [analyzer] Move function retain-count effect summary log from CFRefCo…
…unt to RetainReleaseChecker, and then explicitly provide the summary log when creating CFRefReports. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138374 91177308-0d34-0410-b5e6-96231b3b80d8
ec9ef85
Argyrios Kyrtzidis Move a couple of SourceManager functions out-of-line; no functionalit…
…y change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138375 91177308-0d34-0410-b5e6-96231b3b80d8
984e42c
Argyrios Kyrtzidis In Lexer::isAtEndOfMacroExpansion use SourceManager::isInFileID and a…
…void

the extra SourceManager::getFileID call.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138376 91177308-0d34-0410-b5e6-96231b3b80d8
f8c5065
Argyrios Kyrtzidis TokenLexer::getExpansionLocForMacroDefLoc doesn't need to return an i…
…nvalid SourceLocation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138377 91177308-0d34-0410-b5e6-96231b3b80d8
c0069d8
Argyrios Kyrtzidis Rename SourceManager::isBeforeInSourceLocationOffset -> isBeforeInSLo…
…cAddrSpace.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138378 91177308-0d34-0410-b5e6-96231b3b80d8
5d579e7
Argyrios Kyrtzidis Introduce SourceManager::isInSLocAddrSpace and use it in TokenLexer i…
…nstead of isInFileID

since it is a bit more efficient.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138379 91177308-0d34-0410-b5e6-96231b3b80d8
499ea55
Argyrios Kyrtzidis Amend r138129 (reduction of SLocEntries) which introduced performance…
… regression due

to increased calls to SourceManager::getFileID. (rdar://9992664)

Use a slightly different approach that is more efficient both in terms of speed
(no extra getFileID calls) and in SLocEntries reduction.

Comparing pre-r138129 and this patch we get:

For compiling SemaExpr.cpp reduction of SLocEntries by 26%.
For the boost enum library:
  -SLocEntries -34% (note that this was -5% for r138129)
  -Memory consumption -50%
  -PCH size -31%

Reduced SLocEntries also benefit the hot function SourceManager::getFileID,
evident by the reduced "FileID scans".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138380 91177308-0d34-0410-b5e6-96231b3b80d8
b6c465e
Argyrios Kyrtzidis Remove one SourceManager::isInFileID overload and use isOffsetInFileI…
…D for the other.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138381 91177308-0d34-0410-b5e6-96231b3b80d8
d7cb46c
Jordy Rose [analyzer] Cleanup: Move temporary declarations of CFRefCount variabl…
…es closer to their uses. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138382 91177308-0d34-0410-b5e6-96231b3b80d8
d02b4af
Jordy Rose [analyzer] Make CFRefBug and CFRefReportVisitor not dependent on CFRe…
…fCount. Unfortunately, CFRefReport still is. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138388 91177308-0d34-0410-b5e6-96231b3b80d8
e3fb7e4
Right now this requires asserts.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138389 91177308-0d34-0410-b5e6-96231b3b80d8
a5cf92d
Jordy Rose [analyzer] Clean up unused bits of CFRefCount.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138390 91177308-0d34-0410-b5e6-96231b3b80d8
6886a92
Refactor and fix checking for initialization of flexible array member…
…s. The old version had the checks scattered across the code, missed some checks, and had a couple nasty bugs in existing checks.

Fixes PR10648 and another similar accepts-invalid bug.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138398 91177308-0d34-0410-b5e6-96231b3b80d8
f40fd6b
Whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138404 91177308-0d34-0410-b5e6-96231b3b80d8
e1f5490
Revert "[analyzer] Clean up unused bits of CFRefCount."
This reverts commit 6886a92.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138405 91177308-0d34-0410-b5e6-96231b3b80d8
b1793a0
Ted Kremenek Add 'const' version of CompoundStmt::children().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138407 91177308-0d34-0410-b5e6-96231b3b80d8
8ed5579
Ted Kremenek Constify the result of CFGStmt::getStmt().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138408 91177308-0d34-0410-b5e6-96231b3b80d8
f1d10d9
Ted Kremenek CFG: record set of C++ 'try' dispatch blocks, which could be of inter…
…est to various analyses (e.g., reachability).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138409 91177308-0d34-0410-b5e6-96231b3b80d8
f0e71ae
Ted Kremenek Start reworking -Wunreachable-code. The original analysis had serious…
… flaws with how it

handled SCC's of dead code, or simply having false negatives by overly suppressing warnings.

WIP.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138410 91177308-0d34-0410-b5e6-96231b3b80d8
0f3b4ca
bcardosolopes Fix _mm256_shuffle_ps mask! Example, for mask=203, Instead of:
  <i32 3, i32 2, i32 8, i32 11, i32 3, i32 6, i32 12, i32 15>
generate:
  <i32 3, i32 2, i32 8, i32 11, i32 7, i32 6, i32 12, i32 15>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138411 91177308-0d34-0410-b5e6-96231b3b80d8
426344d
objc - fix up the builtin type for objc_assign_ivar.
// rdar://9362887.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138412 91177308-0d34-0410-b5e6-96231b3b80d8
cc075e4
Whitespace and 80-col cleanup.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138413 91177308-0d34-0410-b5e6-96231b3b80d8
c6fad60
Move creation of the deallocation mismatch report into a separate fun…
…ction for future reuse.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138414 91177308-0d34-0410-b5e6-96231b3b80d8
dd6060e
[analyzer] MacOSKeychainAPIChecker: Retrieve the memory region which …
…we are tracking even when it's no longer a SymbolicRegion, for example, when it is cast to char*.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138415 91177308-0d34-0410-b5e6-96231b3b80d8
31e1028
Aug 24, 2011
[analyzer] MacOSKeychainAPIChecker: Add reasoning about functions whi…
…ch MIGHT deallocate the memory region allocated with SecKeychain APIs. Specifically, when the buffer is passed to CFStringCreateWithBytesNoCopy along with a custom deallocator, which might potentially correctly release the memory.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138417 91177308-0d34-0410-b5e6-96231b3b80d8
6cf0ed0
Make constant aggregate constant initializers private linkage.
After talking with John making this the case for all of these is
the right way to go.

Fixes rdar://9804564 and PR10414

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138418 91177308-0d34-0410-b5e6-96231b3b80d8
736a9c2
Revert "[analyzer] Make CFRefBug and CFRefReportVisitor not dependent…
… on CFRefCount. Unfortunately, CFRefReport still is. No functionality change."

This reverts commit e3fb7e4.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138419 91177308-0d34-0410-b5e6-96231b3b80d8
f21e2b4
Revert "[analyzer] Cleanup: Move temporary declarations of CFRefCount…
… variables closer to their uses. No functionality change."

This reverts commit d02b4af.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138420 91177308-0d34-0410-b5e6-96231b3b80d8
f2be652
bcardosolopes Add testcase for r138411
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138422 91177308-0d34-0410-b5e6-96231b3b80d8
3f7eb9a
Jordy Rose [analyzer] Correctly initialize a variable and hopefully fix crashes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138424 91177308-0d34-0410-b5e6-96231b3b80d8
5337612
Jordy Rose [analyzer] Reapply 138382 and 138388 (reverted in 138419 and 138420).…
… The issue seems to have been with the uninitialized variable fixed in 138424; a fix for another Heisencrasher coming soon.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138426 91177308-0d34-0410-b5e6-96231b3b80d8
35c8695
Jordy Rose [analyzer] Fix potential crasher with RAII. No functionality change. …
…(No test because this particular circumstance requires an impossible series of events, but this is future-proofing.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138430 91177308-0d34-0410-b5e6-96231b3b80d8
0fe62f8
Jordy Rose [analyzer] Reapply 138390 "Clean up unused bits of CFRefCount", rever…
…ted in 138405. Ended up unrelated to any problems.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138431 91177308-0d34-0410-b5e6-96231b3b80d8
1bb094f
Jordy Rose [analyzer] Fix a Heisenbug concerning object lifetimes with a hack. H…
…opefully a better fix coming soon. See comment for more details.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138432 91177308-0d34-0410-b5e6-96231b3b80d8
1ab51c7
karies Reset FirstID (first diagnostic's file ID) to allow for invocations o…
…f the VerifyDiagnosticsClient on several input files.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138434 91177308-0d34-0410-b5e6-96231b3b80d8
84c05e3
Match LLVM change: TargetRegistry and TargetSelect have been moved to…
… Support.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138451 91177308-0d34-0410-b5e6-96231b3b80d8
a6b4045
Thread safety: Fix a few typos in last commit -- use LockID instead o…
…f Lock in comments and start a couple methods with a lowercase letter

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138460 91177308-0d34-0410-b5e6-96231b3b80d8
940b97f
Jordy Rose [analyzer] Slightly clean up the fix in 138432, so that it doesn't de…
…pend on the relative ordering of path-sensitive and path-insensitive checks. Still not ideal, but I think a real fix would require infrastructure that doesn't exist yet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138462 91177308-0d34-0410-b5e6-96231b3b80d8
9c083b7
In the AST reader, switch name lookup within a DeclContect over to the
module DAG-based lookup scheme. This required some reshuffling, so
that each module stores its own mapping from DeclContexts to their
lexical and visible sets for those DeclContexts (rather than one big
"chain"). 

Overall, this allows simple qualified name lookup into the translation
unit to gather results from multiple modules, with the lookup results
in module B shadowing the lookup results in module A when B imports A.

Walking all of the lexical declarations in a module DAG is still a
mess; we'll end up walking the loaded module list backwards, which
works fine for chained PCH but doesn't make sense in a DAG. I'll
tackle this issue as a separate commit.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138463 91177308-0d34-0410-b5e6-96231b3b80d8
0d95f77
Jordy Rose [analyzer] Remove unused DoNothingByRef and the special case for CFDi…
…ctionaryCreate.

This is a very small regression (actually introduced in r138309) because it won't catch leaks of objects passed by reference to CFDictionaryCreate (they're considered to have escaped and are ignored). If this is important we can put in a specific eval::Call to restore the functionality.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138464 91177308-0d34-0410-b5e6-96231b3b80d8
bd85b13
Add PNaCl TargetInfo.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138470 91177308-0d34-0410-b5e6-96231b3b80d8
ef05abd
[analyzer] Allow checker writes to specify that no region should be a…
…ccosiated with the report. (Useful when we report an error on endOfPath or deadSymbols, when the range of the last expression might have nothing to do with the error.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138474 91177308-0d34-0410-b5e6-96231b3b80d8
1492426
Argyrios Kyrtzidis Silence 'may be used uninitialized' warnings.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138475 91177308-0d34-0410-b5e6-96231b3b80d8
c4b5582
Jordy Rose [analyzer] Copy GC mode setting from CFRefCount to RetainReleaseCheck…
…er in preparation for getting rid of CFRefCount.

This is a little hacky for now but will get better once we decide the best way to handle this.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138476 91177308-0d34-0410-b5e6-96231b3b80d8
0a61437
Jordy Rose [analyzer] Silence an (incorrect) uninitialized variable warning, cau…
…ght by Cameron.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138477 91177308-0d34-0410-b5e6-96231b3b80d8
f95b19d
[analyzer] MacOSKeychainAPIChecker: Provide reacher diagnostic trace …
…by pointing to the allocation site when reporting a leak.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138479 91177308-0d34-0410-b5e6-96231b3b80d8
9840111
Follow up to r138470 (Add PNaCl TargetInfo). I've occasionally submit…
…ted wrong patch.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138489 91177308-0d34-0410-b5e6-96231b3b80d8
bba43ef
Introduce a depth-first search of modules into the module manager,
which supports both pre-order and post-order traversal via a visitor
mechanism. Use this depth-first search with a post-order traversal to
give predictable ordering semantics when walking all of the lexical
declarations in the translation unit.

Eventually, module imports will occur in the source code rather than
at the beginning, and we'll have to revisit this walk.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138490 91177308-0d34-0410-b5e6-96231b3b80d8
851c75a
[analyzer] Unbreak the release buildbot.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138493 91177308-0d34-0410-b5e6-96231b3b80d8
e94cb98
Don't force the complete deserialization of the visible-declarations
table when serializing an AST file. This was a holdover from the days
before chained PCH, and is a complete waste of time and storage
now. It's a good thing it's useless, because I have no idea how I
would have implemented MaterializeVisibleDecls efficiently in the
presence of modules.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138496 91177308-0d34-0410-b5e6-96231b3b80d8
c266de9
[analyzer] Do not use references in std::pair.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138497 91177308-0d34-0410-b5e6-96231b3b80d8
5eb7d82
Remove long-dead FIXME
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138498 91177308-0d34-0410-b5e6-96231b3b80d8
203ba05
Jordy Rose [analyzer] CFRefReport and friends no longer depend on CFRefCount.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138506 91177308-0d34-0410-b5e6-96231b3b80d8
2058956
Jordy Rose [analyzer] Remove experimental FIXME that never actually applied to t…
…he code in trunk.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138508 91177308-0d34-0410-b5e6-96231b3b80d8
4f227aa
Jordy Rose [analyzer] Silence another incorrect warning ("control reaches end of…
… non-void function")

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138510 91177308-0d34-0410-b5e6-96231b3b80d8
359bd07
Jordy Rose [analyzer] Better fix for the "missing return" error, from Ted.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138526 91177308-0d34-0410-b5e6-96231b3b80d8
c318659
Aug 25, 2011
blocks - capturing logic of byref block variable's expression
statement initializer makes safe assumption when a substatement 
is encounterred (with a fix me).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138528 91177308-0d34-0410-b5e6-96231b3b80d8
045c842
Jordy Rose [analyzer] Move the RetainSummaryManager from CFRefCount to RetainRel…
…easeChecker.

Because Checkers live for an entire translation unit, this persists summary caches across multiple code bodies and avoids repeated initialization (but probably at the cost of memory). This removes the last references from RetainReleaseChecker to CFRefCount.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138529 91177308-0d34-0410-b5e6-96231b3b80d8
b6cfc09
[analyzer] MacOSKeychainAPIChecker: Add the custom BugReport visitor(…
…which highlights the allocation site) to all the relevant reports within the checker.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138531 91177308-0d34-0410-b5e6-96231b3b80d8
6b7aad9
Jordy Rose [analyzer] Move the easy bug types from CFRefCount to RetainReleaseCh…
…ecker.

(These bug types may have just been leaked before...!)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138532 91177308-0d34-0410-b5e6-96231b3b80d8
d6334e1
Francois Pichet Add support for Microsoft __ptr32 keyword.
Patch by Chris Cudmore!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138533 91177308-0d34-0410-b5e6-96231b3b80d8
58fd97a
[analyzer] MacOSKeychainAPIChecker: Cleanup AllocationState structure.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138535 91177308-0d34-0410-b5e6-96231b3b80d8
eacd2b4
Jordy Rose [analyzer] Move the leak bugs from CFRefCount to RetainReleaseChecker…
…, with a level of indirection to handle GC vs. non-GC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138538 91177308-0d34-0410-b5e6-96231b3b80d8
db92bb6
Use the module manager's search facility to look for methods with a
given selector, rather than walking the chain backwards. Teach its
visitor how to merge multiple result sets into a single result set,
combining the results of selector lookup in several different modules
into a single result set.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138556 91177308-0d34-0410-b5e6-96231b3b80d8
3d15ab8
Remove a bogus assertion from the AST reader, which assumed that
redeclarations of a particular entity would occur in source
order. Friend declarations that occur within class templates (or
member classes thereof) do not follow this, nor would modules. Big
thanks to Erik Verbruggen for reducing this problem from the Very
Large Qt preamble testcase he found.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138557 91177308-0d34-0410-b5e6-96231b3b80d8
1b59e9c
[driver] Do not add -kext to the link command line when compiling with
-fapple-kext.
Fixes <rdar://problem/10013310>. Reverts <rdar://problem/7809940>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138564 91177308-0d34-0410-b5e6-96231b3b80d8
fab83b5
objc -arse: Use DeclGroup for forward class declarations;
as in @class foo, bar. More cleanup to follow.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138567 91177308-0d34-0410-b5e6-96231b3b80d8
d8e987b
Fixes a typo in my last patch.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138571 91177308-0d34-0410-b5e6-96231b3b80d8
90dedc8
Switch the forward walk through the module chain over to a depth-first
search in ASTReader::ReadPreprocessedEntities().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138572 91177308-0d34-0410-b5e6-96231b3b80d8
b95cd09
Switch ASTReader::GetHeaderFileInfo() from a walk over the module
chain to a proper search.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138574 91177308-0d34-0410-b5e6-96231b3b80d8
d10a381
Ted Kremenek Teach -Wunreachable-code about dead code caused by macro expansions. …
…This should suppress false positives resulting from 'assert' and friends.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138576 91177308-0d34-0410-b5e6-96231b3b80d8
e7a2764
jpbonn Merge branch 'master' of http://llvm.org/git/clang d6a3f34