]> granicus.if.org Git - clang/log
clang
13 years agorename test
Chris Lattner [Fri, 18 Feb 2011 02:05:32 +0000 (02:05 +0000)]
rename test

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

13 years agoHandle UsingDecl in CFGRecStmtDeclVisitor.
Argyrios Kyrtzidis [Fri, 18 Feb 2011 01:44:17 +0000 (01:44 +0000)]
Handle UsingDecl in CFGRecStmtDeclVisitor.

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

13 years agoSwitch labels over to using normal name lookup, instead of their
Chris Lattner [Fri, 18 Feb 2011 01:27:55 +0000 (01:27 +0000)]
Switch labels over to using normal name lookup, instead of their
own weird little DenseMap.  Hey look, we now emit unused label
warnings deterministically, amazing.

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

13 years agoUnbreak the MSVC build
Francois Pichet [Fri, 18 Feb 2011 01:25:16 +0000 (01:25 +0000)]
Unbreak the MSVC build
std::make_pair is unreliable under MSVC 2010.

Ref: http://stackoverflow.com/questions/2691680/why-does-visual-studio-2010-throw-this-error-with-boost-1-42-0

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

13 years agobreak testcase over multiple lines to make it easier to read.
Chris Lattner [Fri, 18 Feb 2011 01:25:14 +0000 (01:25 +0000)]
break testcase over multiple lines to make it easier to read.

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

13 years agohandle labeldecls.
Chris Lattner [Fri, 18 Feb 2011 00:52:55 +0000 (00:52 +0000)]
handle labeldecls.

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

13 years agomake block bodies handle undefined labels just like functions.
Chris Lattner [Thu, 17 Feb 2011 23:58:47 +0000 (23:58 +0000)]
make block bodies handle undefined labels just like functions.

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

13 years agoimprove support for big endian targets, fixing PR8171, patch
Chris Lattner [Thu, 17 Feb 2011 22:09:58 +0000 (22:09 +0000)]
improve support for big endian targets, fixing PR8171, patch
by Heikki Kultala!

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

13 years agoCMake: updated source file list.
Oscar Fuentes [Thu, 17 Feb 2011 22:07:39 +0000 (22:07 +0000)]
CMake: updated source file list.

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

13 years agoAdd -Warray-bounds test showing how the warning currently interoperates with macros.
Ted Kremenek [Thu, 17 Feb 2011 21:40:51 +0000 (21:40 +0000)]
Add -Warray-bounds test showing how the warning currently interoperates with macros.

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

13 years ago[analyzer] Use the new registration mechanism for the debugging info "checks".
Argyrios Kyrtzidis [Thu, 17 Feb 2011 21:39:39 +0000 (21:39 +0000)]
[analyzer] Use the new registration mechanism for the debugging info "checks".

The relative checker package is 'debug':

'-dump-live-variables' is replaced by '-analyzer-checker=debug.DumpLiveVars'
'-cfg-view' is replaced by '-analyzer-checker=debug.ViewCFG'
'-cfg-dump' is replaced by '-analyzer-checker=debug.DumpCFG'

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

13 years ago[analyzer] Use the new registration mechanism on the non-path-sensitive-checkers:
Argyrios Kyrtzidis [Thu, 17 Feb 2011 21:39:33 +0000 (21:39 +0000)]
[analyzer] Use the new registration mechanism on the non-path-sensitive-checkers:

  DeadStoresChecker
  ObjCMethSigsChecker
  ObjCUnusedIvarsChecker
  SizeofPointerChecker
  ObjCDeallocChecker
  SecuritySyntaxChecker

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

13 years ago[analyzer]
Argyrios Kyrtzidis [Thu, 17 Feb 2011 21:39:24 +0000 (21:39 +0000)]
[analyzer]
-Introduce CheckerV2, a set of templates for convenient declaration & registration of checkers.
 Currently useful just for checkers working on the AST not the path-sensitive ones.
