]> granicus.if.org Git - clang/log
clang
14 years agoFix for PR5568.
Edward O'Callaghan [Tue, 24 Nov 2009 15:23:21 +0000 (15:23 +0000)]
Fix for PR5568.

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

14 years agoRemove trailing spaces
Kovarththanan Rajaratnam [Tue, 24 Nov 2009 14:30:21 +0000 (14:30 +0000)]
Remove trailing spaces

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

14 years agoAdd getByteSize() and getTypeSizeInBytes().
Ken Dyck [Tue, 24 Nov 2009 12:04:54 +0000 (12:04 +0000)]
Add getByteSize() and getTypeSizeInBytes().

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

14 years agoWe can remove this file now.
Zhongxing Xu [Tue, 24 Nov 2009 08:28:49 +0000 (08:28 +0000)]
We can remove this file now.

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

14 years agoRefactor undefined result checker. This is the last one.
Zhongxing Xu [Tue, 24 Nov 2009 08:24:26 +0000 (08:24 +0000)]
Refactor undefined result checker. This is the last one.

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

14 years agoRefactor NilReceiverStructRet and NilReceiverLargerThanVoidPtrRet into
Zhongxing Xu [Tue, 24 Nov 2009 07:06:39 +0000 (07:06 +0000)]
Refactor NilReceiverStructRet and NilReceiverLargerThanVoidPtrRet into
CallAndMessageChecker.

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

14 years agoRemove trailing spaces
Kovarththanan Rajaratnam [Tue, 24 Nov 2009 06:30:23 +0000 (06:30 +0000)]
Remove trailing spaces

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

14 years agoGet rid of the ugly CGCXX names and replace them with CGClass, CGExprCXX and CGTempor...
Anders Carlsson [Tue, 24 Nov 2009 05:51:11 +0000 (05:51 +0000)]
Get rid of the ugly CGCXX names and replace them with CGClass, CGExprCXX and CGTemporaries.

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

14 years agoWhen mangling a ctor/dtor we need to take into consideration whether it's a member...
Anders Carlsson [Tue, 24 Nov 2009 05:36:32 +0000 (05:36 +0000)]
When mangling a ctor/dtor we need to take into consideration whether it's a member template.

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

14 years agoSet the template specialization kind before instantiating the function definition...
Anders Carlsson [Tue, 24 Nov 2009 05:34:41 +0000 (05:34 +0000)]
Set the template specialization kind before instantiating the function definition so that the function will have the right linkage.

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

14 years agoTeach Evaluate to handle member expressions referring to enum constants and
Eli Friedman [Tue, 24 Nov 2009 05:28:59 +0000 (05:28 +0000)]
Teach Evaluate to handle member expressions referring to enum constants and
static member constants. No significant visible difference at the moment
because it conservatively assumes the base has side effects. I'm planning to
use this for CodeGen.

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

14 years agoIgnore constructor member templates in CodeGenModule::EmitTopLevelDecl.
Anders Carlsson [Tue, 24 Nov 2009 05:16:24 +0000 (05:16 +0000)]
Ignore constructor member templates in CodeGenModule::EmitTopLevelDecl.

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

14 years agoIt is common for vtables to contain pointers to functions that have either incomplete...
Anders Carlsson [Tue, 24 Nov 2009 05:08:52 +0000 (05:08 +0000)]
It is common for vtables to contain pointers to functions that have either incomplete return types or incomplete argument types.

Handle this by returning the llvm::OpaqueType for those cases, which CodeGenModule::GetOrCreateLLVMFunction knows about, and treats as being an "incomplete function".

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

14 years agorename UndefinedArgChecker to CallAndMessageChecker.
Zhongxing Xu [Tue, 24 Nov 2009 04:45:44 +0000 (04:45 +0000)]
rename UndefinedArgChecker to CallAndMessageChecker.

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

14 years agoRename: UndefinedArgChecker.cpp => CallAndMessageChecker.cpp
Zhongxing Xu [Tue, 24 Nov 2009 04:08:01 +0000 (04:08 +0000)]
Rename: UndefinedArgChecker.cpp => CallAndMessageChecker.cpp

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

