Chris Lattner
011b0f5c5a
Make the parameter count of ObjCMethodDecl unsigned, you
...
can't have negative arguments.
llvm-svn: 48407
2008-03-16 01:07:14 +00:00
Chris Lattner
ee1284a6e2
switch the rest of the C decl classes to do their
...
allocation through ASTContext.
llvm-svn: 48403
2008-03-16 00:16:02 +00:00
Chris Lattner
96c460d142
move the ASTContext argument to be first in the argument list of
...
all Create methods.
llvm-svn: 48398
2008-03-15 21:32:50 +00:00
Chris Lattner
5072bae709
Switch over functiondecl. This makes it obvious that the ASTContext
...
argument to Create should be first, not last.
llvm-svn: 48397
2008-03-15 21:24:04 +00:00
Chris Lattner
4b08ca8f2e
switch the VarDecl allocation model to go through ASTContext.
...
llvm-svn: 48396
2008-03-15 21:10:16 +00:00
Chris Lattner
a7b3287760
start switching decls over to using an allocator controlled by ASTContext.
...
Right now only some ctors are switched over. I need to switch them all
over so I can change the dtor over.
This lets us experiment with region allocation and other things in the
future.
llvm-svn: 48390
2008-03-15 06:12:44 +00:00
Steve Naroff
dad80ba9b1
Link against the correct ObjC string class (__CFConstantStringClassReference) and fix length computation (removing a FIXME).
...
llvm-svn: 48384
2008-03-15 01:36:04 +00:00
Steve Naroff
ce8e886731
Remove ObjC rewriter dependency on GCC's __builtin___CFStringMakeConstantString.
...
llvm-svn: 48383
2008-03-15 00:55:56 +00:00
Ted Kremenek
9abb59f9cc
Emit warnings for undefined control-flow.
...
llvm-svn: 48368
2008-03-14 18:14:50 +00:00
Ted Kremenek
7b00d15bc5
Path-sensitive analyses no longer take a FunctionDecl, but any Decl representing
...
a block of "code".
Patched various ASTConsumers (such as ASTDumper) to have more support for
processing ObjCMethodDecl. CFGVisitor now builds CFGs for ObjCMethodDecls.
llvm-svn: 48363
2008-03-14 17:31:00 +00:00
Chris Lattner
e8ec280627
Only compute targetinfo once and don't leak it. Patch by Sam Bishop!
...
llvm-svn: 48358
2008-03-14 06:12:05 +00:00
Ted Kremenek
1fdd0a480e
The LiveVariables analysis no longer requires a FunctionDecl&; this allows it
...
to be run on other declarations of blocks of code (e.g., Objective-C methods.)
llvm-svn: 48339
2008-03-13 16:55:07 +00:00
Ted Kremenek
b64d183803
Added bandaid support in CFG construction for ObjCForEachStmt and ObjCAtTryStmt:
...
we gracefully back out and return NULL for the CFG, allowing clients to skip
analyzing functions with these CFGs. We will add support later.
Modified base ASTConsumer "CFGVisitor" to detect when a CFG is not constructed
and to emit a warning.
llvm-svn: 48322
2008-03-13 03:04:22 +00:00
Steve Naroff
35cb7960e3
Two fixes to RewriteTest::RewriteObjCIvarRefExpr():
...
- For explicit ivar refers, make sure the cast is propagated to the AST.
- Don't free the base (since it is still in use).
This fixes the recent regression to test/Rewriter/objc-ivar-receiver-1.m.
llvm-svn: 48309
2008-03-12 23:15:19 +00:00
Steve Naroff
ffb5f9ad93
Minor aesthetic improvement (after I reviewed my last commit).
...
llvm-svn: 48304
2008-03-12 21:22:52 +00:00
Steve Naroff
9f33bd2c34
Avoid using the "unnamed struct field" extension (enabled with -fms-extensions). This feature/extension silently does the wrong thing in g++. As far as I can tell, g++ simply throws the field away entirely (note that it works fine with gcc). Since I am now always casting the object (for other reasons), accessing protected/public fields simply requires the cast refer to the defining class. This solution is simpler all around (thanks to Chris for suggesting it).
...
llvm-svn: 48302
2008-03-12 21:09:20 +00:00
Steve Naroff
b327e49047
Use the "used" attribute. Without it, g++ removes all the meta-data:-( This doesn't happen when compiling straight C code.
...
llvm-svn: 48287
2008-03-12 17:18:30 +00:00
Steve Naroff
5d5efca405
-Add missing visitor for ObjCIvarRefExpr.
...
-Wrap objc runtime calls with "extern "C"" (for now).
llvm-svn: 48284
2008-03-12 13:19:12 +00:00
Steve Naroff
251084d03e
Remove more dependencies on C "flexible array member" idiom (when generating meta-data).
...
llvm-svn: 48271
2008-03-12 01:06:30 +00:00
Steve Naroff
dc5b6b2e5d
Make ivar rewrite C++ friendly (since C++ forces a unified namespace for typedefs/structures). The previous version of the rewriter generated both a type def and structure def for each class (which doesn't fly in C++).
...
llvm-svn: 48266
2008-03-12 00:25:36 +00:00
Steve Naroff
0b844f053f
Make "super" rewrite for class methods C++ friendly (follow-up from last commit).
...
llvm-svn: 48235
2008-03-11 18:14:26 +00:00
Steve Naroff
17978c4dcb
Make "super" rewrite C++ friendly (since it doesn't support Compound Literals).
...
llvm-svn: 48230
2008-03-11 17:37:02 +00:00
Steve Naroff
c5b9cc70ce
Generate meta-data in a C++ compatible way (remove 2 dependencies on C "flexible array member" idiom and perform some extra casts).
...
llvm-svn: 48202
2008-03-11 00:12:29 +00:00
Steve Naroff
14a0746b13
Missed a couple "_IMPL" suffixes.
...
llvm-svn: 48191
2008-03-10 23:33:22 +00:00
Steve Naroff
a1e115ee57
Fix dangling pointer and give the implementation struct for a class a unique name.
...
llvm-svn: 48190
2008-03-10 23:16:54 +00:00
Steve Naroff
945a3b145a
Pass LangOptions to RewriteTest().
...
llvm-svn: 48172
2008-03-10 20:43:59 +00:00
Chris Lattner
0d799d3957
Add some missing #includes for GCC mainline, patch by Shantonu Sen!
...
llvm-svn: 48153
2008-03-10 17:04:53 +00:00
Chris Lattner
6af064641f
Fix a ted-o
...
llvm-svn: 48089
2008-03-09 05:25:01 +00:00
Chris Lattner
22ad07ca07
simplify triple processing code now that there can be only one arch specified.
...
llvm-svn: 48066
2008-03-09 01:35:13 +00:00
Ted Kremenek
2bdd77696e
Added --trim-path-graph to the driver to trim paths from the ExplodedGraph
...
that are not related to error nodes.
Fixed bug where we did not detect some NULL dereferences.
Added "ExplodedGraph::Trim" to trim all nodes that cannot transitively reach
a set of provided nodes.
Fixed subtle bug in ExplodedNodeImpl where we could create predecessor
iterators that included the mangled "sink" bit. The better fix is to integrate
this bit into the void* for the wrapped State, not the NodeGroups representing
a node's predecessors and successors.
llvm-svn: 48036
2008-03-07 22:58:01 +00:00
Ted Kremenek
ea6507fe04
Added boilerplate to execute the CF reference count checker (which isn't yet implemented).
...
llvm-svn: 47982
2008-03-06 00:08:09 +00:00
Chris Lattner
37e0587839
remove the source location arguments to various target query methods.
...
llvm-svn: 47954
2008-03-05 18:54:05 +00:00
Chris Lattner
855d024a83
Remove the first layer of support for "portability" warnings. This is
...
theoretically useful, but not useful in practice. It adds a bunch of
complexity, and not much value. It's best to nuke it. One big advantage
is that it means the target interfaces will soon lose their SLoc arguments
and target queries can never emit diagnostics anymore (yay). Removing this
also simplifies some of the core preprocessor which should make it slightly
faster.
Ted, I didn't simplify TripleProcessor, which can now have at most one
triple, and can probably just be removed. Please poke at it when you have
time.
llvm-svn: 47930
2008-03-05 01:18:20 +00:00
Chris Lattner
028d6d5792
avoid a warning.
...
llvm-svn: 47839
2008-03-03 05:57:43 +00:00
Chris Lattner
184adbfe5b
Find clang headers in the clang headers dir, search it before
...
the system headers dir. This produces an annoying warning:
clang.cpp:883: warning: ISO C++ forbids casting between pointer-to-function and pointer-to-object
I'm not sure how to remove it. :(
llvm-svn: 47836
2008-03-03 03:16:03 +00:00
Chris Lattner
c1bc541323
Add support for the CPATH, C_INCLUDE_PATH, CPLUS_INCLUDE_PATH,
...
OBJC_INCLUDE_PATH, and OBJCPLUS_INCLUDE_PATH environment variables.
Patch by Sam Bishop!
llvm-svn: 47785
2008-03-01 08:07:28 +00:00
Chris Lattner
bb7bc8d4f0
fix an interaction between -isystem . and isysroot.
...
llvm-svn: 47646
2008-02-26 23:46:22 +00:00
Chris Lattner
eb85ab44f2
convert tabs to spaces, patch by Mike Stump!
...
llvm-svn: 47560
2008-02-25 21:04:36 +00:00
Chris Lattner
cb0d62c70d
enable digraphs for C94, thanks to Neil for pointing this out.
...
llvm-svn: 47543
2008-02-25 04:01:39 +00:00
Ted Kremenek
c77f34daad
Modified clang driver option -dump-live-variables to (optionally) use the
...
--analyze-function option to analyze specific functions.
llvm-svn: 47498
2008-02-22 20:13:09 +00:00
Ted Kremenek
88329bf0ea
clang driver options --dump-cfg and --view-cfg now (optionally) use the
...
--analyze-function option to dump/view the CFGs of specific functions.
llvm-svn: 47497
2008-02-22 20:00:31 +00:00
Ted Kremenek
76c03b4a55
When running the GRSimpleVals analysis, skip functions that do not
...
appear in a file.
llvm-svn: 47491
2008-02-22 19:10:58 +00:00
Ted Kremenek
dbb1a3724c
For now, --grsimple skips analyzing functions in header files.
...
llvm-svn: 47303
2008-02-19 02:33:31 +00:00
Ted Kremenek
0f7130adc4
--grsimple now reports the number of nodes in the ExplodedGraph for
...
an analyzed function.
GRExprEngine now records stores to "uninitialized lvalues" (which are sinks in
the ExplodedGraph).
llvm-svn: 47293
2008-02-19 00:22:37 +00:00
Ted Kremenek
86e793937a
Running -grsimple now emits diagnostics about the time spent analyzing each function. Will
...
probably make this a separate command line option later.
Added "--analyze-function" option to the driver to (gradually) allow different
analyses to only be run on specific functions. Currently only --grsimple uses
this option.
llvm-svn: 47285
2008-02-18 21:21:23 +00:00
Eli Friedman
1d88371663
A couple of msvc compile fixes from the ml; I haven't tested with msvc,
...
but the fixes are reasonable.
llvm-svn: 47224
2008-02-16 23:17:23 +00:00
Lauro Ramos Venancio
10984b2ee9
Set Ubuntu 7.10 c++ include path.
...
llvm-svn: 47186
2008-02-15 22:36:38 +00:00
Ted Kremenek
e161afc4dd
Added --grsimple-view option to clang driver; this is the same as
...
--grsimple except that it visualizes the ExplodedGraph using dot and
outputs the current function being analyzed. --grsimple is now silent
except when it emits diagnostics.
llvm-svn: 47146
2008-02-15 00:35:38 +00:00
Ted Kremenek
d3122cb83c
Renamed GRConstants => GRSimpleVals.
...
Moved driver logic for --grsimple to GRSimpleVals.cpp.
llvm-svn: 47137
2008-02-14 22:36:46 +00:00
Steve Naroff
bff738543d
Move policy on unnamed fields (a Microsoft extension) from Parser::ParseStructDeclaration() to the driver.
...
llvm-svn: 46974
2008-02-11 22:40:08 +00:00