-Enhance CheckerManager to actually collect the checkers and turn it into the entry point for
 running the checkers.
-Use the new mechanism for the LLVMConventionsChecker.

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

13 years ago[analyzer] Pass CheckerManager to the registration functions.
Argyrios Kyrtzidis [Thu, 17 Feb 2011 21:39:17 +0000 (21:39 +0000)]
[analyzer] Pass CheckerManager to the registration functions.

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

13 years agoEnhance the array bounds checking to work for several other constructs,
Chandler Carruth [Thu, 17 Feb 2011 21:10:52 +0000 (21:10 +0000)]
Enhance the array bounds checking to work for several other constructs,
especially C++ code, and generally expand the test coverage.

Logic adapted from a patch by Kaelyn Uhrain <rikka@google.com> and
another Googler.

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

13 years agoClean up the style of this function to match the conventions in the rest
Chandler Carruth [Thu, 17 Feb 2011 20:55:08 +0000 (20:55 +0000)]
Clean up the style of this function to match the conventions in the rest
of Clang, and reflows the code a bit to make it easier to read.

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

13 years agoadd a fixme
Chris Lattner [Thu, 17 Feb 2011 20:54:00 +0000 (20:54 +0000)]
add a fixme

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

13 years agoStep #2/N of __label__ support: keep pushing LabelDecl forward,
Chris Lattner [Thu, 17 Feb 2011 20:34:02 +0000 (20:34 +0000)]
Step #2/N of __label__ support: keep pushing LabelDecl forward,
making them be template instantiated in a more normal way and
make them handle attributes like other decls.

This fixes the used/unused label handling stuff, making it use
the same infrastructure as other decls.

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

13 years agoInline LocalInstantiationScope::getInstantiationOf into its one
Chris Lattner [Thu, 17 Feb 2011 19:47:42 +0000 (19:47 +0000)]
Inline LocalInstantiationScope::getInstantiationOf into its one
client, making room for future hacking.

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

13 years agoremove some defensive code: LocalInstantiationScope::getInstantiationOf
Chris Lattner [Thu, 17 Feb 2011 19:38:27 +0000 (19:38 +0000)]
remove some defensive code: LocalInstantiationScope::getInstantiationOf
and findInstantiationOf can never return null, even on invalid code.

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

13 years agoremove some dead overloads.
Chris Lattner [Thu, 17 Feb 2011 19:37:28 +0000 (19:37 +0000)]
remove some dead overloads.

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

13 years agoEliminate the internal command-line option for viewing inheritance in C++ classes...
Douglas Gregor [Thu, 17 Feb 2011 19:04:40 +0000 (19:04 +0000)]
Eliminate the internal command-line option for viewing inheritance in C++ classes, since it's only really worked for the trivial cases anyway due to lame pseudo-parsing of the class name. The viewInheritance() function is still available for use in the debugger, where this is far more useful

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

13 years agoRemove the "conditional save" hashtables from IR generation.
John McCall [Thu, 17 Feb 2011 19:02:56 +0000 (19:02 +0000)]
Remove the "conditional save" hashtables from IR generation.

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

13 years agoThe internal -fdump-record-layouts flag already dumps the layout when it was computed...
Douglas Gregor [Thu, 17 Feb 2011 18:59:06 +0000 (18:59 +0000)]
The internal -fdump-record-layouts flag already dumps the layout when it was computed; no need to do so again at the end of the translation unit

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

13 years agoWhen building StaticAnalyzer/Frontend add -I "<Checkers build dir>" to allow Checkers...
Argyrios Kyrtzidis [Thu, 17 Feb 2011 18:40:33 +0000 (18:40 +0000)]
When building StaticAnalyzer/Frontend add -I "<Checkers build dir>" to allow Checkers.inc to be
included without '..', thus being compatible with build systems of *BSDs.

Patch by Joerg Sonnenberger!

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

13 years agoReplace a FIXME with a comment describing why we did what we did
Douglas Gregor [Thu, 17 Feb 2011 18:32:37 +0000 (18:32 +0000)]
Replace a FIXME with a comment describing why we did what we did

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