14 years agoEnhance null dereference diagnostics by indicating what variable (if any) was derefer...
Ted Kremenek [Tue, 24 Nov 2009 01:33:10 +0000 (01:33 +0000)]
Enhance null dereference diagnostics by indicating what variable (if any) was dereferenced.  Addresses <rdar://problem/7039161>.

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

14 years agoSketch the rest of the clang -cc1 option definitions, aka fun with C-x C-(.
Daniel Dunbar [Tue, 24 Nov 2009 00:54:16 +0000 (00:54 +0000)]
Sketch the rest of the clang -cc1 option definitions, aka fun with C-x C-(.

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

14 years agoExplicitly track the condition variable within an "if" statement,
Douglas Gregor [Mon, 23 Nov 2009 23:44:04 +0000 (23:44 +0000)]
Explicitly track the condition variable within an "if" statement,
rather than burying it in a CXXConditionDeclExpr (that occassionally
hides behind implicit conversions). Similar changes for
switch, while, and do-while will follow, then the removal of
CXXConditionDeclExpr. This commit is the canary.

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

14 years agoAdd clang -cc1 parsing of diagnostic options.
Daniel Dunbar [Mon, 23 Nov 2009 23:41:17 +0000 (23:41 +0000)]
Add clang -cc1 parsing of diagnostic options.

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

14 years agoAfter performing a bounds check in ArrayBoundChecker, record the fact that a bounds...
Ted Kremenek [Mon, 23 Nov 2009 23:23:26 +0000 (23:23 +0000)]
After performing a bounds check in ArrayBoundChecker, record the fact that a bounds check succeeded by transitioning the ExplodedGraph.

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

14 years agoClean up the Checker API a little more, resolving some hidden bugs
Ted Kremenek [Mon, 23 Nov 2009 22:22:01 +0000 (22:22 +0000)]
Clean up the Checker API a little more, resolving some hidden bugs
along the way.  Important changes:

1) To generate a sink node, use GenerateSink(); GenerateNode() is for
generating regular transitions.  This makes the API clearer and also
allows us to use the 'bool' option to GenerateNode() for a different
purpose.

2) GenerateNode() now automatically adds the generated node to the
destination ExplodedNodeSet (autotransition) unless the client
specifies otherwise with a bool flag.  Several checkers did not call
'addTransition()' after calling 'GenerateNode()', causing the
simulation path to be prematurely culled when a non-fail stop bug was
encountered.

3) Add variants of GenerateNode()/GenerateSink() that take neither a
Stmt* or a GRState*; most callers of GenerateNode() just pass in the
same Stmt* as provided when the CheckerContext object is created; we
can just use that the majority of the time.  This cleanup also allows
us to potentially coelesce the APIs for evaluating branches and
end-of-paths (which currently directly use builders).

4) addTransition() no longer needs to be called except for a few
cases.  We now have a variant of addTransition() that takes a
GRState*; this allows one to propagate the updated state without
caring about generating a new node explicitly.  This nicely cleaned up
a bunch of cases that called autoTransition() with a bunch of
conditional logic surround the call (that common logic has now been
swallowed up by addTransition() itself).

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

14 years agoDon't try to treat an enum constant as an lvalue.
Anders Carlsson [Mon, 23 Nov 2009 21:56:41 +0000 (21:56 +0000)]
Don't try to treat an enum constant as an lvalue.

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

14 years agoConvert the && and || operands to bool using standard conversions. Fixes PR5593.
Anders Carlsson [Mon, 23 Nov 2009 21:47:44 +0000 (21:47 +0000)]
Convert the && and || operands to bool using standard conversions. Fixes PR5593.

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

14 years agoFixe a crash in encoding of SEL type caused by recent changes.
Fariborz Jahanian [Mon, 23 Nov 2009 20:40:50 +0000 (20:40 +0000)]
Fixe a crash in encoding of SEL type caused by recent changes.

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

