Commit Graph

221 Commits

Author SHA1 Message Date
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
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
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
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 02bf44436f Make -o work with -E, patch contributed by Shantonu Sen!
llvm-svn: 46426
2008-01-27 23:55:11 +00:00
Chris Lattner 7238225c28 add support for -Wundef.
llvm-svn: 46274
2008-01-23 17:19:46 +00:00
Lauro Ramos Venancio 111b3ba670 Add Ubuntu 7.10 include path.
llvm-svn: 46233
2008-01-21 23:08:35 +00:00
Fariborz Jahanian 159ee39f4d Insert #pragma once when rewriting a header file.
llvm-svn: 46155
2008-01-18 01:15:54 +00:00
Ted Kremenek db0b651de9 Shortened driver option for running the GR-constants analysis to --grconstants.
llvm-svn: 46076
2008-01-16 18:21:49 +00:00
Ted Kremenek 2e12c2e790 Hooked up the GRConstants analysis to the driver.
Fixed some compilation errors with GREngine that showed up during
template instantiation.

llvm-svn: 46074
2008-01-16 18:18:48 +00:00
Chris Lattner 2cbf2f39ee add support for the GCC -include option.
llvm-svn: 45810
2008-01-10 01:53:41 +00:00
Chris Lattner d2cdb97747 Ted apparently likes crazy whitespace at the end of line. Crush his spirit by
removing them, fitting the file into 80 columns. :)

llvm-svn: 45807
2008-01-10 01:41:55 +00:00
Ted Kremenek 7e41c29a86 Added most of the boilerplate to the driver needed to run the graph-reachability
constant propagation analysis.

llvm-svn: 45747
2008-01-08 18:04:06 +00:00
Chris Lattner 4899a6aa6a Fix PR1897, patch by Wilhansen Li
llvm-svn: 45593
2008-01-04 19:12:28 +00:00
Nate Begeman 16a3a9d5f9 Rename stats to print-stats to avoid conflicting with llvm's
stats statistic when clang is built as a dylib.

llvm-svn: 45441
2007-12-30 01:38:50 +00:00
Chris Lattner 5b12ab8c93 Don't attribute in file headers anymore. See llvmdev for the
discussion of this change.

llvm-svn: 45410
2007-12-29 19:59:25 +00:00
Seo Sanghyeon 76270e6be6 Implement -emit-llvm-bc option
llvm-svn: 45339
2007-12-24 01:52:34 +00:00
Ted Kremenek 71d643f8b1 Converted uses of scoped_ptr to OwningPtr.
llvm-svn: 45265
2007-12-20 19:47:16 +00:00
Ted Kremenek 96e05d4f31 Added methods createMainFileID() and createMainFileIDForMemBuffer() to
SourceManager to allow SourceManager to directly intern the MainFileID
when it is created.  Removed setMainFileID().

llvm-svn: 45231
2007-12-19 23:48:45 +00:00
Ted Kremenek 230bd918b2 Interned MainFileID within SourceManager. Since SourceManager is referenced by
both Preprocessor and ASTContext, we no longer need to explicitly pass
MainFileID around in function calls that also pass either Preprocessor or
ASTContext. This resulted in some nice cleanups in the ASTConsumers and the
driver.

llvm-svn: 45228
2007-12-19 22:51:13 +00:00
Ted Kremenek f7bfae6b45 Typo fix.
llvm-svn: 45227
2007-12-19 22:32:34 +00:00
Ted Kremenek 9a53275918 Added storage of the FileID of the the main source file of a translation unit
in SourceManager.

llvm-svn: 45225
2007-12-19 22:29:55 +00:00
Ted Kremenek 6c7807716b Removed "SourceFile" from TranslationUnit. This same information will (soon)
be available by querying the SourceManager within the ASTContext referenced by
the TranslationUnit.

llvm-svn: 45223
2007-12-19 22:24:34 +00:00
Ted Kremenek aff2343af3 Cleaned up "-o" option to print "-o=<path>" instead of "-o=<string>" when
doing clang --help.

