]> granicus.if.org Git - clang/log
clang
14 years agoFix thinko.
Anders Carlsson [Fri, 27 Nov 2009 01:26:58 +0000 (01:26 +0000)]
Fix thinko.

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

14 years agoWhen adding an implicit destructor, make sure to mark it as virtual if it overrides...
Anders Carlsson [Thu, 26 Nov 2009 21:25:09 +0000 (21:25 +0000)]
When adding an implicit destructor, make sure to mark it as virtual if it overrides existing destructors.

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

14 years agoCorrectly find overridden destructors.
Anders Carlsson [Thu, 26 Nov 2009 20:50:40 +0000 (20:50 +0000)]
Correctly find overridden destructors.

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

14 years agoLazily create the __cxa_pure_virtual reference.
Anders Carlsson [Thu, 26 Nov 2009 19:54:33 +0000 (19:54 +0000)]
Lazily create the __cxa_pure_virtual reference.

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

14 years agoUse the new CovariantThunkAdjustment in the vtable builder.
Anders Carlsson [Thu, 26 Nov 2009 19:32:45 +0000 (19:32 +0000)]
Use the new CovariantThunkAdjustment in the vtable builder.

Make the pure virtual methods map a set instead.

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

14 years agotypo
Gabor Greif [Thu, 26 Nov 2009 15:18:50 +0000 (15:18 +0000)]
typo

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

14 years agoissue a friendlier error if someone tries to send precompiled header to '-' (stdout)
Gabor Greif [Thu, 26 Nov 2009 14:35:28 +0000 (14:35 +0000)]
issue a friendlier error if someone tries to send precompiled header to '-' (stdout)
this brings the error on
  clang -c foo.h -o -
closer to
  clang -c foo.h -o /dev/null

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

14 years agoRemove dead forward declaration. Fix struct/class mismatch. Remove trailing whitespace.
Benjamin Kramer [Thu, 26 Nov 2009 13:09:03 +0000 (13:09 +0000)]
Remove dead forward declaration. Fix struct/class mismatch. Remove trailing whitespace.

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

14 years agoRemove header which is bringing libAST in (on MSVC).
Daniel Dunbar [Thu, 26 Nov 2009 09:57:25 +0000 (09:57 +0000)]
Remove header which is bringing libAST in (on MSVC).

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

14 years agoRemove unused variable.
Eli Friedman [Thu, 26 Nov 2009 07:48:44 +0000 (07:48 +0000)]
Remove unused variable.

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

14 years agoShortcut explicit calls to a trivial copy assignment operator.
Eli Friedman [Thu, 26 Nov 2009 07:45:48 +0000 (07:45 +0000)]
Shortcut explicit calls to a trivial copy assignment operator.

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

14 years agoSimplify and fix up the handling of implicit constructors, copy assignment
Eli Friedman [Thu, 26 Nov 2009 07:40:08 +0000 (07:40 +0000)]
Simplify and fix up the handling of implicit constructors, copy assignment
operators, and destructors.  Avoids generating declarations/definitions of
trivial constructors/destructors, and makes sure the trivial copy assignment
operator is generated when necessary.

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

14 years agoImprove diagnostics in ReturnStackAddressChecker for returning a stack-allocated...
Ted Kremenek [Thu, 26 Nov 2009 07:14:50 +0000 (07:14 +0000)]
Improve diagnostics in ReturnStackAddressChecker for returning a stack-allocated block.  Implements the rest of <rdar://problem/7387385>.

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

14 years agoAdd test case that shows that dead stores checking now works in the presence of blocks.
Ted Kremenek [Thu, 26 Nov 2009 06:55:36 +0000 (06:55 +0000)]
Add test case that shows that dead stores checking now works in the presence of blocks.

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

14 years agoImplement IRGen for MemberExpr referring to static member function.
Eli Friedman [Thu, 26 Nov 2009 06:08:14 +0000 (06:08 +0000)]
Implement IRGen for MemberExpr referring to static member function.

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

