Commit Graph

568 Commits

Author SHA1 Message Date
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
Steve Naroff 5a858df0b3 Fix http://llvm.org/bugs/show_bug.cgi?id=2013.
llvm-svn: 46972
2008-02-11 22:17:33 +00:00
Steve Naroff a369922449 A bunch-o changes to fix <rdar://problem/5716046> incomplete implementation of ObjC class warning is incomplete
As part of this fix, I made a low-level change to the text diagnostics machinery (to basically avoid printing duplicate source lines/carets when you have multiple diagnostics that refer to the same exact place). For now, this only happens with we don't have a source range (could be extended to support source ranges as well). 

llvm-svn: 46897
2008-02-08 22:06:17 +00:00
Anders Carlsson 5c6c05956e Put back the top-level asm code; all tests pass now.
llvm-svn: 46868
2008-02-08 00:33:21 +00:00
Anders Carlsson 0fae4f56df Back out 46855 for now, it causes test failures on Darwin.
llvm-svn: 46867
2008-02-08 00:23:11 +00:00
Anders Carlsson bcc3a4bf64 Handle top-level asm declarations.
llvm-svn: 46855
2008-02-07 17:19:11 +00:00
Ted Kremenek d74da0838f Added proof-of-concept NULL pointer diagnostics to GRConstants.
Modified the driver to pass the Diagnostic object to GRConstants.

llvm-svn: 46847
2008-02-07 06:33:19 +00:00
Steve Naroff b2c80c7c7b Implement -fms-extensions. This allows us to fuzzy parse non-standard MS constructs used in "windows.h".
llvm-svn: 46838
2008-02-07 03:50:06 +00:00
Eli Friedman 1242fff6ec Make sure to propagate qualifiers through the member operator.
llvm-svn: 46830
2008-02-06 22:48:16 +00:00
Chris Lattner adf1f51fc5 move the codegen ASTConsumer out of the driver into libcodegen,
eliminating a bunch of forwarding methods and generally 
simplifying things.

llvm-svn: 46792
2008-02-06 02:01:47 +00:00
Chris Lattner b5eda6253b pull .ll and .bc writing out of the ASTConsumer destructors into some top
level code in clang.  This is a cleanup, but does implement "-o" for 
-emit-llvm.  One effect of this is that "clang foo.c -emit-llvm" will now
emit into foo.ll instead of stdout.  Use "clang foo.c -emit-llvm -o -" or 
"clang < foo.c -emit-llvm" to get the old behavior.

llvm-svn: 46791
2008-02-06 01:42:25 +00:00
Chris Lattner 8082d870bd rename ASTSTreamer.{h|cpp} -> ParseAST.{h|cpp}
llvm-svn: 46786
2008-02-06 00:23:21 +00:00
Chris Lattner b1537ebdd4 rewrite some of the type refinement code to eliminate dangling pointers
simplify the code and generally make it more robust.

llvm-svn: 46745
2008-02-05 08:06:13 +00:00
Chris Lattner 3ac9699c44 Fix PR1966 by ignoring non-error diagnostics from system headers even if they are
*mapped* onto errors.

llvm-svn: 46686
2008-02-03 09:00:04 +00:00
Steve Naroff e6b7ffd073 Minor API cleanup...
llvm-svn: 46649
2008-02-01 22:08:12 +00:00
Steve Naroff d9dc63f2c5 Remove temporary workaround (thanks to Ted for fixing ObjCAtCatchStmt so quickly:-).
llvm-svn: 46648
2008-02-01 21:51:39 +00:00
Steve Naroff edb5bc6f09 Fix two rewriter bugs with @catch.
- Support @catch(...), rather than crash:-)
- Make sure all catch bodies get rewritten. This "fix" is really a workaround until the iterator for the "try" AST is fixed. Will fix this in a separate commit.

llvm-svn: 46644
2008-02-01 20:02:07 +00:00
Chris Lattner 9cc55f5b1f add some helper methods for removing and replacing text, this makes the
rewriter more robust.

llvm-svn: 46622
2008-01-31 19:51:04 +00:00
Chris Lattner 1780a85602 Add a new InsertText method that does the check to see if the insertion was valid. This
fixes crashes where the insertion point was in a macro.  Instead of crashing, we want
to emit a warning.

llvm-svn: 46621
2008-01-31 19:42:41 +00:00
Chris Lattner 187f626a7c move a large method out of line
llvm-svn: 46620
2008-01-31 19:38:44 +00:00
Chris Lattner 2e0d2600a2 Make rewriter::inserttext return a bool to indicate if it failed.
Add a RewriteTest::ReplaceStmt method to factor the 'checking for
rewrite failed + emitting diagnostic if so' code.

llvm-svn: 46619
2008-01-31 19:37:57 +00:00
Chris Lattner a779d69029 Fix a rewriter crash when the whole body of a foreach is itself
rewritten, as in Sema/rewrite-foreach-6.m.  Fariborz/Steve,
please review this to see if it is sane.

llvm-svn: 46600
2008-01-31 05:10:40 +00:00
Steve Naroff 7b3579b8de Abolish a bunch of Xcode inserted tabs.
llvm-svn: 46566
2008-01-30 19:17:43 +00:00