]> granicus.if.org Git - clang/log
clang
13 years agostatic analyzer: Further reduce the analyzer's memory usage when analyzing sqlite3...
Ted Kremenek [Wed, 9 Feb 2011 01:27:33 +0000 (01:27 +0000)]
static analyzer: Further reduce the analyzer's memory usage when analyzing sqlite3 by 7-10% by recylcing "uninteresting" ExplodedNodes.

The optimization involves eagerly pruning ExplodedNodes from the ExplodedGraph that contain
practically no difference between the predecessor and successor nodes.  For example, if
the state is different between a predecessor and a node, the node is left in.  Only for
the 'environment' component of the state do we not care if the ExplodedNodes are different.
This paves the way for future optimizations where we can reclaim the environment objects.

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

13 years agoMake ProgramPoint::getTag() public.
Ted Kremenek [Wed, 9 Feb 2011 01:27:27 +0000 (01:27 +0000)]
Make ProgramPoint::getTag() public.

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

13 years agoNonTypeTemplateParmDecl is just a DeclaratorDecl, not a VarDecl.
John McCall [Wed, 9 Feb 2011 01:13:10 +0000 (01:13 +0000)]
NonTypeTemplateParmDecl is just a DeclaratorDecl, not a VarDecl.

Also, reorganize and make very explicit the logic for determining
the value kind and type of a referenced declaration.

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

13 years agoIf an aggregate argument is passed indirectly because it has non trivial
Devang Patel [Wed, 9 Feb 2011 00:37:30 +0000 (00:37 +0000)]
If an aggregate argument is passed indirectly because it has non trivial
destructor or copy constructor than let debug info know about it.

Radar 8945514.

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

13 years agoNo longer pass deprecated '-nodistribute' flag to xcodebuild.
Ted Kremenek [Tue, 8 Feb 2011 22:54:30 +0000 (22:54 +0000)]
No longer pass deprecated '-nodistribute' flag to xcodebuild.

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

13 years agoanalyzer, retain/release checker: Remove hack where objects passed in message to...
Ted Kremenek [Tue, 8 Feb 2011 22:54:26 +0000 (22:54 +0000)]
analyzer, retain/release checker: Remove hack where objects passed in message to 'self' are no longer tracked.

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

13 years agoUpdate for API change.
Rafael Espindola [Tue, 8 Feb 2011 22:44:16 +0000 (22:44 +0000)]
Update for API change.

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

13 years agoWhen checking the 'weak' and 'weakref' attributes, look for non-external
John McCall [Tue, 8 Feb 2011 22:35:49 +0000 (22:35 +0000)]
When checking the 'weak' and 'weakref' attributes, look for non-external
linkage rather than the presence of the 'static' storage class specifier.
Fixes rdar://problem/8814626.

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

13 years agoFix an IRGen bug in property setter calls when
Fariborz Jahanian [Tue, 8 Feb 2011 22:33:23 +0000 (22:33 +0000)]
Fix an IRGen bug in property setter calls when
setter and getter types mismatch. // rdar://8966864

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

13 years ago[analyzer] Move the files in lib/StaticAnalyzer to lib/StaticAnalyzer/Core.
Argyrios Kyrtzidis [Tue, 8 Feb 2011 22:30:36 +0000 (22:30 +0000)]
[analyzer] Move the files in lib/StaticAnalyzer to lib/StaticAnalyzer/Core.

Eventually there will also be a lib/StaticAnalyzer/Frontend that will handle initialization and checker registration.
Yet another library to avoid cyclic dependencies between Core and Checkers.

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

13 years ago[analyzer] lib/StaticAnalyzer/Checkers/ExprEngineExperimentalChecks.cpp -> lib/Static...
Argyrios Kyrtzidis [Tue, 8 Feb 2011 22:30:15 +0000 (22:30 +0000)]
[analyzer] lib/StaticAnalyzer/Checkers/ExprEngineExperimentalChecks.cpp -> lib/StaticAnalyzer/Checkers/ExperimentalChecks.cpp

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