14 years agoDon't run the LLVM Code tests by default.
Daniel Dunbar [Thu, 26 Nov 2009 05:09:00 +0000 (05:09 +0000)]
Don't run the LLVM Code tests by default.

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

14 years agoAdd -Werror for Clang and LLVM on Clang (headers) syntax tests.
Daniel Dunbar [Thu, 26 Nov 2009 05:08:53 +0000 (05:08 +0000)]
Add -Werror for Clang and LLVM on Clang (headers) syntax tests.

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

14 years agoAdd a Thunk struct to the vtable builder.
Anders Carlsson [Thu, 26 Nov 2009 03:25:13 +0000 (03:25 +0000)]
Add a Thunk struct to the vtable builder.

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

14 years agoUse the more general Evaluate infrastructure for folding constant DeclRefs
Eli Friedman [Thu, 26 Nov 2009 03:22:21 +0000 (03:22 +0000)]
Use the more general Evaluate infrastructure for folding constant DeclRefs
instead of checking explicitly for an EnumConstantDecl.  This folds references
to constant integer VarDecls, which has two benefits:

1. Slightly smaller emitted code from emitting a constant instead of a load,
and skipping emitting some constant globals.
2. Some code forgets to define static constant member variables; emitting a
load instead of the value in that case leads to a link error. (Such programs
are technically not well-formed, but in practice build with g++.)

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

14 years agoAdd a CovariantThunkAdjustment struct that represents the adjustments needed for...
Anders Carlsson [Thu, 26 Nov 2009 03:09:37 +0000 (03:09 +0000)]
Add a CovariantThunkAdjustment struct that represents the adjustments needed for a covariant thunk.

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

14 years agoSlight tweak to the algorithm for getLinkage().
Eli Friedman [Thu, 26 Nov 2009 03:04:01 +0000 (03:04 +0000)]
Slight tweak to the algorithm for getLinkage().

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

14 years agoUse new getLinkage() method to correctly compute whether a variable has
Eli Friedman [Thu, 26 Nov 2009 02:52:12 +0000 (02:52 +0000)]
Use new getLinkage() method to correctly compute whether a variable has
internal linkage.  Fixes PR5433.

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

14 years agoMove the mangler into the CodeGen namespace. Change mangleThunk to take a ThunkAdjust...
Anders Carlsson [Thu, 26 Nov 2009 02:49:32 +0000 (02:49 +0000)]
Move the mangler into the CodeGen namespace. Change mangleThunk to take a ThunkAdjustment.

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

14 years agoAdd a PostVisitBlockExpr() method to RetainReleaseChecker to query for
Ted Kremenek [Thu, 26 Nov 2009 02:38:19 +0000 (02:38 +0000)]
Add a PostVisitBlockExpr() method to RetainReleaseChecker to query for
the set of variables "captured" by a block.  Until the analysis gets
more sophisticated, for now we stop the retain count tracking of any
objects (transitively) referenced by these variables.

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

14 years agoTeach RegionStoreManager::RemoveDeadBindings() about BlockDataRegions. Any VarRegion...
Ted Kremenek [Thu, 26 Nov 2009 02:35:42 +0000 (02:35 +0000)]
Teach RegionStoreManager::RemoveDeadBindings() about BlockDataRegions.  Any VarRegion for a "captured" variable should also be considered live.

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

14 years agoAdd iterators to BlockDataRegion that allow clients to iterate over the VarRegions...
Ted Kremenek [Thu, 26 Nov 2009 02:34:36 +0000 (02:34 +0000)]
Add iterators to BlockDataRegion that allow clients to iterate over the VarRegions for "captured" variables for a block.

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

14 years agoAdded batch versions of GRState::scanReachableSymbols() so that clients can scan...
Ted Kremenek [Thu, 26 Nov 2009 02:32:19 +0000 (02:32 +0000)]
Added batch versions of GRState::scanReachableSymbols() so that clients can scan a collection of SVals or MemRegions all at once.

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