14 years agoHandle converting member pointers to bool.
Anders Carlsson [Mon, 23 Nov 2009 20:04:44 +0000 (20:04 +0000)]
Handle converting member pointers to bool.

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

14 years agoFix a recent regression probably caused by addition of altivec-style
Fariborz Jahanian [Mon, 23 Nov 2009 19:51:43 +0000 (19:51 +0000)]
Fix a recent regression probably caused by addition of altivec-style
type-casts in the parser.

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

14 years agoProvide out-of-line definition for destructor of Checker.
Ted Kremenek [Mon, 23 Nov 2009 18:53:03 +0000 (18:53 +0000)]
Provide out-of-line definition for destructor of Checker.

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

14 years agoTweak UndefBranchChecker to register the most nested "undefined" expression with...
Ted Kremenek [Mon, 23 Nov 2009 18:12:03 +0000 (18:12 +0000)]
Tweak UndefBranchChecker to register the most nested "undefined" expression with bugreporter::registerTrackNullOrUndefValue instead of the condition itself.

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

14 years agoMake 'SEL' pointer to a builtin type and not an
Fariborz Jahanian [Mon, 23 Nov 2009 18:04:25 +0000 (18:04 +0000)]
Make 'SEL' pointer to a builtin type and not an
objective-c pointer type. This was a serious mishap and
luckily, Ted's test caught that (and patch fixes the test case).

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

14 years agoCleanup title/description of "undefined branch" BugType and add some test cases for...
Ted Kremenek [Mon, 23 Nov 2009 17:58:48 +0000 (17:58 +0000)]
Cleanup title/description of "undefined branch" BugType and add some test cases for this check.

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

14 years agoHandle base-to-derived casts. Will land test case shortly.
Anders Carlsson [Mon, 23 Nov 2009 17:57:54 +0000 (17:57 +0000)]
Handle base-to-derived casts. Will land test case shortly.

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

14 years agoPut back hard-coded paths for win32 until I figure out what happened to failed tests.
John Thompson [Mon, 23 Nov 2009 17:49:27 +0000 (17:49 +0000)]
Put back hard-coded paths for win32 until I figure out what happened to failed tests.

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

14 years agoRemove '-checker-simple' reference from scan-build. Patch by Kovarththanan Rajaratnam!
Ted Kremenek [Mon, 23 Nov 2009 17:37:58 +0000 (17:37 +0000)]
Remove '-checker-simple' reference from scan-build.  Patch by Kovarththanan Rajaratnam!

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

14 years agoIntercept sizeof and alignof references before they get into ASTContext methods....
Sebastian Redl [Mon, 23 Nov 2009 17:18:46 +0000 (17:18 +0000)]
Intercept sizeof and alignof references before they get into ASTContext methods. This fixes a crash when writing sizeof(Incomplete&), and lets ASTContext's methods do the right thing for CodeGen, which fixes PR5590.

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

14 years agoReorder the header search a bit so that it matches gcc exactly:
Rafael Espindola [Mon, 23 Nov 2009 16:31:19 +0000 (16:31 +0000)]
Reorder the header search a bit so that it matches gcc exactly:

*) the ../backward dir is the last in libstdc++ to be searched
*) If compiling c++, the c++ headers are searched first

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

14 years agoLet using directives refer to namespace aliases. Fixes PR5479.
Sebastian Redl [Mon, 23 Nov 2009 15:34:23 +0000 (15:34 +0000)]
Let using directives refer to namespace aliases. Fixes PR5479.

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

14 years agoRequire a class type to be complete before probing its conversion
Douglas Gregor [Mon, 23 Nov 2009 13:53:21 +0000 (13:53 +0000)]
Require a class type to be complete before probing its conversion
functions for a switch condition's conversion to integral or
enumeration type.

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

14 years agoImplement conversion from a switch condition with class type to an
Douglas Gregor [Mon, 23 Nov 2009 13:46:08 +0000 (13:46 +0000)]
Implement conversion from a switch condition with class type to an
integral or enumeration type (vi user-defined conversions). Fixes PR5518.

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