13 years ago[analyzer] lib/StaticAnalyzer/Checkers/ExprEngineExperimentalChecks.h -> lib/StaticAn...
Argyrios Kyrtzidis [Tue, 8 Feb 2011 22:30:11 +0000 (22:30 +0000)]
[analyzer] lib/StaticAnalyzer/Checkers/ExprEngineExperimentalChecks.h -> lib/StaticAnalyzer/Checkers/ExperimentalChecks.h

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

13 years ago[analyzer] lib/StaticAnalyzer/Checkers/ExprEngineInternalChecks.h -> lib/StaticAnalyz...
Argyrios Kyrtzidis [Tue, 8 Feb 2011 22:30:02 +0000 (22:30 +0000)]
[analyzer] lib/StaticAnalyzer/Checkers/ExprEngineInternalChecks.h -> lib/StaticAnalyzer/Checkers/InternalChecks.h

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

13 years agoTest case accidentally left out of my last commit.
John McCall [Tue, 8 Feb 2011 22:28:39 +0000 (22:28 +0000)]
Test case accidentally left out of my last commit.

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

13 years agoSplit the serialized representation for the detailed preprocessing
Douglas Gregor [Tue, 8 Feb 2011 21:58:10 +0000 (21:58 +0000)]
Split the serialized representation for the detailed preprocessing
record away from the core processor record. The tangling of these two
data structures led to some inefficiencies (e.g., deserializing all
of the detailed preprocessing record when we didn't need it, such as
while performing code completion) along with some unnecessary
ugliness.

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

13 years agoAST: support for pre-arg expressions on CallExpr subclasses
Peter Collingbourne [Tue, 8 Feb 2011 21:18:02 +0000 (21:18 +0000)]
AST: support for pre-arg expressions on CallExpr subclasses

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

13 years agoStmtPrinter: factor out arg printing code to PrintCallArgs
Peter Collingbourne [Tue, 8 Feb 2011 21:17:54 +0000 (21:17 +0000)]
StmtPrinter: factor out arg printing code to PrintCallArgs

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

13 years agoAllow multiple -B prefixes. Patch by Joerg Sonnenberger.
Benjamin Kramer [Tue, 8 Feb 2011 20:31:42 +0000 (20:31 +0000)]
Allow multiple -B prefixes. Patch by Joerg Sonnenberger.

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

13 years agoClear the linkage cache recursively. Fixes PR8926.
John McCall [Tue, 8 Feb 2011 19:01:05 +0000 (19:01 +0000)]
Clear the linkage cache recursively.  Fixes PR8926.

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

13 years agoIn Sema::CheckShadow, get the DeclContext from the variable that we are checking
Argyrios Kyrtzidis [Tue, 8 Feb 2011 18:21:25 +0000 (18:21 +0000)]
In Sema::CheckShadow, get the DeclContext from the variable that we are checking
instead from the Scope; Inner scopes in bodies don't have DeclContexts associated with them.

Fixes http://llvm.org/PR9160 & rdar://problem/8966163.

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

13 years agoSupport for objextive-c++ use of property-dot syntax as receiver
Fariborz Jahanian [Tue, 8 Feb 2011 18:05:59 +0000 (18:05 +0000)]
Support for objextive-c++ use of property-dot syntax as receiver
in liu of a class method getter.
// rdar://8962253

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

13 years agoUpdate the writing of the block-information block in the AST file
Douglas Gregor [Tue, 8 Feb 2011 16:34:17 +0000 (16:34 +0000)]
Update the writing of the block-information block in the AST file
format, so that llvm-bcanalyzer knows about all of the various record
kinds.

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

13 years agoReorganize CodeGen{Function,Module} to eliminate the unfortunate
John McCall [Tue, 8 Feb 2011 08:22:06 +0000 (08:22 +0000)]
Reorganize CodeGen{Function,Module} to eliminate the unfortunate
Block{Function,Module} base class.  Minor other refactorings.

Fixed a few address-space bugs while I was there.

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