llvm-svn: 45215
2007-12-19 19:50:41 +00:00
Ted Kremenek 6c0b224011 Added "-o" option to driver. ASTConsumers will need to be gradually
rewired to utilize this option.

Renamed option --serialize-ast --serialize.

llvm-svn: 45213
2007-12-19 19:47:59 +00:00
Ted Kremenek 0061aeb316 Removed storing inode and device number in TranslationUnit.
Added "SourceFile" string to TranslationUnit to record corresponding
source file.

Updated serialization of TranslationUnits and logic in the driver to
correctly pass the source file information to the serializer.

llvm-svn: 45211
2007-12-19 19:27:38 +00:00
Ted Kremenek 6c3777c319 Moved generation of the name of the serialized AST file into
CreateASTSerializer.

llvm-svn: 45201
2007-12-19 17:25:59 +00:00
Ted Kremenek f70d24d2ae Moved ReadBitcodeFile and EmitBitcodeFile out of TranslationUnit and made them
the standalone functions ReadASTBitcodeFile and EmitASTBitcodeFile
respectively.

llvm-svn: 45180
2007-12-18 21:44:50 +00:00
Ted Kremenek 879b75018f Moved TranslationUnit from Driver to AST library.
llvm-svn: 45175
2007-12-18 21:34:28 +00:00
Chris Lattner 4ffe46cbdf Start reading the headermap header, drop the 'errorstr' argument to
the create method.

llvm-svn: 45109
2007-12-17 18:34:53 +00:00
Chris Lattner 8d720d083a Sink getName into DirectoryLookup to simplify the client in clang.
llvm-svn: 45106
2007-12-17 17:57:27 +00:00
Ted Kremenek 73e921fdf2 Fixed 80 col violation.
llvm-svn: 45104
2007-12-17 17:50:39 +00:00
Ted Kremenek 5aa66bdfd6 Added driver option -Wno-format-nonliteral to silence format string related
warnings. This flag is the inverse of to GCC's -Wformat-nonliteral option (in
the clang driver, these warnings are on by default).

Patch provided by Shantonu Sen.

llvm-svn: 45103
2007-12-17 17:50:07 +00:00
Chris Lattner faebb62651 Unbreak -v with framework paths. Patch by Shantonu Sen.
llvm-svn: 45102
2007-12-17 17:42:26 +00:00
Chris Lattner f62f75895f as it turns out, frameworks and headermaps are orthogonal. Make this so in
the internal representation.  This also fixes a bug where -I foo  -F foo would
not search foo as both a normal and framework include dir.

llvm-svn: 45092
2007-12-17 07:52:39 +00:00
Chris Lattner dd00e625d2 add a portability fixme.
llvm-svn: 45091
2007-12-17 06:51:34 +00:00
Chris Lattner 3e206b3a0e teach RemoveDuplicates about header maps.
llvm-svn: 45090
2007-12-17 06:44:29 +00:00
Chris Lattner c4ba38ed1e Step #1 in adding headermap support to clang.
llvm-svn: 45089
2007-12-17 06:36:45 +00:00
Chris Lattner 899ff4a26d rearrange some code and make it more efficient.
llvm-svn: 45087
2007-12-17 05:59:27 +00:00
Chris Lattner 39911a2258 swtich to smallptrset, which is more efficient than std::set.
llvm-svn: 45065
2007-12-15 23:20:07 +00:00
Chris Lattner d6658d932b make clang -v output more similar to gcc's -v output.
llvm-svn: 45064
2007-12-15 23:11:06 +00:00
Chris Lattner 60a288ab19 simplify the interfaces to ProcessInputFile and InitializePreprocessor
llvm-svn: 45060
2007-12-15 20:48:40 +00:00
Ted Kremenek 31dcdb312b Add check in the driver to see if a serialized AST file has been successfully
deserialized.

llvm-svn: 45006
2007-12-13 18:11:11 +00:00
Ted Kremenek 15ddcef648 Changed -serialize-ast to not create a temporary directory, but instead
create a .ast file in the current working directory.  This mirrors the behavior
of the -c option for gcc.  Later we should add the ability to write the
serialized file anywhere.

llvm-svn: 45004
2007-12-13 17:50:11 +00:00