Ted Kremenek
799bb6e178
Remove uses of std::ostream from libAnalysis.
...
llvm-svn: 74136
2009-06-24 23:06:47 +00:00
Ted Kremenek
2c6a7b2776
Remove GRStateManager::GetSValAsScalarOrLoc()/GetSVal().
...
llvm-svn: 74128
2009-06-24 22:15:30 +00:00
Anders Carlsson
81df7b89de
Add a DecltypeType type.
...
llvm-svn: 74099
2009-06-24 19:06:50 +00:00
Anders Carlsson
74948d0701
Parse the C++0x decltype specifier.
...
llvm-svn: 74086
2009-06-24 17:47:40 +00:00
Douglas Gregor
17a7c1297a
Make sure that the template parameter lists get from the parser down to ActOnFunctionDeclarator for function template definitions
...
llvm-svn: 74040
2009-06-24 00:54:41 +00:00
Anders Carlsson
d2e8adfc75
Support for [class.local]p4.
...
llvm-svn: 74030
2009-06-24 00:28:53 +00:00
Anders Carlsson
946b86d91a
[class.local] p1 and p3. Also, add back the xcodeproj file.
...
llvm-svn: 74027
2009-06-24 00:10:43 +00:00
Douglas Gregor
b52fabb2a8
Start propagating template parameter lists to the right places to
...
handle function templates. There's no actual code for function
templates yet, but at least we complain about typedef templates.
llvm-svn: 74021
2009-06-23 23:11:28 +00:00
Argyrios Kyrtzidis
33661d9f16
Introduce SourceManager::ísBeforeInTranslationUnit() which can compare 2 source locations and determine which one comes before the other, relative to the translation unit.
...
llvm-svn: 74014
2009-06-23 22:01:48 +00:00
Argyrios Kyrtzidis
25ee5db366
Move the command line source location parsing from clang-cc.cpp into "include/Frontend/CommandLineSourceLoc.h".
...
llvm-svn: 74012
2009-06-23 22:01:39 +00:00
Ted Kremenek
4cf427a8ae
Fix build.
...
llvm-svn: 74009
2009-06-23 21:50:16 +00:00
Ted Kremenek
8cf2021012
Remove GRStateManager::getRegion/getSelfRegion().
...
llvm-svn: 74006
2009-06-23 21:37:46 +00:00
Ted Kremenek
7df5691d2d
Remove GRStateManager::BindLoc() and GRStateManager::Unbind().
...
llvm-svn: 73996
2009-06-23 20:38:51 +00:00
Ted Kremenek
59ee3f5079
Remove GRStateManager::BindDecl() and GRStateManager::BindDeclWithInit().
...
llvm-svn: 73995
2009-06-23 20:27:53 +00:00
Ted Kremenek
2d99f97c17
- Add MemRegion::getMemorySpace()
...
- Change implementation of MemRegion::hasStackStorage()/hasHeapStorage() to use
'getMemorySpace()'. This avoids a double traversal up the region hierarchy
and is simpler.
- Add MemRegion::hasHeapOrStackStorage() as a slightly more efficient
alternative to 'hasStackStorage() || hasHeapStorage()'.
llvm-svn: 73977
2009-06-23 18:17:08 +00:00
Ted Kremenek
404b132dc0
Move 'hasStackStorage()' and 'hasHeapStorage()' from MemRegionManager to MemRegion.
...
llvm-svn: 73973
2009-06-23 18:05:21 +00:00
Ted Kremenek
ae01dc73af
API cleanup: move more methods from GRStateManager to GRState.
...
llvm-svn: 73968
2009-06-23 17:55:07 +00:00
Zhongxing Xu
7718ae4701
Move all factory methods from SVal to ValueManager. API cleanup!
...
llvm-svn: 73954
2009-06-23 09:02:15 +00:00
Zhongxing Xu
0808f70912
Split ValueManager method definitions into its own source file.
...
No functionality change.
llvm-svn: 73952
2009-06-23 06:22:22 +00:00
Zhongxing Xu
d09b5205ef
ValueManager::makeNonLoc -> ValueManager::makeIntVal
...
Clean up code with ValueManager.
llvm-svn: 73951
2009-06-23 06:13:19 +00:00
Zhongxing Xu
b7cf95957d
Instead of setting the default value of the array region, bind the rest of the
...
array elements to 0 explicitly. Create 0 values with the element type.
llvm-svn: 73946
2009-06-23 05:23:38 +00:00
Zhongxing Xu
cbfc7d6c2e
MemRegionManager: Migrate logic for getCodeTextRegion() over to using
...
trait-based MemRegion creation.
llvm-svn: 73941
2009-06-23 03:50:30 +00:00
Zhongxing Xu
1a195b264f
Remove duplicated methods.
...
llvm-svn: 73940
2009-06-23 02:51:21 +00:00
Anders Carlsson
5947ddfb55
Check in a new template argument list builder that should work better for variadic templates.
...
llvm-svn: 73937
2009-06-23 01:26:57 +00:00
Chris Lattner
e2170edfbb
switch Warnings.cpp to use the diagnostics machinery to print diagnostics, not *fprintf*!
...
Among other things, this makes the warning about unknown warning options mappable.
For example:
$ clang t.c -Werror -Wfoo
error: unknown warning option '-Wfoo' [-Wunknown-warning-option]
For another thing, they are properly color coded now too :)
llvm-svn: 73936
2009-06-23 01:20:39 +00:00
Ted Kremenek
fb87e30815
MemRegions:
...
- Embed a reference to MemRegionManager objects in MemSpaceRegion objects
- Use this embedded reference for MemRegion objects to access ASTContext objects without external help
- Use this access to ASTContext to simplify 'isBoundable' (no ASTContext& argument required)
llvm-svn: 73935
2009-06-23 00:46:41 +00:00
Argyrios Kyrtzidis
c035bf688a
Remove operator '<=' overload for SourceLocation.
...
llvm-svn: 73933
2009-06-23 00:42:21 +00:00
Argyrios Kyrtzidis
dfc5dca1e5
Don't use operator overload '<' for SourceLocation, it has not semantic meaning.
...
llvm-svn: 73932
2009-06-23 00:42:15 +00:00
Ted Kremenek
8bae300ade
MemRegionManager: Migrate logic for getAllocaRegion() over to using trait-based MemRegion creation.
...
llvm-svn: 73927
2009-06-23 00:15:41 +00:00
Fariborz Jahanian
477d242a2e
patch to mark use of implicit copy constructors.
...
llvm-svn: 73922
2009-06-22 23:34:40 +00:00
Ted Kremenek
214cdfea84
Migrate factory methods for FieldRegion and ObjCIVarRegion creation to use the
...
new generalized region-construction code.
llvm-svn: 73921
2009-06-22 23:34:21 +00:00
Ted Kremenek
e5e8b0b09b
Refactor some of the logic in MemRegionManager for constructing regions using
...
member template functions and traits. The idea is to allow MemRegionManager to
construct subclasses of MemRegion that aren't declared in MemRegion.h (e.g.,
checker-specific regions).
llvm-svn: 73917
2009-06-22 23:13:13 +00:00
Chris Lattner
6589a2e1db
add a warning group for unavailable decls that mirrors the one for
...
deprecated decls.
llvm-svn: 73914
2009-06-22 23:04:45 +00:00
Douglas Gregor
0b6a6242ed
Rework the way we track which declarations are "used" during
...
compilation, and (hopefully) introduce RAII objects for changing the
"potentially evaluated" state at all of the necessary places within
Sema and Parser. Other changes:
- Set the unevaluated/potentially-evaluated context appropriately
during template instantiation.
- We now recognize three different states while parsing or
instantiating expressions: unevaluated, potentially evaluated, and
potentially potentially evaluated (for C++'s typeid).
- When we're in a potentially potentially-evaluated context, queue
up MarkDeclarationReferenced calls in a stack. For C++ typeid
expressions that are potentially evaluated, we will play back
these MarkDeclarationReferenced calls when we exit the
corresponding potentially potentially-evaluated context.
- Non-type template arguments are now parsed as constant
expressions, so they are not potentially-evaluated.
llvm-svn: 73899
2009-06-22 20:57:11 +00:00
Fariborz Jahanian
3a36343b88
Remove ImplicitMustBeDefined, use universal 'Used' flag
...
instead. Do the implicit default ctor checking in MarkDeclarationReferenced.
llvm-svn: 73888
2009-06-22 17:30:33 +00:00
Argyrios Kyrtzidis
49abd4d95b
Addressing Doug's suggestions:
...
-Added comment for FunctionDecl::EndRangeLoc
-Removed a redundant check from FunctionDecl::setBody
llvm-svn: 73886
2009-06-22 17:13:31 +00:00
Fariborz Jahanian
246219bc9f
Fixed text of a diagnostics.
...
llvm-svn: 73885
2009-06-22 16:33:37 +00:00
Fariborz Jahanian
99b57fb987
Renamed Protocol as TheProtocol so people can use clang header for
...
building obj-c++ clients. "Protocol" is a class name in Cocoa.h
llvm-svn: 73854
2009-06-21 18:26:03 +00:00
Fariborz Jahanian
1c9d5d956c
Made improvements in c++'s object model patch on Doug's review.
...
llvm-svn: 73833
2009-06-20 20:23:38 +00:00
Argyrios Kyrtzidis
3a08ec1662
Add the license part to the new source files.
...
llvm-svn: 73825
2009-06-20 08:27:14 +00:00
Argyrios Kyrtzidis
88f663c04d
Introduce SourceManager::getLocation() to get a source location out of a "file:line:column" triplet.
...
llvm-svn: 73823
2009-06-20 08:09:57 +00:00
Argyrios Kyrtzidis
a3aeb5a8f1
Introduce Decl::getSourceRange() which, like Stmt::getSourceRange(), represents the range that the declaration covers.
...
Add initial support for NamespaceDecl, VarDecl, and FunctionDecl:
-NamespaceDecl range is from name to '}'
-VarDecl is from name to possible init expression
-FunctionDecl is from name to last parameter name or to end of its function body.
llvm-svn: 73821
2009-06-20 08:09:14 +00:00
Argyrios Kyrtzidis
ef21d5d870
Add operator '<=' for comparing SourceLocations.
...
llvm-svn: 73820
2009-06-20 08:08:38 +00:00
Argyrios Kyrtzidis
ce3797527e
Introduce the ASTUnit class.
...
ASTUnit is a helper class to allow easy loading of an ASTContext from a PCH file. No users for now.
llvm-svn: 73819
2009-06-20 08:08:23 +00:00
Douglas Gregor
fec52635f0
Parsing and AST support for using declarations, from John Thompson!
...
llvm-svn: 73812
2009-06-20 00:51:54 +00:00
Douglas Gregor
c9c02ed8f4
Keep track of when declarations are "used" according to C and
...
C++. This logic is required to trigger implicit instantiation of
function templates and member functions of class templates, which will
be implemented separately.
This commit includes support for -Wunused-parameter, printing warnings
for named parameters that are not used within a function/Objective-C
method/block. Fixes <rdar://problem/6505209>.
llvm-svn: 73797
2009-06-19 23:52:42 +00:00
Fariborz Jahanian
3fd7310d70
Use QualType to represent block's implicit return type as
...
to not lose its 'const/volatile' qualifier.
llvm-svn: 73795
2009-06-19 23:37:08 +00:00
Fariborz Jahanian
423a81f259
Patch for implementation of C++'s object model. This is
...
work in progress.
llvm-svn: 73782
2009-06-19 19:55:27 +00:00
Ted Kremenek
c55f0cdaa0
Remove more GetSVal/GetLValue methods in GRExprEngine/GRState, instead
...
preferring to use their replacements in GRState. This further unifies the code
paths for such logic and leads to some code reduction.
llvm-svn: 73771
2009-06-19 17:10:32 +00:00
Zhongxing Xu
54fb536b5c
A further step of r73690: associate the cast-to type with the created symbol,
...
because the type of the symbol is used to create the default range. We need the
sign to be consistent.
llvm-svn: 73756
2009-06-19 06:00:32 +00:00