14 years agoCanonical template arguments that are template template parameters by
Douglas Gregor [Mon, 23 Nov 2009 12:52:47 +0000 (12:52 +0000)]
Canonical template arguments that are template template parameters by
their template parameter depth and position, so that we can match
redeclarations appropriately. Fixes PR5527 and PR5528.

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

14 years agoImprove type-checking of templates by distinguishing between members
Douglas Gregor [Mon, 23 Nov 2009 12:39:54 +0000 (12:39 +0000)]
Improve type-checking of templates by distinguishing between members
of the current instantiation and members of an unknown specialization
when type-checking a qualified-if expression.

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

14 years agoDo not mark declarations as used when performing overload resolution. Fixes PR5541
Douglas Gregor [Mon, 23 Nov 2009 12:27:39 +0000 (12:27 +0000)]
Do not mark declarations as used when performing overload resolution. Fixes PR5541

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

14 years agoTolerate extraneous "template<>" headers better, downgrading the
Douglas Gregor [Mon, 23 Nov 2009 12:11:45 +0000 (12:11 +0000)]
Tolerate extraneous "template<>" headers better, downgrading the
complaint to a warning and providing a helpful node in the case where
the "template<>" header is redundant because the corresponding
template-id refers to an explicit specialization. C++0x might still
change this behavior, and existing practice is all over the place on
the number of "template<>" headers actually needed.

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

14 years agoFix CMake build
Douglas Gregor [Mon, 23 Nov 2009 12:03:50 +0000 (12:03 +0000)]
Fix CMake build

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

14 years agoCentralize and complete the computation of value- and type-dependence for DeclRefExprs
Douglas Gregor [Mon, 23 Nov 2009 11:41:28 +0000 (11:41 +0000)]
Centralize and complete the computation of value- and type-dependence for DeclRefExprs

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

14 years agoUndefBranchChecker: more bug reporter helper information emit.
Zhongxing Xu [Mon, 23 Nov 2009 03:29:59 +0000 (03:29 +0000)]
UndefBranchChecker: more bug reporter helper information emit.

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

14 years agoInitial refactor of UndefBranchChecker. We still use GRBranchNodeBuilder
Zhongxing Xu [Mon, 23 Nov 2009 03:20:54 +0000 (03:20 +0000)]
Initial refactor of UndefBranchChecker. We still use GRBranchNodeBuilder
in the checker directly. But I don't have a better approach for now.

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

14 years agoEncapsulate "an array of TemplateArgumentLocs and two angle bracket locations" into
John McCall [Mon, 23 Nov 2009 01:53:49 +0000 (01:53 +0000)]
Encapsulate "an array of TemplateArgumentLocs and two angle bracket locations" into
a new class.  Use it pervasively throughout Sema.

My fingers hurt.

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

14 years agoChange Clang-Code-Compile tests to only -emit-llvm instead of running
Daniel Dunbar [Mon, 23 Nov 2009 00:07:14 +0000 (00:07 +0000)]
Change Clang-Code-Compile tests to only -emit-llvm instead of running
codegen/as.

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

14 years agoTeach CodeGenFunction::EmitDecl to ignore Using and UsingShadow decls.
Daniel Dunbar [Mon, 23 Nov 2009 00:07:06 +0000 (00:07 +0000)]
Teach CodeGenFunction::EmitDecl to ignore Using and UsingShadow decls.

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

14 years agox86_64, PR5582: Layout bases for C++ records.
Daniel Dunbar [Sun, 22 Nov 2009 23:01:23 +0000 (23:01 +0000)]
x86_64, PR5582: Layout bases for C++ records.
 - Ideally we would have an single iteration interface for this, but this works
   for now.

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

14 years agoRecognize .hpp as a C++ header.
Daniel Dunbar [Sun, 22 Nov 2009 22:08:27 +0000 (22:08 +0000)]
Recognize .hpp as a C++ header.

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