14 years agoAdd a ThunkAdjustment struct which holds a non-virtual and a virtual adjustment offse...
Anders Carlsson [Thu, 26 Nov 2009 02:32:05 +0000 (02:32 +0000)]
Add a ThunkAdjustment struct which holds a non-virtual and a virtual adjustment offset. Start using it. General cleanup in Mangle.cpp.

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

14 years agoEnhance LiveVariables to understand that blocks can extend the liveness of a variable...
Ted Kremenek [Thu, 26 Nov 2009 02:31:33 +0000 (02:31 +0000)]
Enhance LiveVariables to understand that blocks can extend the liveness of a variable by "capturing" them in a BlockExpr.

This required two changes:

1) Added 'getReferencedgetReferencedBlockVars()' to AnalysisContext so
that clients can iterate over the "captured" variables in a block.

2) Modified LiveVariables to take an AnalysisContext& in its
constructor and to call getReferencedgetReferencedBlockVars() when it
processes a BlockExpr*.

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

14 years agoAdd C++ tests to try to parse and compile the LLVM libraries
Douglas Gregor [Thu, 26 Nov 2009 02:28:53 +0000 (02:28 +0000)]
Add C++ tests to try to parse and compile the LLVM libraries

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

14 years agoFactor out a LangStandard class and coalesce the information about the standards...
Daniel Dunbar [Thu, 26 Nov 2009 02:14:31 +0000 (02:14 +0000)]
Factor out a LangStandard class and coalesce the information about the standards into LangStandards.def
 - I'd appreciate another pair of eyeballs to double check this.

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

14 years agoFix thinko (-fno-builtin != -nobuiltininc).
Daniel Dunbar [Thu, 26 Nov 2009 02:14:16 +0000 (02:14 +0000)]
Fix thinko (-fno-builtin != -nobuiltininc).

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

14 years agoAdd clang -cc1 parsing for preprocessor options.
Daniel Dunbar [Thu, 26 Nov 2009 02:14:07 +0000 (02:14 +0000)]
Add clang -cc1 parsing for preprocessor options.

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

14 years agoAdd clang -cc1 parsing for header search options.
Daniel Dunbar [Thu, 26 Nov 2009 02:13:54 +0000 (02:13 +0000)]
Add clang -cc1 parsing for header search options.

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

14 years agoRefactor our handling of expression evaluation contexts, so that Sema
Douglas Gregor [Thu, 26 Nov 2009 00:44:06 +0000 (00:44 +0000)]
Refactor our handling of expression evaluation contexts, so that Sema
maintains a stack of evaluation contexts rather than having the parser
do it. This change made it simpler to track in which contexts
temporaries were created, so that we could...

"Forget" about temporaries created within unevaluated contexts, so
that we don't build a CXXExprWithTemporaries and, therefore, destroy
the integral-constness of our expressions. Fixes PR5609.

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

14 years agoAdd missing case in switch statement.
Ted Kremenek [Wed, 25 Nov 2009 23:58:21 +0000 (23:58 +0000)]
Add missing case in switch statement.

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

14 years agoRefine MemRegions for blocks. Add a new region called
Ted Kremenek [Wed, 25 Nov 2009 23:53:07 +0000 (23:53 +0000)]
Refine MemRegions for blocks.  Add a new region called
'BlockDataRegion' to distinguish between the code associated with a
block (which is represented by 'BlockTextRegion') and an instance of a
block, which includes both code and data.  'BlockDataRegion' has an
associated LocationContext, which can be used to eventually model the
lifetime of a block object once LocationContexts can represent scopes
(and iterations around a loop, etc.).

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

14 years agoRemove recently added FIXME. The appropriate FIXME is already in MemRegionManager...
Ted Kremenek [Wed, 25 Nov 2009 23:30:34 +0000 (23:30 +0000)]
Remove recently added FIXME.  The appropriate FIXME is already in MemRegionManager::getVarRegion().

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