13 years agoExtend the const capture optimization to C++ record types with no
John McCall [Tue, 8 Feb 2011 03:07:00 +0000 (03:07 +0000)]
Extend the const capture optimization to C++ record types with no
mutable fields and with trivial destructors and copy constructors.

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

13 years agoSema::MaybeBindToTemporary() shouldn't treat any expression returning
Douglas Gregor [Tue, 8 Feb 2011 02:14:35 +0000 (02:14 +0000)]
Sema::MaybeBindToTemporary() shouldn't treat any expression returning
a glvalue as a temporary. Previously, we were enumerating all of the
cases that coul return glvalues and might be called with
Sema::MaybeBindToTemporary(), but that was gross and we missed the
Objective-C property reference case.

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

13 years agoConvert RecordLayout::NonVirtualAlign to CharUnits. No change in
Ken Dyck [Tue, 8 Feb 2011 02:02:47 +0000 (02:02 +0000)]
Convert RecordLayout::NonVirtualAlign to CharUnits. No change in
functionality intended.

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

13 years agodgregor accidentally killed this assert, but on investigation, it can fire
John McCall [Tue, 8 Feb 2011 01:59:10 +0000 (01:59 +0000)]
dgregor accidentally killed this assert, but on investigation, it can fire
on invalid code and we don't really care, so kill it harder.

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

13 years agoSupport for objc use of property-dot syntax as receiver
Fariborz Jahanian [Tue, 8 Feb 2011 00:23:07 +0000 (00:23 +0000)]
Support for objc use of property-dot syntax as receiver
in liu of a class method getter. objc++ uses a different
code path and is more involved (TBD).

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

13 years agoWhen copy-capturing values for a nested capture, use a BlockDeclRefExpr.
John McCall [Mon, 7 Feb 2011 18:37:40 +0000 (18:37 +0000)]
When copy-capturing values for a nested capture, use a BlockDeclRefExpr.

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

13 years agoMove uninitialized variable checking back under -Wuninitialized-experimental. It...
Ted Kremenek [Mon, 7 Feb 2011 17:38:38 +0000 (17:38 +0000)]
Move uninitialized variable checking back under -Wuninitialized-experimental.  It is clear from user feedback that this warning is not quite ready.

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

13 years agoA few more tweaks to the blocks AST representation:
John McCall [Mon, 7 Feb 2011 10:33:21 +0000 (10:33 +0000)]
A few more tweaks to the blocks AST representation:
  - BlockDeclRefExprs always store VarDecls
  - BDREs no longer store copy expressions
  - BlockDecls now store a list of captured variables, information about
    how they're captured, and a copy expression if necessary

With that in hand, change IR generation to use the captures data in
blocks instead of walking the block independently.

Additionally, optimize block layout by emitting fields in descending
alignment order, with a heuristic for filling in words when alignment
of the end of the block header is insufficient for the most aligned
field.

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

13 years agopre/post ++/-- for AltiVec vectors. (with builtins-ppc-altivec.c failure fixed)
Anton Yartsev [Mon, 7 Feb 2011 02:17:30 +0000 (02:17 +0000)]
pre/post ++/-- for AltiVec vectors. (with builtins-ppc-altivec.c failure fixed)

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

13 years agoAdd another test that we can fully devirtualize now.
Anders Carlsson [Sun, 6 Feb 2011 20:16:20 +0000 (20:16 +0000)]
Add another test that we can fully devirtualize now.

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

13 years agoFix self-host; if a thunk already exists and has available_externally linkage, we...
Anders Carlsson [Sun, 6 Feb 2011 20:09:44 +0000 (20:09 +0000)]
Fix self-host; if a thunk already exists and has available_externally linkage, we should change its linkage instead of asserting.

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

13 years agoWhen building with optimizations, emit thunks with available_externally linkage so...
Anders Carlsson [Sun, 6 Feb 2011 18:31:40 +0000 (18:31 +0000)]
When building with optimizations, emit thunks with available_externally linkage so devirtualized function calls can also be de-thunked.

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

13 years agoSimplify thunks code.
Anders Carlsson [Sun, 6 Feb 2011 17:15:43 +0000 (17:15 +0000)]
Simplify thunks code.

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