14 years agoAdd clang -cc1 parsing of analyzer options.
Daniel Dunbar [Sun, 22 Nov 2009 22:08:20 +0000 (22:08 +0000)]
Add clang -cc1 parsing of analyzer options.

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

14 years agoCMake: Add support for running tests with valgrind.
Daniel Dunbar [Sun, 22 Nov 2009 21:55:22 +0000 (21:55 +0000)]
CMake: Add support for running tests with valgrind.

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

14 years agoFix LookupResult's sanity-check to handle shadow decls.
John McCall [Sun, 22 Nov 2009 20:57:36 +0000 (20:57 +0000)]
Fix LookupResult's sanity-check to handle shadow decls.

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

14 years agoChange CheckDeadStores to use Expr::isNullPointerConstant, which will correctly deter...
Ted Kremenek [Sun, 22 Nov 2009 20:26:21 +0000 (20:26 +0000)]
Change CheckDeadStores to use Expr::isNullPointerConstant, which will correctly determine whether an expression is a null pointer constant.

Patch by Kovarththanan Rajaratnam!

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

14 years agoUse EmitStoreOfScalar when copying the scalar to the space allocated by 'new'.
Anders Carlsson [Sun, 22 Nov 2009 19:25:33 +0000 (19:25 +0000)]
Use EmitStoreOfScalar when copying the scalar to the space allocated by 'new'.

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

14 years agoWhen laying out bitfields, make sure that the data size is always aligned to a byte...
Anders Carlsson [Sun, 22 Nov 2009 19:13:51 +0000 (19:13 +0000)]
When laying out bitfields, make sure that the data size is always aligned to a byte. This fixes PR5580.

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

14 years agoUpdate a test to FileCheck.
Anders Carlsson [Sun, 22 Nov 2009 18:56:40 +0000 (18:56 +0000)]
Update a test to FileCheck.

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

14 years agoUse intptr_t from stdint.h (in freestanding mode) instead of redefining it here
Ken Dyck [Sun, 22 Nov 2009 18:29:06 +0000 (18:29 +0000)]
Use intptr_t from stdint.h (in freestanding mode) instead of redefining it here
with __INTPTR_TYPE__.

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

14 years agoTest case for bug fixed in r89457.
David Chisnall [Sun, 22 Nov 2009 17:42:02 +0000 (17:42 +0000)]
Test case for bug fixed in r89457.

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

14 years agoMove bit-field layout out into a separate function. No functionality change.
Anders Carlsson [Sun, 22 Nov 2009 17:37:31 +0000 (17:37 +0000)]
Move bit-field layout out into a separate function. No functionality change.

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

14 years agoFix for PR5233.
Edward O'Callaghan [Sun, 22 Nov 2009 16:21:47 +0000 (16:21 +0000)]
Fix for PR5233.

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

14 years agoDefine SIG_ATOMIC_MIN and SIG_ATOMIC_MAX in terms of __SIG_ATOMIC_WIDTH__.
Ken Dyck [Sun, 22 Nov 2009 15:47:12 +0000 (15:47 +0000)]
Define SIG_ATOMIC_MIN and SIG_ATOMIC_MAX in terms of __SIG_ATOMIC_WIDTH__.

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

14 years agoDefine __SIG_ATOMIC_WIDTH__ for use in stdint.h.
Ken Dyck [Sun, 22 Nov 2009 15:41:04 +0000 (15:41 +0000)]
Define __SIG_ATOMIC_WIDTH__ for use in stdint.h.

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

14 years agoUndefined compound assignment result is checked in UndefinedAssignmentChecker. So...
Zhongxing Xu [Sun, 22 Nov 2009 13:36:20 +0000 (13:36 +0000)]
Undefined compound assignment result is checked in UndefinedAssignmentChecker. So this check is redundant.

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

14 years agoRemove invalid comments. The result is undefined only when operands are undefined.
Zhongxing Xu [Sun, 22 Nov 2009 13:30:10 +0000 (13:30 +0000)]
Remove invalid comments. The result is undefined only when operands are undefined.

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