14 years agoAllow user re-definition of SEL as well as accessing its fields.
Fariborz Jahanian [Wed, 25 Nov 2009 23:07:42 +0000 (23:07 +0000)]
Allow user re-definition of SEL as well as accessing its fields.
This fixes pr5611.

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

14 years agoFix attribute between function decl ')' and '{' or '=0'
John Thompson [Wed, 25 Nov 2009 22:58:06 +0000 (22:58 +0000)]
Fix attribute between function decl ')' and '{' or '=0'

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

14 years agoAdd FIXME.
Ted Kremenek [Wed, 25 Nov 2009 22:41:34 +0000 (22:41 +0000)]
Add FIXME.

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

14 years agoImplement the rules in C++ [basic.link] and C99 6.2.2 for computing
Douglas Gregor [Wed, 25 Nov 2009 22:24:25 +0000 (22:24 +0000)]
Implement the rules in C++ [basic.link] and C99 6.2.2 for computing
the linkage of a declaration. Switch the lame (and completely wrong)
NamedDecl::hasLinkage() over to using the new NamedDecl::getLinkage(),
along with the "can this declaration be a template argument?" check
that started all of this.

Fixes -fsyntax-only for PR5597.

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

14 years agoAdd post-visit Checker support in GRExprEngine for BlockExpr.
Ted Kremenek [Wed, 25 Nov 2009 22:23:25 +0000 (22:23 +0000)]
Add post-visit Checker support in GRExprEngine for BlockExpr.

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

14 years agoAdd a new RetainReleaseChecker class (that subclasses CheckerVisitor) to extend the...
Ted Kremenek [Wed, 25 Nov 2009 22:17:44 +0000 (22:17 +0000)]
Add a new RetainReleaseChecker class (that subclasses CheckerVisitor) to extend the functionality of the retain/release checker using the new Checker interface.  Pieces of CFRefCount will gradually be migrated to this new class over time.

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

14 years agoMove RegisterChecks() to the end of the file. No functionality change.
Ted Kremenek [Wed, 25 Nov 2009 22:08:49 +0000 (22:08 +0000)]
Move RegisterChecks() to the end of the file.  No functionality change.

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

14 years agoCall GRExprEngine::setTransferFunctions() after registering all Checkers. This allow...
Ted Kremenek [Wed, 25 Nov 2009 21:58:39 +0000 (21:58 +0000)]
Call GRExprEngine::setTransferFunctions() after registering all Checkers.  This allows GRTransferFuncs::RegisterChecks() to always be called after all checkers have been registered.

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

14 years agoConsolidate logic in ActionInlineCall by having it call ActionGRExprEngine instead...
Ted Kremenek [Wed, 25 Nov 2009 21:55:23 +0000 (21:55 +0000)]
Consolidate logic in ActionInlineCall by having it call ActionGRExprEngine instead of replicating most of its logic (and missing pieces).

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

14 years agoBetter diagnostic on deleted constructor when no
Fariborz Jahanian [Wed, 25 Nov 2009 21:53:11 +0000 (21:53 +0000)]
Better diagnostic on deleted constructor when no
initializer name is available.

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

14 years agoMake RegisterInternalChecks() part of GRExprEngine's private implementation by making...
Ted Kremenek [Wed, 25 Nov 2009 21:51:20 +0000 (21:51 +0000)]
Make RegisterInternalChecks() part of GRExprEngine's private implementation by making it a static function within GRExprEngine.cpp.

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

14 years agoRegister internal checks with GRExprEngine when it is constructed, not manually in...
Ted Kremenek [Wed, 25 Nov 2009 21:45:48 +0000 (21:45 +0000)]
Register internal checks with GRExprEngine when it is constructed, not manually in AnalysisConsumer.cpp.

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