13 years agoCLANG_BINARY_DIR is not the same thing as LLVM_BINARY_DIR when Clang
Oscar Fuentes [Sun, 6 Feb 2011 15:33:08 +0000 (15:33 +0000)]
CLANG_BINARY_DIR is not the same thing as LLVM_BINARY_DIR when Clang
is built as part of LLVM.

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

13 years agoadd some missing builtins.
Chris Lattner [Sun, 6 Feb 2011 12:45:51 +0000 (12:45 +0000)]
add some missing builtins.

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

13 years agoSupport running tests from the VS IDE and XCode.
Oscar Fuentes [Sat, 5 Feb 2011 21:37:51 +0000 (21:37 +0000)]
Support running tests from the VS IDE and XCode.

Untested, but should work :)

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

13 years agoRemove the clang++ symlink with `make clean'.
Oscar Fuentes [Sat, 5 Feb 2011 21:37:37 +0000 (21:37 +0000)]
Remove the clang++ symlink with `make clean'.

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

13 years agoAdd a __has_feature check for default template arguments in function
Douglas Gregor [Sat, 5 Feb 2011 20:35:30 +0000 (20:35 +0000)]
Add a __has_feature check for default template arguments in function
templates, a C++0x feature.

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

13 years agoCMake: libclang shall be named libclang.so, not liblibclang.so.
Oscar Fuentes [Sat, 5 Feb 2011 20:00:13 +0000 (20:00 +0000)]
CMake: libclang shall be named libclang.so, not liblibclang.so.