14 years agoSave and restore the HasGen flag in MallocChecker.
Zhongxing Xu [Sun, 22 Nov 2009 13:22:34 +0000 (13:22 +0000)]
Save and restore the HasGen flag in MallocChecker.

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

14 years agoDon't include a dead header.
Benjamin Kramer [Sun, 22 Nov 2009 12:51:08 +0000 (12:51 +0000)]
Don't include a dead header.

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

14 years agoRemove UndefinedAssignmentChecker's header.
Zhongxing Xu [Sun, 22 Nov 2009 12:29:52 +0000 (12:29 +0000)]
Remove UndefinedAssignmentChecker's header.

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

14 years agoUse intptr_t rather than long so that this test will not fail on LLP64 systems,
Sean Hunt [Sun, 22 Nov 2009 07:05:50 +0000 (07:05 +0000)]
Use intptr_t rather than long so that this test will not fail on LLP64 systems,
where long is only 32-bits and so a reinterpret_cast would be ill-formed.

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

14 years agoIf a C++ qualified id is followed by a postfix suffix, it is never the direct
John McCall [Sun, 22 Nov 2009 02:49:43 +0000 (02:49 +0000)]
If a C++ qualified id is followed by a postfix suffix, it is never the direct
operand of an addressof operator, and so we should not treat it as an abstract
member-pointer expression and therefore suppress the implicit member access.

This is really a well-formedness constraint on expressions:  a DeclRefExpr of
a FieldDecl or a non-static CXXMethodDecl (or template thereof, or unresolved
collection thereof) should not be allowed in an arbitrary location in the AST.
Arguably it shouldn't be allowed anywhere and we should have a different expr
node type for this.  But unfortunately we don't have a good way of enforcing
this kind of constraint right now.

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

14 years agoReorganize the intermediate BuildDeclarationNameExpr routines again.
John McCall [Sun, 22 Nov 2009 01:44:31 +0000 (01:44 +0000)]
Reorganize the intermediate BuildDeclarationNameExpr routines again.

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

14 years agoConsider a FunctionTemplate to be an overload all on its lonesome. Track
John McCall [Sun, 22 Nov 2009 00:44:51 +0000 (00:44 +0000)]
Consider a FunctionTemplate to be an overload all on its lonesome.  Track
this information through lookup rather than rederiving it.

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

14 years agoSupport emitting aggregate class initializers. Fixes PR5581.
Anders Carlsson [Sat, 21 Nov 2009 23:56:04 +0000 (23:56 +0000)]
Support emitting aggregate class initializers. Fixes PR5581.

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

14 years agoThis patch implements objective-c's 'SEL' type as a built-in
Fariborz Jahanian [Sat, 21 Nov 2009 19:53:08 +0000 (19:53 +0000)]
This patch implements objective-c's 'SEL' type as a built-in
type and fixes a long-standing code gen. crash reported in
at least two PRs and a radar. (radar 7405040 and pr5025).
There are couple of remaining issues that I would like for
Ted. and Doug to look at:

Ted, please look at failure in Analysis/MissingDealloc.m.
I have temporarily added an expected-warning to make the
test pass. This tests has a declaration of 'SEL' type which
may not co-exist with the new changes.

Doug, please look at a FIXME in PCHWriter.cpp/PCHReader.cpp.
I think the changes which I have ifdef'ed out are correct. They
need be considered for in a few Indexer/PCH test cases.

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

14 years agoMake FixedAddressChecker and experimental check; it currently produces a ton of false...
Ted Kremenek [Sat, 21 Nov 2009 17:55:24 +0000 (17:55 +0000)]
Make FixedAddressChecker and experimental check; it currently produces a ton of false positives when analyzing some projects (e.g., Wine).

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

14 years agoFix 80-cols violation.
Sean Hunt [Sat, 21 Nov 2009 09:45:54 +0000 (09:45 +0000)]
Fix 80-cols violation.

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