13 years agoRemove the last virtual member function from the Decl hierarchy,
Douglas Gregor [Thu, 17 Feb 2011 18:14:32 +0000 (18:14 +0000)]
Remove the last virtual member function from the Decl hierarchy,
reducing the size of all declarations by one pointer. For a 64-bit
Clang parsing Cocoa.h, this saves ~630k of memory (about 3.5% of
ASTContext's memory usage for this header).

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

13 years agoDevirtualize TagDecl::completeDefinition().
Douglas Gregor [Thu, 17 Feb 2011 18:06:05 +0000 (18:06 +0000)]
Devirtualize TagDecl::completeDefinition().

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

13 years agoDevirtualize DeclaratorDecl::getInnerLocStart() and TagDecl::getInnerLocStart().
Douglas Gregor [Thu, 17 Feb 2011 17:39:40 +0000 (17:39 +0000)]
Devirtualize DeclaratorDecl::getInnerLocStart() and TagDecl::getInnerLocStart().

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

13 years agoImprove diagnostics on missing property decl.
Fariborz Jahanian [Thu, 17 Feb 2011 17:30:05 +0000 (17:30 +0000)]
Improve diagnostics on missing property decl.

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

13 years agoDevirtualize NamedDecl::getNameForDiagnostic().
Douglas Gregor [Thu, 17 Feb 2011 17:23:19 +0000 (17:23 +0000)]
Devirtualize NamedDecl::getNameForDiagnostic().

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

13 years agoDevirtualize RedeclarableTemplateDecl::newCommon().
Douglas Gregor [Thu, 17 Feb 2011 17:10:20 +0000 (17:10 +0000)]
Devirtualize RedeclarableTemplateDecl::newCommon().

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

13 years agoImplement a sub-group of -Wconversion: -Wliteral-conversion. This
Chandler Carruth [Thu, 17 Feb 2011 11:05:49 +0000 (11:05 +0000)]
Implement a sub-group of -Wconversion: -Wliteral-conversion. This
specifically targets literals which are implicitly converted, a those
are more often unintended and trivial to fix. This can be especially
helpful for diagnosing what makes 'const int x = 1e6' not an ICE.

Original patch authored by Jim Meehan with contributions from other
Googlers and a few cleanups from myself.

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

13 years agoChange the representation of GNU ?: expressions to use a different expression
John McCall [Thu, 17 Feb 2011 10:25:35 +0000 (10:25 +0000)]
Change the representation of GNU ?: expressions to use a different expression
class and to bind the shared value using OpaqueValueExpr.  This fixes an
unnoticed problem with deserialization of these expressions where the
deserialized form would lose the vital pointer-equality trait;  or rather,
it fixes it because this patch also does the right thing for deserializing
OVEs.

Change OVEs to not be a "temporary object" in the sense that copy elision is
permitted.

This new representation is not totally unawkward to work with, but I think
that's really part and parcel with the semantics we're modelling here.  In
particular, it's much easier to fix things like the copy elision bug and to
make the CFG look right.

I've tried to update the analyzer to deal with this in at least some
obvious cases, and I think we get a much better CFG out, but the printing
of OpaqueValueExprs probably needs some work.

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

13 years agolib/Frontend/InitHeaderSearch.cpp: Add mingw-w64's include paths.
NAKAMURA Takumi [Thu, 17 Feb 2011 08:51:47 +0000 (08:51 +0000)]
lib/Frontend/InitHeaderSearch.cpp: Add mingw-w64's include paths.

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

13 years agoTriple::MinGW64 is deprecated and removed. We can use Triple::MinGW32 instead.
NAKAMURA Takumi [Thu, 17 Feb 2011 08:51:38 +0000 (08:51 +0000)]
Triple::MinGW64 is deprecated and removed. We can use Triple::MinGW32 instead.

No one uses *-mingw64. mingw-w64 is represented as {i686|x86_64}-w64-mingw32.

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

13 years agoFix whitespace.
NAKAMURA Takumi [Thu, 17 Feb 2011 08:50:50 +0000 (08:50 +0000)]
Fix whitespace.

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

13 years agoDevirtualize Decl::getNextRedeclaration().
Douglas Gregor [Thu, 17 Feb 2011 08:47:29 +0000 (08:47 +0000)]
Devirtualize Decl::getNextRedeclaration().

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

13 years agoImplement -Wenum-compare, which warns when comparing two enums of
Chandler Carruth [Thu, 17 Feb 2011 08:37:06 +0000 (08:37 +0000)]
Implement -Wenum-compare, which warns when comparing two enums of
different types. We omit the warning when the enum types are anonymous.
Unlike GCC, this warning does not distinguish between C++ and C/ObjC for
controling whether it is on by default, it is always on by default.

Original patch contributed by Richard Trieu (@ Google), I fixed some
style issues, and cleaned it up for submission.

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

13 years agoSimple little optimization to Decl::getCanonicalDecl(), eliminating some heavyweight...
Douglas Gregor [Thu, 17 Feb 2011 08:14:56 +0000 (08:14 +0000)]
Simple little optimization to Decl::getCanonicalDecl(), eliminating some heavyweight machinery and indirection that we don't need

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

13 years agoDevirtualize Decl::getSourceRange()
Douglas Gregor [Thu, 17 Feb 2011 08:12:32 +0000 (08:12 +0000)]
Devirtualize Decl::getSourceRange()

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

13 years agoDevirtualize Decl::getCanonicalDecl().
Douglas Gregor [Thu, 17 Feb 2011 07:58:36 +0000 (07:58 +0000)]
Devirtualize Decl::getCanonicalDecl().

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

13 years agoStep #1/N of implementing support for __label__: split labels into
Chris Lattner [Thu, 17 Feb 2011 07:39:24 +0000 (07:39 +0000)]
Step #1/N of implementing support for __label__: split labels into
LabelDecl and LabelStmt.  There is a 1-1 correspondence between the
two, but this simplifies a bunch of code by itself.  This is because
labels are the only place where we previously had references to random
other statements, causing grief for AST serialization and other stuff.

This does cause one regression (attr(unused) doesn't silence unused
label warnings) which I'll address next.

This does fix some minor bugs:
1. "The only valid attribute " diagnostic was capitalized.
2. Various diagnostics printed as ''labelname'' instead of 'labelname'
3. This reduces duplication of label checking between functions and blocks.

Review appreciated, particularly for the cindex and template bits.

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

13 years agoDevirtualize Decl::getBody() and Decl::hasBody().
Douglas Gregor [Thu, 17 Feb 2011 07:13:24 +0000 (07:13 +0000)]
Devirtualize Decl::getBody() and Decl::hasBody().

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

13 years agoDe-virtualize Decl::isOutOfLine().
Douglas Gregor [Thu, 17 Feb 2011 07:02:32 +0000 (07:02 +0000)]
De-virtualize Decl::isOutOfLine().

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

13 years agoWhen printing a qualified type, look through a substituted template
Douglas Gregor [Thu, 17 Feb 2011 06:52:25 +0000 (06:52 +0000)]
When printing a qualified type, look through a substituted template
parameter type to see what's behind it, so that we don't end up
printing silly things like "float const *" when "const float *" would
make more sense. Also, replace the pile of "isa" tests with a simple
switch enumerating all of the cases, making a few more obvious cases
use prefix qualifiers.

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

13 years agosimplify a bit.
Chris Lattner [Thu, 17 Feb 2011 05:38:27 +0000 (05:38 +0000)]
simplify a bit.

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

13 years agotidy up
Chris Lattner [Thu, 17 Feb 2011 05:19:40 +0000 (05:19 +0000)]
tidy up

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

13 years agoImprove parser recovery in "for" statements, from Richard Smith!
Douglas Gregor [Thu, 17 Feb 2011 03:38:46 +0000 (03:38 +0000)]
Improve parser recovery in "for" statements, from Richard Smith!

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

13 years agoI will not hold on to temporary StringRefs.
Douglas Gregor [Thu, 17 Feb 2011 03:19:26 +0000 (03:19 +0000)]
I will not hold on to temporary StringRefs.
I will not hold on to temporary StringRefs.
I will not hold on to temporary StringRefs.
I will not hold on to temporary StringRefs.
I will not hold on to temporary StringRefs.
I will not hold on to temporary StringRefs.
I will not hold on to temporary StringRefs.
I will not hold on to temporary StringRefs.
I will not hold on to temporary StringRefs.
I will not hold on to temporary StringRefs.
I will not hold on to temporary StringRefs.

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

13 years agoWhen Parser::ParseExpressionList isn't given a completer, fall back to
Douglas Gregor [Thu, 17 Feb 2011 03:09:23 +0000 (03:09 +0000)]
When Parser::ParseExpressionList isn't given a completer, fall back to
normal "expression" completion. Fixes the most annoying
code-completion bug I've found.

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

13 years agoFix PR9025 and add a diagnostic (and sometimes a fixit) for an overloaded
Matt Beaumont-Gay [Thu, 17 Feb 2011 02:54:17 +0000 (02:54 +0000)]
Fix PR9025 and add a diagnostic (and sometimes a fixit) for an overloaded
function name used as the base of a member expression. Early feedback from
Chandler Carruth, and code review from Nick Lewycky.

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

13 years agoBump up IdentifierInfo::ObjCOrBuiltinID to use 11 bits instead of 10. Fixes PR 9231.
Ted Kremenek [Thu, 17 Feb 2011 02:43:00 +0000 (02:43 +0000)]
Bump up IdentifierInfo::ObjCOrBuiltinID to use 11 bits instead of 10.  Fixes PR 9231.

Apparently we can blow out the number of builtin IDs on FreeBSD with only 10 bits.

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

13 years agoBegin overhaul of scan-build/ccc-analyzer's handling of checker options.
Ted Kremenek [Thu, 17 Feb 2011 02:28:30 +0000 (02:28 +0000)]
Begin overhaul of scan-build/ccc-analyzer's handling of checker options.

We now rely on 'clang --analyze' to provide the default set of checkers.  We're
still working on the new '-analyzer-checker <checker>' interface, and once
that's ready we'll wire it up to scan-build.

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

13 years agoDisable default synthesized properties until we can properly re-evaluate the feature.
Ted Kremenek [Thu, 17 Feb 2011 02:17:56 +0000 (02:17 +0000)]
Disable default synthesized properties until we can properly re-evaluate the feature.

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

13 years agofix clang -MM output to escape spaces in filenames. This seems to be
Chris Lattner [Thu, 17 Feb 2011 02:14:49 +0000 (02:14 +0000)]
fix clang -MM output to escape spaces in filenames.  This seems to be
the only character that GCC escapes.  PR9224.

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

13 years agoupdate this test now that reassociate isn't stripping nsw's pointlessly.
Chris Lattner [Thu, 17 Feb 2011 02:02:42 +0000 (02:02 +0000)]
update this test now that reassociate isn't stripping nsw's pointlessly.

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

13 years agoConvert MaxFieldAlignment to CharUnits from bits. No change in functionality
Ken Dyck [Thu, 17 Feb 2011 01:49:42 +0000 (01:49 +0000)]
Convert MaxFieldAlignment to CharUnits from bits. No change in functionality
intended.

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

13 years agoImprove diagnostics when property names an object type of
Fariborz Jahanian [Thu, 17 Feb 2011 01:26:14 +0000 (01:26 +0000)]
Improve diagnostics when property names an object type of
a forward class. // rdar://8851803

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

13 years agoImplement code completion results for the Objective-C Key-Value Coding
Douglas Gregor [Thu, 17 Feb 2011 00:22:45 +0000 (00:22 +0000)]
Implement code completion results for the Objective-C Key-Value Coding
(KVC) and Key-Value Observing (KVO) protocols.

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

13 years agoEnsure that the NRVO flag has some block to insert into. Fixes PR9178!
Nick Lewycky [Wed, 16 Feb 2011 23:59:08 +0000 (23:59 +0000)]
Ensure that the NRVO flag has some block to insert into. Fixes PR9178!

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

13 years agoFix assertion failure in -Warray-bounds on template parameters used as arrays.
Ted Kremenek [Wed, 16 Feb 2011 23:39:09 +0000 (23:39 +0000)]
Fix assertion failure in -Warray-bounds on template parameters used as arrays.

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

13 years agoBlock rewriting bug. Don't take address of captured
Fariborz Jahanian [Wed, 16 Feb 2011 22:37:10 +0000 (22:37 +0000)]
Block rewriting bug. Don't take address of captured
byref variables again when passing them to inner blocks.
// rdar://9006279

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

13 years agoPlacate Doug and change capitalization of diagnostic note.
Ted Kremenek [Wed, 16 Feb 2011 22:08:28 +0000 (22:08 +0000)]
Placate Doug and change capitalization of diagnostic note.

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

13 years agoMakes most methods in SVals.h conform to the naming guide. Reviewed
Zhanyong Wan [Wed, 16 Feb 2011 21:13:32 +0000 (21:13 +0000)]
Makes most methods in SVals.h conform to the naming guide.  Reviewed
by kremenek.

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

13 years ago3000 Sema diagnostics should be enough for anyone.
Chandler Carruth [Wed, 16 Feb 2011 19:41:58 +0000 (19:41 +0000)]
3000 Sema diagnostics should be enough for anyone.

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

13 years agoFix a thinko with llvm::Optional, which is clearly the most dangerous class template...
Douglas Gregor [Wed, 16 Feb 2011 19:09:24 +0000 (19:09 +0000)]
Fix a thinko with llvm::Optional, which is clearly the most dangerous class template in the universe

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

13 years agoTeach the CXCodeCompleteResults results structure, which stores
Douglas Gregor [Wed, 16 Feb 2011 19:08:06 +0000 (19:08 +0000)]
Teach the CXCodeCompleteResults results structure, which stores
code-completion results accessed via libclang, to extend the lifetime
of the allocator used for cached global code-completion results at
least until these completion results are destroyed. Fixes
<rdar://problem/8997369>.

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

13 years agoIf preprocessed token introduced empty filename then use main translation unit's...
Devang Patel [Wed, 16 Feb 2011 18:40:36 +0000 (18:40 +0000)]
If preprocessed token introduced empty filename then use main translation unit's filename for debug info entries.

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

13 years agoImprove the invalidation logic for the cache of global code
Douglas Gregor [Wed, 16 Feb 2011 18:16:54 +0000 (18:16 +0000)]
Improve the invalidation logic for the cache of global code
completions. We now compute a hash of the names of all top-level
declarations and macro definitions, and invalidate the cache when the
hash value changes.

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

13 years agoTeach PPChainedCallbacks to forward the InclusionDirective() callback.
Douglas Gregor [Wed, 16 Feb 2011 18:15:35 +0000 (18:15 +0000)]
Teach PPChainedCallbacks to forward the InclusionDirective() callback.

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

13 years agoWarning -> ExtWarn
Argyrios Kyrtzidis [Wed, 16 Feb 2011 16:23:31 +0000 (16:23 +0000)]
Warning -> ExtWarn

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

13 years agoRemove this FIXME; clear up an unused variable; style.
John McCall [Wed, 16 Feb 2011 08:39:19 +0000 (08:39 +0000)]
Remove this FIXME;  clear up an unused variable;  style.

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

13 years agoSave a copy expression for non-trivial copy constructions of catch variables.
John McCall [Wed, 16 Feb 2011 08:02:54 +0000 (08:02 +0000)]
Save a copy expression for non-trivial copy constructions of catch variables.

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

13 years agoAdds a CMake target for the Basic lib's unit tests. Reviewed by
Zhanyong Wan [Wed, 16 Feb 2011 05:45:20 +0000 (05:45 +0000)]
Adds a CMake target for the Basic lib's unit tests.  Reviewed by
jyasskin and chapuni.

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

13 years agoImproves CMakeLists.txt for Clang's unit tests: make "linked
Zhanyong Wan [Wed, 16 Feb 2011 05:19:17 +0000 (05:19 +0000)]
Improves CMakeLists.txt for Clang's unit tests: make "linked
components" and "used libs" arguments of add_clang_unittest().
Reviewed by jyasskin and chapuni.

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

13 years agoTweak -Warray-bounds diagnostics based on feedback from Chandler.
Ted Kremenek [Wed, 16 Feb 2011 04:01:44 +0000 (04:01 +0000)]
Tweak -Warray-bounds diagnostics based on feedback from Chandler.

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

13 years agoCMake: Tweak for Visual Studio 10 quirk at clang-standalone build.
NAKAMURA Takumi [Wed, 16 Feb 2011 03:07:15 +0000 (03:07 +0000)]
CMake: Tweak for Visual Studio 10 quirk at clang-standalone build.

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

13 years agotest/CMakeLists.txt: Don't depend on llvm toolchain at clang-standalone build.
NAKAMURA Takumi [Wed, 16 Feb 2011 03:07:10 +0000 (03:07 +0000)]
test/CMakeLists.txt: Don't depend on llvm toolchain at clang-standalone build.

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

13 years agoRevert r125642. This broke the build? It should be a no-op.
Nick Lewycky [Wed, 16 Feb 2011 02:34:28 +0000 (02:34 +0000)]
Revert r125642. This broke the build? It should be a no-op.

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

13 years agotest/PCH/headersearch.cpp fails on Win32. Not trivial to fix.
Francois Pichet [Wed, 16 Feb 2011 02:29:43 +0000 (02:29 +0000)]
test/PCH/headersearch.cpp fails on Win32. Not trivial to fix.

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

13 years agoConvert the UnpackedAlignment field to CharUnits from bits. No change in
Ken Dyck [Wed, 16 Feb 2011 02:11:31 +0000 (02:11 +0000)]
Convert the UnpackedAlignment field to CharUnits from bits. No change in
functionality intended.

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

13 years agoDon't use "../foo" to return to the current directory.
Nick Lewycky [Wed, 16 Feb 2011 02:10:49 +0000 (02:10 +0000)]
Don't use "../foo" to return to the current directory.

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

13 years agoConvert Alignment member to CharUnits from bits. No change in functionality
Ken Dyck [Wed, 16 Feb 2011 02:05:21 +0000 (02:05 +0000)]
Convert Alignment member to CharUnits from bits. No change in functionality
intended.

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

13 years agoAdd trivial buffer overflow checking in Sema.
Ted Kremenek [Wed, 16 Feb 2011 01:57:07 +0000 (01:57 +0000)]
Add trivial buffer overflow checking in Sema.

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

13 years agoConvert NonVirtualSize to CharUnits from bits. No change in functionality
Ken Dyck [Wed, 16 Feb 2011 01:52:01 +0000 (01:52 +0000)]
Convert NonVirtualSize to CharUnits from bits. No change in functionality
intended.

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

13 years agoConvert NonVirtualAlignment to CharUnits. No change in functionality
Ken Dyck [Wed, 16 Feb 2011 01:43:15 +0000 (01:43 +0000)]
Convert NonVirtualAlignment to CharUnits. No change in functionality
intended.

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

13 years ago[analyzer] AnalyzerFrontend is dependent on AnalyzerCheckers.
Argyrios Kyrtzidis [Wed, 16 Feb 2011 01:40:55 +0000 (01:40 +0000)]
[analyzer] AnalyzerFrontend is dependent on AnalyzerCheckers.

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

13 years ago[analyzer] Use the new registration mechanism on the apple checkers:
Argyrios Kyrtzidis [Wed, 16 Feb 2011 01:40:52 +0000 (01:40 +0000)]
[analyzer] Use the new registration mechanism on the apple checkers:

  NilArgChecker
  CFNumberCreateChecker
  NSAutoreleasePoolChecker
  CFRetainReleaseChecker
  ClassReleaseChecker

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

13 years agoWhen searching for visible declarations (e.g., for code completion),
Douglas Gregor [Wed, 16 Feb 2011 01:39:26 +0000 (01:39 +0000)]
When searching for visible declarations (e.g., for code completion),
be sure to look at all of the Objective-C class declarations within a
@class. Fixes <rdar://problem/8876207>.

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

13 years agoSimplify test to check an aggregate argument that has non trivial constructor or...
Devang Patel [Wed, 16 Feb 2011 01:11:51 +0000 (01:11 +0000)]
Simplify test to check an aggregate argument that has non trivial constructor or destructor.
This patch rewrites r125142.

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

13 years agoWhen trying to provide a code completion item for a call to "super" in
Douglas Gregor [Wed, 16 Feb 2011 00:51:18 +0000 (00:51 +0000)]
When trying to provide a code completion item for a call to "super" in
Objective-C, also look in the categories and class extensions of our
superclasses. Fixes <rdar://problem/8853540>.

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

13 years agoDon't call objc_read_weak as part of emitting a block literal.
John McCall [Wed, 16 Feb 2011 00:49:34 +0000 (00:49 +0000)]
Don't call objc_read_weak as part of emitting a block literal.
Nobody ever gave me a clear reason for why we were doing this, and
now it's apparently causing serious problems, so if *not* having this
causes problems, we get to solve them the right way this time.

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

13 years agoCheck for deprecated implementation unconditionally.
Fariborz Jahanian [Wed, 16 Feb 2011 00:30:31 +0000 (00:30 +0000)]
Check for deprecated implementation unconditionally.
Warning and its note will be ignored in default case.

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

13 years agoFix typo (per Chris's comment).
Fariborz Jahanian [Wed, 16 Feb 2011 00:14:11 +0000 (00:14 +0000)]
Fix typo (per Chris's comment).

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

13 years agoWarn for missing terminating " or ' instead of error for gcc compatibility. Fixed...
Argyrios Kyrtzidis [Tue, 15 Feb 2011 23:45:31 +0000 (23:45 +0000)]
Warn for missing terminating " or ' instead of error for gcc compatibility. Fixed rdar://8914293.

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

13 years agoOnly c++ class arguments with non trivial constructor or destructor needs a reference.
Devang Patel [Tue, 15 Feb 2011 23:36:28 +0000 (23:36 +0000)]
Only c++ class arguments with non trivial constructor or destructor needs a reference.
C struct arguments do not need this adjustment.
This fixes 7 failures in callfuncs.exp from gdb testsuite.

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

13 years ago[analyzer] Use the new registration mechanism on some of the experimental internal...
Argyrios Kyrtzidis [Tue, 15 Feb 2011 22:55:20 +0000 (22:55 +0000)]
[analyzer] Use the new registration mechanism on some of the experimental internal checkers:

  CastToStructChecker
  FixedAddressChecker
  PointerArithChecker
  PointerSubChecker

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

13 years ago[analyzer] Use the new registration mechanism on the IdempotentOperationChecker.
Argyrios Kyrtzidis [Tue, 15 Feb 2011 22:55:14 +0000 (22:55 +0000)]
[analyzer] Use the new registration mechanism on the IdempotentOperationChecker.

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

13 years agoHandle delayed access in local declarations. PR9229.
John McCall [Tue, 15 Feb 2011 22:51:53 +0000 (22:51 +0000)]
Handle delayed access in local declarations.  PR9229.

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