14 years agoWhen dispatching to Checker objects in GRExprEngine::CheckerVisit(),
Ted Kremenek [Wed, 25 Nov 2009 21:40:22 +0000 (21:40 +0000)]
When dispatching to Checker objects in GRExprEngine::CheckerVisit(),
only stop processing the checkers after all the nodes for a current
check have been processed.  This (I believe) handles the case where
PredSet (the input nodes) contains more than one node due to state
bifurcation.  Zhongxing: can you review this?

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

14 years agoTweak expected error to match what should happen, once using declarations work
Douglas Gregor [Wed, 25 Nov 2009 19:28:08 +0000 (19:28 +0000)]
Tweak expected error to match what should happen, once using declarations work

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

14 years agoTweak expected error message, although we still fail this test
Douglas Gregor [Wed, 25 Nov 2009 19:25:39 +0000 (19:25 +0000)]
Tweak expected error message, although we still fail this test

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

14 years agoImplement support for default template arguments of function templates.
Douglas Gregor [Wed, 25 Nov 2009 18:55:14 +0000 (18:55 +0000)]
Implement support for default template arguments of function templates.

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

14 years agoDiagnose ill-formed uses of default template arguments in
Douglas Gregor [Wed, 25 Nov 2009 17:50:39 +0000 (17:50 +0000)]
Diagnose ill-formed uses of default template arguments in
function templates (in C++98), friend function templates, and
out-of-line definitions of members of class templates.

Also handles merging of default template arguments from previous
declarations of function templates, for C++0x. However, we don't yet
make use of those default template arguments.

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

14 years agoUse StringRef (again) in DebugInfo interface.
Devang Patel [Wed, 25 Nov 2009 17:37:31 +0000 (17:37 +0000)]
Use StringRef (again) in DebugInfo interface.

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

14 years agoFix a thinko where we weren't always performing unary conversions on the switch condi...
Douglas Gregor [Wed, 25 Nov 2009 15:17:36 +0000 (15:17 +0000)]
Fix a thinko where we weren't always performing unary conversions on the switch condition, fixing PR5612

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

14 years agoWhat the FIXMEs want, the FIXMEs shall have.
Daniel Dunbar [Wed, 25 Nov 2009 11:53:23 +0000 (11:53 +0000)]
What the FIXMEs want, the FIXMEs shall have.

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

14 years agoAdd an arg_iterator, for iterating over a subset of arguments in an ArgList.
Daniel Dunbar [Wed, 25 Nov 2009 11:33:30 +0000 (11:33 +0000)]
Add an arg_iterator, for iterating over a subset of arguments in an ArgList.

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

14 years agoAdd a missing include <cstdio>
Daniel Dunbar [Wed, 25 Nov 2009 10:53:00 +0000 (10:53 +0000)]
Add a missing include <cstdio>

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

14 years agoFix some uses of fprintf/stderr without a prototype.
Daniel Dunbar [Wed, 25 Nov 2009 10:27:48 +0000 (10:27 +0000)]
Fix some uses of fprintf/stderr without a prototype.

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

14 years agoAdd clang -cc1 parsing for frontend options.
Daniel Dunbar [Wed, 25 Nov 2009 10:14:52 +0000 (10:14 +0000)]
Add clang -cc1 parsing for frontend options.

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

14 years agoAdd ParseSourceLocation::FromString, and simplify.
Daniel Dunbar [Wed, 25 Nov 2009 10:14:44 +0000 (10:14 +0000)]
Add ParseSourceLocation::FromString, and simplify.

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

14 years agoAdd clang -cc1 parsing for preprocessor output options (-E).
Daniel Dunbar [Wed, 25 Nov 2009 10:14:37 +0000 (10:14 +0000)]
Add clang -cc1 parsing for preprocessor output options (-E).

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

14 years agoDon't pass -fexceptions=0 (it is the default).
Daniel Dunbar [Wed, 25 Nov 2009 10:14:30 +0000 (10:14 +0000)]
Don't pass -fexceptions=0 (it is the default).

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