14 years agoOverload resolution doesn't decide whether to do ADL or not anymore; stopping
John McCall [Sat, 21 Nov 2009 09:38:42 +0000 (09:38 +0000)]
Overload resolution doesn't decide whether to do ADL or not anymore;  stopping
threading that state.

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

14 years agoMangler: Sketch mangling for TemplateArgument::Declaration kind.
Daniel Dunbar [Sat, 21 Nov 2009 09:17:15 +0000 (09:17 +0000)]
Mangler: Sketch mangling for TemplateArgument::Declaration kind.
 - Several important FIXMEs related to whether arguments are expressions or external names, and the mangling of extern "C" names (c.f., PR5522).

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

14 years agoMangler: Lift shouldMangleDeclName predicate out of CXXNameMangler::mangle.
Daniel Dunbar [Sat, 21 Nov 2009 09:14:52 +0000 (09:14 +0000)]
Mangler: Lift shouldMangleDeclName predicate out of CXXNameMangler::mangle.
 - Sometimes we have to mangle things we wouldn't normally (e.g., because they appear in a template expression).

 - This also tidies up the predicate to be more obvious what is getting mangled.

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

14 years agoMangler: Strengthen invariants, MangleContext::mangleName should only be called on...
Daniel Dunbar [Sat, 21 Nov 2009 09:14:44 +0000 (09:14 +0000)]
Mangler: Strengthen invariants, MangleContext::mangleName should only be called on var or function decls.

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

14 years agoMangler: Inline a bunch of functions into their sole caller, not that I don't love...
Daniel Dunbar [Sat, 21 Nov 2009 09:12:13 +0000 (09:12 +0000)]
Mangler: Inline a bunch of functions into their sole caller, not that I don't love typing for typings sake, but...

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

14 years agoDeclPrinter: Indent access specifiers.
Daniel Dunbar [Sat, 21 Nov 2009 09:12:06 +0000 (09:12 +0000)]
DeclPrinter: Indent access specifiers.

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

14 years agoRemove dead variable.
Daniel Dunbar [Sat, 21 Nov 2009 09:11:59 +0000 (09:11 +0000)]
Remove dead variable.

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

14 years agoMangler: Split isStdNamespace for when the caller already has a NamespaceDecl.
Daniel Dunbar [Sat, 21 Nov 2009 09:11:45 +0000 (09:11 +0000)]
Mangler: Split isStdNamespace for when the caller already has a NamespaceDecl.

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

14 years agoIRgen: Eliminate CXXNameMangler::mangleCXX{C,D}tor.
Daniel Dunbar [Sat, 21 Nov 2009 09:06:31 +0000 (09:06 +0000)]
IRgen: Eliminate CXXNameMangler::mangleCXX{C,D}tor.

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

14 years agoIRgen: Switch the C++ mangler interfaces to take the SmallVector to write into,
Daniel Dunbar [Sat, 21 Nov 2009 09:06:22 +0000 (09:06 +0000)]
IRgen: Switch the C++ mangler interfaces to take the SmallVector to write into,
instead of requiring clients to make a raw_svector_ostream, which is just an
implementation detail.

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

14 years agoSink free mangle* methods into MangleContext.
Daniel Dunbar [Sat, 21 Nov 2009 09:06:10 +0000 (09:06 +0000)]
Sink free mangle* methods into MangleContext.

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

14 years agoAdd 1+2 consts.
Daniel Dunbar [Sat, 21 Nov 2009 09:05:59 +0000 (09:05 +0000)]
Add 1+2 consts.

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

14 years agoDelete trailing space.
Daniel Dunbar [Sat, 21 Nov 2009 09:05:47 +0000 (09:05 +0000)]
Delete trailing space.

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

14 years ago"Incremental" progress on using expressions, by which I mean totally ripping
John McCall [Sat, 21 Nov 2009 08:51:07 +0000 (08:51 +0000)]
"Incremental" progress on using expressions, by which I mean totally ripping
into pretty much everything about overload resolution in order to wean
BuildDeclarationNameExpr off LookupResult::getAsSingleDecl().  Replace
UnresolvedFunctionNameExpr with UnresolvedLookupExpr, which generalizes the
idea of a non-member lookup that we haven't totally resolved yet, whether by
overloading, argument-dependent lookup, or (eventually) the presence of
a function template in the lookup results.