It is not possible to simply change that target name to `clang'
because we already have one.

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

13 years agoImprove our uniquing of file entries when files are re-saved or are
Douglas Gregor [Sat, 5 Feb 2011 19:42:43 +0000 (19:42 +0000)]
Improve our uniquing of file entries when files are re-saved or are
overridden via remapping. Thus, when we create a "virtual" file in the
file manager, we still stat() the real file that lives behind it so
that we can provide proper uniquing based on inodes. This helps keep
the file manager much more consistent.

To take advantage of this when reparsing files in libclang, we disable
the use of the stat() cache when reparsing or performing code
completion, since the stat() cache is very likely to be out of date in
this use case.

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

13 years agoBasic implementation of inherited constructors. Only generates declarations, and...
Sebastian Redl [Sat, 5 Feb 2011 19:23:19 +0000 (19:23 +0000)]
Basic implementation of inherited constructors. Only generates declarations, and probably only works for very basic use cases.

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

13 years agoSupport `make clang-test' when Clang is compiled outside of LLVM.
Oscar Fuentes [Sat, 5 Feb 2011 19:08:56 +0000 (19:08 +0000)]
Support `make clang-test' when Clang is compiled outside of LLVM.

This may not work on build platforms that place the binaries on
special folders ($build_dir/bin/Release/) such as the VS IDE and
XCode. For fixing this it is necessary to add a lit.py configuration
option for saying where the Clang binaries are, and apply to that path
the same magit that is used with the path to the LLVM tools binary
directory. Doing this requires a bit of autoconf work.

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

13 years agoPass a 'ForVTable' flag to GetAddrOfThunk and pass it along to GetOrCreateLLVMFunctio...
Anders Carlsson [Sat, 5 Feb 2011 18:48:55 +0000 (18:48 +0000)]
Pass a 'ForVTable' flag to GetAddrOfThunk and pass it along to GetOrCreateLLVMFunction so that we
won't assert when building a thunk for an implicit virtual member function that is not marked used.

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

13 years agopython bindings: Add support for different kind of completion chunks
Tobias Grosser [Sat, 5 Feb 2011 17:54:10 +0000 (17:54 +0000)]
python bindings: Add support for different kind of completion chunks

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

13 years agopython bindings: Get the string representation of a CompletionChunk
Tobias Grosser [Sat, 5 Feb 2011 17:54:07 +0000 (17:54 +0000)]
python bindings: Get the string representation of a CompletionChunk

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

13 years agopython bindings: Add CodeCompletionResults
Tobias Grosser [Sat, 5 Feb 2011 17:54:04 +0000 (17:54 +0000)]
python bindings: Add CodeCompletionResults

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

13 years agopython bindings: Add support for translationUnit.reparse().
Tobias Grosser [Sat, 5 Feb 2011 17:54:00 +0000 (17:54 +0000)]
python bindings: Add support for translationUnit.reparse().

This is the first step to make the clang_complete vim plugin work with
libclang. Reparsing improves parsing time from 0.8 to 0.25 secs for
one of my LLVM .cpp files.

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

13 years agopython bindings: Include local headers the right way.
Tobias Grosser [Sat, 5 Feb 2011 17:53:55 +0000 (17:53 +0000)]
python bindings: Include local headers the right way.

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

13 years agopython bindings: Remove unneeded instruction
Tobias Grosser [Sat, 5 Feb 2011 17:53:53 +0000 (17:53 +0000)]
python bindings: Remove unneeded instruction

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

13 years agopython bindings: fix Diagnostics.range iterator
Tobias Grosser [Sat, 5 Feb 2011 17:53:51 +0000 (17:53 +0000)]
python bindings: fix Diagnostics.range iterator

The iterator did never throw an IndexError. It was therefore not possible
to use it in a normal foreach loop as that loop would never stop.

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

13 years agopython bindings: Use python Diagnostics as function arguments
Tobias Grosser [Sat, 5 Feb 2011 17:53:48 +0000 (17:53 +0000)]
python bindings: Use python Diagnostics as function arguments

This improves the readability of the code and fixes one testsuite bug.

The bug happend, because we only stored the pointer to the diagnostic in the
FixIt iterator, but not the python Diagnostic object. So it could happen that
the FixIt iterator still exists, but the python Diagnostic object is freed.
However, as the python Diagnostic is freed the pointer to the diagnostic is also
freed and the FixIt iterator is referencing a freed pointer.

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

13 years agopython bindings: Synchronize cursor kinds
Tobias Grosser [Sat, 5 Feb 2011 17:53:47 +0000 (17:53 +0000)]
python bindings: Synchronize cursor kinds

clang-c/Index.h contained cursor kinds not yet available in the python bindings.

Contributed-By: jmuizelaar@mozilla.com
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124951 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] Fix a false positive of the 'self' initialization checker.
Argyrios Kyrtzidis [Sat, 5 Feb 2011 05:54:53 +0000 (05:54 +0000)]
[analyzer] Fix a false positive of the 'self' initialization checker.

A common pattern in classes with multiple initializers is to put the
subclass's common initialization bits into a static function that receives
the value of 'self', e.g:

   if (!(self = [super init]))
     return nil;
   if (!(self = _commonInit(self)))
     return nil;

It was reported that 'self' was not set to the result of [super init].
Until we can use inter-procedural analysis, in such a call, transfer the
ObjCSelfInitChecker flags associated with 'self' to the result of the call.

Fixes rdar://8937441 & http://llvm.org/PR9094

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

13 years agoWhen the out-of-line definition differs from the declaration in the return type,
Argyrios Kyrtzidis [Sat, 5 Feb 2011 05:54:49 +0000 (05:54 +0000)]
When the out-of-line definition differs from the declaration in the return type,
say "out-of-line definition differ from the declaration in the return type" instead of
the silly "functions that differ only in their return type cannot be overloaded".

Addresses rdar://7980179.

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

13 years agoRe-land r124768, with a fix for PR9130.
Anders Carlsson [Sat, 5 Feb 2011 04:35:53 +0000 (04:35 +0000)]
Re-land r124768, with a fix for PR9130.

We now emit everything except unused implicit virtual member functions when building the vtable.

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

13 years agoDon't suggest -Wuninitialized fixits for uninitialized enum types.
Ted Kremenek [Sat, 5 Feb 2011 01:18:18 +0000 (01:18 +0000)]
Don't suggest -Wuninitialized fixits for uninitialized enum types.

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

13 years agoDon't crash when generating USRs for ObjC methods in protocols.
Ted Kremenek [Sat, 5 Feb 2011 01:10:26 +0000 (01:10 +0000)]
Don't crash when generating USRs for ObjC methods in protocols.

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

13 years agoRestore a test which I accientally overwrote in my last
Fariborz Jahanian [Fri, 4 Feb 2011 23:30:23 +0000 (23:30 +0000)]
Restore a test which I accientally overwrote in my last
patch.

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

13 years ago-Wselector should warn on implemented selectors only
Fariborz Jahanian [Fri, 4 Feb 2011 23:19:27 +0000 (23:19 +0000)]
-Wselector should warn on implemented selectors only
when selector metadata is generated, which is triggered
by at least on class implementation. This is to match gcc's
behavior. // rdar://8851684.

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

13 years agoAssert during instantiation of blocks that we've captured everything that
John McCall [Fri, 4 Feb 2011 18:33:18 +0000 (18:33 +0000)]
Assert during instantiation of blocks that we've captured everything that
we captured in the dependent case.

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

13 years agoAdd better support for ARM EABI triples.
Bob Wilson [Fri, 4 Feb 2011 17:59:28 +0000 (17:59 +0000)]
Add better support for ARM EABI triples.
Patch by Renato Golin!

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

13 years agoDriver: Fix spurious warning (from -cc1) about unused -fapple-kext on C inputs.
Daniel Dunbar [Fri, 4 Feb 2011 17:24:47 +0000 (17:24 +0000)]
Driver: Fix spurious warning (from -cc1) about unused -fapple-kext on C inputs.

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

13 years agobuild: Prevent duplicate inclusion of Makefile.rules, which causes make to warn
Daniel Dunbar [Fri, 4 Feb 2011 17:12:27 +0000 (17:12 +0000)]
build: Prevent duplicate inclusion of Makefile.rules, which causes make to warn
like crazy.
 - How no one else is bothered by this I can't understand!

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

13 years agoImprove our handling of the current instantiation for qualified
Douglas Gregor [Fri, 4 Feb 2011 13:35:07 +0000 (13:35 +0000)]
Improve our handling of the current instantiation for qualified
id-expression, e.g.,

  CurrentClass<T>::member

Previously, if CurrentClass<T> was dependent and not complete, we
would treat it as a dependent-scoped declaration reference expression,
even if CurrentClass<T> referred to the current instantiation.

Fixes PR8966 and improves type checking of templates.

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

13 years agoBefore checking bitfield initialization, make sure that neither the
Douglas Gregor [Fri, 4 Feb 2011 13:09:01 +0000 (13:09 +0000)]
Before checking bitfield initialization, make sure that neither the
bit-field width nor the initializer value are type- or
value-dependent. Fixes PR8712.

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

13 years agoWhen calling a bound pointer to member function, check the
Douglas Gregor [Fri, 4 Feb 2011 12:57:49 +0000 (12:57 +0000)]
When calling a bound pointer to member function, check the
cv-qualifiers on the object against the cv-qualifiers on the member
function. Fixes PR8315.

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

13 years agoTweak my fix for PR8748, and update the incorrect PR number in the test case.
Douglas Gregor [Fri, 4 Feb 2011 12:22:53 +0000 (12:22 +0000)]
Tweak my fix for PR8748, and update the incorrect PR number in the test case.

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

13 years agoImplement proper (de-)serialization for explicit template argument
Douglas Gregor [Fri, 4 Feb 2011 12:01:24 +0000 (12:01 +0000)]
Implement proper (de-)serialization for explicit template argument
lists with zero template arguments. Fixes some seriously scary
crashers in C++ PCH.

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

13 years agoFix test for previous commit
Douglas Gregor [Fri, 4 Feb 2011 11:59:47 +0000 (11:59 +0000)]
Fix test for previous commit

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

13 years agoFix a crash-on-invalid where we were trying to parse C++ constructs in
Douglas Gregor [Fri, 4 Feb 2011 11:57:16 +0000 (11:57 +0000)]
Fix a crash-on-invalid where we were trying to parse C++ constructs in
C, then hitting an assertion because C code shouldn't try to parse
optional nested-name-specifiers. Fixes PR9137.

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

13 years agoUSRs for Objective-C methods use the USR of the @interface as their base, not the...
Ted Kremenek [Fri, 4 Feb 2011 07:13:40 +0000 (07:13 +0000)]
USRs for Objective-C methods use the USR of the @interface as their base, not the USR of the class category or extension.

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

13 years agoDowngrade error about attribute 'iboutlet' and 'ibaction' being applied to anything...
Ted Kremenek [Fri, 4 Feb 2011 06:54:16 +0000 (06:54 +0000)]
Downgrade error about attribute 'iboutlet' and 'ibaction' being applied to anything but a instance method to a warning.

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

13 years agoTighten up the semantics of default template arguments, per C++0x
Douglas Gregor [Fri, 4 Feb 2011 04:20:44 +0000 (04:20 +0000)]
Tighten up the semantics of default template arguments, per C++0x
[temp.param]p9 and C++ DR226. Fixes PR8747.

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

13 years agoWhen a function template's template parameter has a default argument,
Douglas Gregor [Fri, 4 Feb 2011 03:57:22 +0000 (03:57 +0000)]
When a function template's template parameter has a default argument,
it's okay for the following template parameters to not have default
arguments (since those template parameters can still be
deduced). Also, downgrade the error about default template arguments
in function templates to an extension warning, since this is a
harmless C++0x extension.

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

13 years agobuild: Add support for DISABLE_DEFAULT_STRICT_ALIASING, which does what one
Daniel Dunbar [Fri, 4 Feb 2011 02:20:39 +0000 (02:20 +0000)]
build: Add support for DISABLE_DEFAULT_STRICT_ALIASING, which does what one
might expect.

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

13 years agoFix 80-col violins.
Daniel Dunbar [Fri, 4 Feb 2011 02:20:34 +0000 (02:20 +0000)]
Fix 80-col violins.

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

13 years agominor refactoring of -fapple-kext stuff.
Fariborz Jahanian [Fri, 4 Feb 2011 00:32:39 +0000 (00:32 +0000)]
minor refactoring of -fapple-kext stuff.

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

13 years agoWhat was I thinking?
Fariborz Jahanian [Fri, 4 Feb 2011 00:08:13 +0000 (00:08 +0000)]
What was I thinking?

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

13 years ago-fapple-kext cannot have 'weak' visibility in this
Fariborz Jahanian [Fri, 4 Feb 2011 00:01:24 +0000 (00:01 +0000)]
-fapple-kext cannot have 'weak' visibility in this
abi.

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

13 years agoIf any Fix-Its attached to a diagnostic have invalid source locations
Douglas Gregor [Thu, 3 Feb 2011 23:41:12 +0000 (23:41 +0000)]
If any Fix-Its attached to a diagnostic have invalid source locations
or source locations that refer into a macro instantiation, delete all
of the Fix-Its on that diagnostic.

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

13 years agoMoved here from LLVM Clang's configuration options and related macros.
Oscar Fuentes [Thu, 3 Feb 2011 22:48:20 +0000 (22:48 +0000)]
Moved here from LLVM Clang's configuration options and related macros.

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

13 years ago[analyzer] Fix a crash until we can handle temporary struct objects properly.
Argyrios Kyrtzidis [Thu, 3 Feb 2011 22:01:32 +0000 (22:01 +0000)]
[analyzer] Fix a crash until we can handle temporary struct objects properly.

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

13 years agoAdd __has_feature() for each of the type traits
Douglas Gregor [Thu, 3 Feb 2011 21:57:35 +0000 (21:57 +0000)]
Add __has_feature() for each of the type traits

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

13 years agoOptionally, Clang now builds using LLVM as an external library.
Oscar Fuentes [Thu, 3 Feb 2011 20:57:53 +0000 (20:57 +0000)]
Optionally, Clang now builds using LLVM as an external library.

The user sets the variable CLANG_PATH_TO_LLVM_BUILD pointing to a LLVM
build directory or to a directory where LLVM was installed. When using
a non-installed LLVM build, it is necessary to set
CLANG_PATH_TO_LLVM_SOURCE as well.

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

13 years agoClean up of -fapple-kext abi code. No change otherwise.
Fariborz Jahanian [Thu, 3 Feb 2011 19:27:17 +0000 (19:27 +0000)]
Clean up of -fapple-kext abi code. No change otherwise.

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

13 years agoImplement -Woverloaded-virtual.
Argyrios Kyrtzidis [Thu, 3 Feb 2011 18:01:15 +0000 (18:01 +0000)]
Implement -Woverloaded-virtual.

The difference with gcc is that it warns if you overload virtual methods only if
the method doesn't also override any method. This is to cut down on the number of warnings
and make it more useful like reported here: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20423.
If we want to warn that not all overloads are overriden we can have an additional
warning like -Wpartial-override.

-Woverloaded-virtual, unlike gcc, is added to -Wmost. Addresses rdar://8757630.

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

13 years agoTeach SourceManager::getLocation() how to cope with a source file
Douglas Gregor [Thu, 3 Feb 2011 17:17:35 +0000 (17:17 +0000)]
Teach SourceManager::getLocation() how to cope with a source file
whose inode has changed since the file was first created and that is
being seen through a different path name (e.g., due to symlinks or
relative path elements), such that its FileEntry pointer doesn't match
a known FileEntry pointer. Since this requires a system call (to
stat()), we only perform this deeper checking if we can't find the
file by comparing FileEntry pointers.

Also, add a micro-optimization where we don't bother to compute line
numbers when given the location (1, 1). This improves the
efficiency of clang_getLocationForOffset().

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

13 years agoRemove unnecessary RUN: directive.
Axel Naumann [Thu, 3 Feb 2011 14:05:55 +0000 (14:05 +0000)]
Remove unnecessary RUN: directive.

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

13 years agoMore tweaks to the compatibility page.
John McCall [Thu, 3 Feb 2011 11:29:18 +0000 (11:29 +0000)]
More tweaks to the compatibility page.

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

13 years agoMore minor documentation tweaks.
John McCall [Thu, 3 Feb 2011 11:05:04 +0000 (11:05 +0000)]
More minor documentation tweaks.

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

13 years agoRework the __block jump-checking section, including a justification of
John McCall [Thu, 3 Feb 2011 10:56:31 +0000 (10:56 +0000)]
Rework the __block jump-checking section, including a justification of
why this bug can go uncaught.

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

13 years agoRework and embellish the C99 inline compatibility section.
John McCall [Thu, 3 Feb 2011 10:16:40 +0000 (10:16 +0000)]
Rework and embellish the C99 inline compatibility section.

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

13 years agoCMake: Fix test. CMake has not built unittests yet.
NAKAMURA Takumi [Thu, 3 Feb 2011 09:01:12 +0000 (09:01 +0000)]
CMake: Fix test. CMake has not built unittests yet.

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

13 years agoCapture a few implicit references to 'self'.
John McCall [Thu, 3 Feb 2011 09:00:02 +0000 (09:00 +0000)]
Capture a few implicit references to 'self'.

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

13 years agoMore capturing of 'this': implicit member expressions. Getting that
John McCall [Thu, 3 Feb 2011 08:15:49 +0000 (08:15 +0000)]
More capturing of 'this':  implicit member expressions.  Getting that
right for anonymous struct/union members led to me discovering some
seemingly broken code in that area of Sema, which I fixed, partly by
changing the representation of member pointer constants so that
IndirectFieldDecls aren't expanded.  This led to assorted cleanups with
member pointers in CodeGen, and while I was doing that I saw some random
other things to clean up.

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

13 years agoReenable -Wuninitialized warning for captured block variables.
Ted Kremenek [Thu, 3 Feb 2011 06:51:50 +0000 (06:51 +0000)]
Reenable -Wuninitialized warning for captured block variables.

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

13 years agoAdd test from PR9130.
Rafael Espindola [Thu, 3 Feb 2011 06:36:50 +0000 (06:36 +0000)]
Add test from PR9130.

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