14 years agoThis patch streamlines CheckerVisitor.def so that it follows the usual '#ifndef foo...
Kovarththanan Rajaratnam [Wed, 25 Nov 2009 08:37:20 +0000 (08:37 +0000)]
This patch streamlines CheckerVisitor.def so that it follows the usual '#ifndef foo' pattern:

#ifndef foo
#define foo(parm1)
#endif

foo(parm1) parm1 ...

#undef foo

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

14 years agoFix for Path::isSpecialFile to Path::isRegularFile API in rev 89765.
Edward O'Callaghan [Wed, 25 Nov 2009 06:33:27 +0000 (06:33 +0000)]
Fix for Path::isSpecialFile to Path::isRegularFile API in rev 89765.

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

14 years agoWhen the condition of a switch() statement is semantically invalid,
Douglas Gregor [Wed, 25 Nov 2009 06:20:02 +0000 (06:20 +0000)]
When the condition of a switch() statement is semantically invalid,
still parse the body of the switch to try to avoid spurious
diagnostics. Fixes PR5606.

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

14 years agoDon't crash when we re-use a template specialization node for an explicit instantiati...
Douglas Gregor [Wed, 25 Nov 2009 06:01:46 +0000 (06:01 +0000)]
Don't crash when we re-use a template specialization node for an explicit instantiation. lib/Support/CommandLine.cpp is our test case

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

14 years agoRefactor ActOnFinishSwitchStmt to simplify it further
Douglas Gregor [Wed, 25 Nov 2009 05:02:21 +0000 (05:02 +0000)]
Refactor ActOnFinishSwitchStmt to simplify it further

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

14 years agoRefactor ActOnFinishSwitchStmt to simplify and reduce nesting
Douglas Gregor [Wed, 25 Nov 2009 04:55:54 +0000 (04:55 +0000)]
Refactor ActOnFinishSwitchStmt to simplify and reduce nesting

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

14 years agoParse C++ member check attributes - base_check, hiding, and override.
Sean Hunt [Wed, 25 Nov 2009 04:20:27 +0000 (04:20 +0000)]
Parse C++ member check attributes - base_check, hiding, and override.
The attributes are currently ignored.

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

14 years agoDon't try to install .dir files.
Daniel Dunbar [Wed, 25 Nov 2009 03:46:30 +0000 (03:46 +0000)]
Don't try to install .dir files.

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