Incidentally fixes a problem with argument-dependent lookup where we were
still performing ADL even when the lookup results contained something from
a block scope.

Incidentally improves a diagnostic when using an ObjC ivar from a class method.
This just fell out from rewriting BuildDeclarationNameExpr's interaction with
lookup, and I'm too apathetic to break it out.

The only remaining uses of OverloadedFunctionDecl that I know of are in
TemplateName and MemberExpr.

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

14 years agoAdded rudimentary C++0x attribute support.
Sean Hunt [Sat, 21 Nov 2009 08:43:09 +0000 (08:43 +0000)]
Added rudimentary C++0x attribute support.
The following attributes are currently supported in C++0x attribute
lists (and in GNU ones as well):
 - align() - semantics believed to be conformant to n3000, except for
   redeclarations and what entities it may apply to
 - final - semantics believed to be conformant to CWG issue 817's proposed
   wording, except for redeclarations
 - noreturn - semantics believed to be conformant to n3000, except for
   redeclarations
 - carries_dependency - currently ignored (this is an optimization hint)

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

14 years agoAdd RegionStore test case that shows that floating point values are also implicitly...
Ted Kremenek [Sat, 21 Nov 2009 02:52:12 +0000 (02:52 +0000)]
Add RegionStore test case that shows that floating point values are also implicitly tracked for undefined values.  (test case for <rdar://problem/6811085>).

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

14 years agoFix refacto, gcc's cc1 needs to see --output-pch=, which is not just an alias
Daniel Dunbar [Sat, 21 Nov 2009 02:31:29 +0000 (02:31 +0000)]
Fix refacto, gcc's cc1 needs to see --output-pch=, which is not just an alias
for -output-pch=.

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

14 years agoAdd another test case to show the precision of RegionStore over
Ted Kremenek [Sat, 21 Nov 2009 02:17:47 +0000 (02:17 +0000)]
Add another test case to show the precision of RegionStore over
BasicStore.  In this example, BasicStore would lose information about
the pointer in path after '*path++', causing the analyzer to falsely
flag a null dereference.  This addresses <rdar://problem/7191542>.

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

14 years agoImplement C++ [temp.param]p2 correctly, looking ahead when we see a
Douglas Gregor [Sat, 21 Nov 2009 02:07:55 +0000 (02:07 +0000)]
Implement C++ [temp.param]p2 correctly, looking ahead when we see a
"typename" parameter to distinguish between non-type and type template
parameters. Fixes the actual bug in PR5559.

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

14 years agoRestructure DereferenceChecker slightly to handle caching out when we would report...
Ted Kremenek [Sat, 21 Nov 2009 01:50:48 +0000 (01:50 +0000)]
Restructure DereferenceChecker slightly to handle caching out when we would report a null dereference more than once.

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

14 years agoPull BadCallChecker int UndefinedArgChecker, and have UndefinedArgChecker also handle...
Ted Kremenek [Sat, 21 Nov 2009 01:25:37 +0000 (01:25 +0000)]
Pull BadCallChecker int UndefinedArgChecker, and have UndefinedArgChecker also handled undefined receivers in message expressions.

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

14 years agoAdd SigAtomicType to TargetInfo, Needed for MSP and PIC Targets, Credit to Ken Dyck.
Edward O'Callaghan [Sat, 21 Nov 2009 00:49:54 +0000 (00:49 +0000)]
Add SigAtomicType to TargetInfo, Needed for MSP and PIC Targets, Credit to Ken Dyck.

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

14 years agoMore checker refactoring. Passing undefined values in a message expression is now...
Ted Kremenek [Sat, 21 Nov 2009 00:49:41 +0000 (00:49 +0000)]
More checker refactoring.  Passing undefined values in a message expression is now handled by UndefinedArgChecker.

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