14 years agoAdd VTT parameter to base ctors/dtors with virtual bases. (They aren't used yet).
Anders Carlsson [Wed, 25 Nov 2009 03:15:49 +0000 (03:15 +0000)]
Add VTT parameter to base ctors/dtors with virtual bases. (They aren't used yet).

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

14 years agoUndefResults is not needed.
Zhongxing Xu [Wed, 25 Nov 2009 03:07:22 +0000 (03:07 +0000)]
UndefResults is not needed.

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

14 years agoImplement proper cleanup semantics for condition variables in for
Douglas Gregor [Wed, 25 Nov 2009 01:51:31 +0000 (01:51 +0000)]
Implement proper cleanup semantics for condition variables in for
statements, e.g.,

  for(; X x = X(); ) { ... }

Daniel or Anders, please review!

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

14 years agoAdd really basic support for blocks in the retain/release checker. For now, anytime...
Ted Kremenek [Wed, 25 Nov 2009 01:35:18 +0000 (01:35 +0000)]
Add really basic support for blocks in the retain/release checker.  For now, anytime we pass a tracked object to a block call we stop tracking it.

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

14 years agoAllow building of CFGs for ASTs that contain BlockExprs.
Ted Kremenek [Wed, 25 Nov 2009 01:34:30 +0000 (01:34 +0000)]
Allow building of CFGs for ASTs that contain BlockExprs.

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

14 years agoAdd transfer function support for BlockExpr.
Ted Kremenek [Wed, 25 Nov 2009 01:33:13 +0000 (01:33 +0000)]
Add transfer function support for BlockExpr.

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

14 years agoSplit CodeTextRegion into FunctionTextRegion and BlockTextRegion. This a precursor...
Ted Kremenek [Wed, 25 Nov 2009 01:32:22 +0000 (01:32 +0000)]
Split CodeTextRegion into FunctionTextRegion and BlockTextRegion.  This a precursor to having basic static analysis support for blocks.

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

14 years agoSome fancy footwork to move the decision on how
Fariborz Jahanian [Wed, 25 Nov 2009 01:26:41 +0000 (01:26 +0000)]
Some fancy footwork to move the decision on how
to build casted expression-list AST to Sema.

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

14 years agoQualify the name of the llvm::cast template. I am somewhat amazed that GCC parsed...
Douglas Gregor [Wed, 25 Nov 2009 00:38:36 +0000 (00:38 +0000)]
Qualify the name of the llvm::cast template. I am somewhat amazed that GCC parsed this

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

14 years agoDon't try to parse LinkAllParses.h for now
Douglas Gregor [Wed, 25 Nov 2009 00:31:20 +0000 (00:31 +0000)]
Don't try to parse LinkAllParses.h for now

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

14 years agoTweak the code-generation-for-condition-variables test case to get to what we want...
Douglas Gregor [Wed, 25 Nov 2009 00:29:29 +0000 (00:29 +0000)]
Tweak the code-generation-for-condition-variables test case to get to what we want to test

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

14 years agoEliminate CXXConditionDeclExpr with extreme prejudice.
Douglas Gregor [Wed, 25 Nov 2009 00:27:52 +0000 (00:27 +0000)]
Eliminate CXXConditionDeclExpr with extreme prejudice.

All statements that involve conditions can now hold on to a separate
condition declaration (a VarDecl), and will use a DeclRefExpr
referring to that VarDecl for the condition expression. ForStmts now
have such a VarDecl (I'd missed those in previous commits).

Also, since this change reworks the Action interface for
if/while/switch/for, use FullExprArg for the full expressions in those
expressions, to ensure that we're emitting

Note that we are (still) not generating the right cleanups for
condition variables in for statements. That will be a follow-on
commit.

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

14 years agoHave the parser tell sema whether a member declaration is a function definition....
Sebastian Redl [Tue, 24 Nov 2009 23:38:44 +0000 (23:38 +0000)]
Have the parser tell sema whether a member declaration is a function definition. This allows sema to not emit spurious diagnostics in some invalid code.

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

14 years agoConvert test case to FileCheck to test the behavior of the nil-receiver checker when...
Ted Kremenek [Tue, 24 Nov 2009 22:56:53 +0000 (22:56 +0000)]
Convert test case to FileCheck to test the behavior of the nil-receiver checker when the code is targetted for either Tiger or Leopard.

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

14 years agoFor the nil-receiver checker, take into account the behavioral changes that got intro...
Ted Kremenek [Tue, 24 Nov 2009 22:48:18 +0000 (22:48 +0000)]
For the nil-receiver checker, take into account the behavioral changes that got introduced in Mac OS X 10.5 and later, notably return values of double, float, etc., will not be garbage.  Fixes <rdar://problem/6829160>.

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

14 years agoCleanups and fixes to the nil-receiver checker, some of it fallout the
Ted Kremenek [Tue, 24 Nov 2009 21:41:28 +0000 (21:41 +0000)]
Cleanups and fixes to the nil-receiver checker, some of it fallout the
initial transition of the nil-receiver checker to the Checker
interface as done in r89745.  Some important changes include:

1) We consolidate the BugType object used for nil receiver bug
reports, and don't include the type of the returned value in the
BugType (which would be wrong if a nil receiver bug was reported more
than once)

2) Added a new (temporary) flag to CheckerContext: DoneEvauating.
This is used by GRExprEngine when evaluating message expressions to
not continue evaluating the message expression if this flag is set.
This flag is currently set by the nil receiver checker.  This is an
intermediate solution to allow the nil-receiver checker to properly
work as a plug-in outside of GRExprEngine.  Basically, this flag
indicates that the entire message expression has been evaluated, not
just a precondition (which is what the nil-receiver checker does).
This flag *should not* be repurposed for general use, but just to pull
more things out of GRExprEngine that already in there as we devise a
better interface in the Checker class.

3) Cleaned up the logic in the nil-receiver checker, making the
control-flow a lot easier to read.

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

14 years agoRefactor argument collection of constructor calls using
Fariborz Jahanian [Tue, 24 Nov 2009 21:37:28 +0000 (21:37 +0000)]
Refactor argument collection of constructor calls using
the common routine.

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

14 years ago"Do" loops cannot have condition variables, so don't parse them.
Douglas Gregor [Tue, 24 Nov 2009 21:34:32 +0000 (21:34 +0000)]
"Do" loops cannot have condition variables, so don't parse them.

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

14 years agoClean up the AST for while loops and fix several problems with
Douglas Gregor [Tue, 24 Nov 2009 21:15:44 +0000 (21:15 +0000)]
Clean up the AST for while loops and fix several problems with
cleanups for while loops:

1) Make sure that we destroy the condition variable of a while statement each time through the loop for, e.g.,

   while (shared_ptr<WorkInt> p = getWorkItem()) {
         // ...
         }

2) Make sure that we always enter a new cleanup scope for the body of the while loop, even when there is no compound expression, e.g.,

   while (blah)
     RAIIObject raii(blah+1);

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

14 years agoHandle references correctly when synthesizing copy constructors.
Anders Carlsson [Tue, 24 Nov 2009 21:08:10 +0000 (21:08 +0000)]
Handle references correctly when synthesizing copy constructors.

With this change, the clang-on-clang test result is now

Expected Passes    : 224
Unexpected Failures: 37

Which means that we can compile over 80% of clang with clang! :)

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

14 years agoFix some major problems dealing with dependently-qualified names in implicit
John McCall [Tue, 24 Nov 2009 20:33:45 +0000 (20:33 +0000)]
Fix some major problems dealing with dependently-qualified names in implicit
member-reference contexts.  Fixes some clang-on-clang asserts.

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

14 years agoFix the test case failed in buildbot.
Fariborz Jahanian [Tue, 24 Nov 2009 19:37:10 +0000 (19:37 +0000)]
Fix the test case failed in buildbot.

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

14 years agoMore cleanup of argument call collection.
Fariborz Jahanian [Tue, 24 Nov 2009 19:27:49 +0000 (19:27 +0000)]
More cleanup of argument call collection.

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

14 years agoRip out TemplateIdRefExpr and make UnresolvedLookupExpr and
John McCall [Tue, 24 Nov 2009 19:00:30 +0000 (19:00 +0000)]
Rip out TemplateIdRefExpr and make UnresolvedLookupExpr and
DependentScopeDeclRefExpr support storing templateids.  Unite the common
code paths between ActOnDeclarationNameExpr and ActOnTemplateIdExpr.

This gets us to a point where we don't need to store function templates in
the AST using TemplateNames, which is critical to ripping out OverloadedFunction.

Also resolves a few FIXMEs.

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

14 years agoDeclarationName::getIdentifier should take a const IdentifierInfo, since the
John McCall [Tue, 24 Nov 2009 18:44:29 +0000 (18:44 +0000)]
DeclarationName::getIdentifier should take a const IdentifierInfo, since the
constructor does anyway.

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

14 years agoHandle cases where we're constructing an array of objects and the constructor has...
Anders Carlsson [Tue, 24 Nov 2009 18:43:52 +0000 (18:43 +0000)]
Handle cases where we're constructing an array of objects and the constructor has default arguments.

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

14 years agoHelper function for turning a TemplateName into a DeclarationName.
John McCall [Tue, 24 Nov 2009 18:42:40 +0000 (18:42 +0000)]
Helper function for turning a TemplateName into a DeclarationName.

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