Граф коммитов

60 Коммитов

Автор SHA1 Сообщение Дата
Ted Kremenek e01c98767d Renamed GRConstants => GRSimpleVals.
Moved driver logic for --grsimple to GRSimpleVals.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47137 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-14 22:36:46 +00:00
Anders Carlsson dfab6cb59a Put back the top-level asm code; all tests pass now.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46868 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-08 00:33:21 +00:00
Anders Carlsson 3f9424f320 Back out 46855 for now, it causes test failures on Darwin.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46867 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-08 00:23:11 +00:00
Anders Carlsson 61900f0ef4 Handle top-level asm declarations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46855 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-07 17:19:11 +00:00
Ted Kremenek 19227e32af Added proof-of-concept NULL pointer diagnostics to GRConstants.
Modified the driver to pass the Diagnostic object to GRConstants.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46847 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-07 06:33:19 +00:00
Chris Lattner 8ee3c0340f move the codegen ASTConsumer out of the driver into libcodegen,
eliminating a bunch of forwarding methods and generally 
simplifying things.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46792 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-06 02:01:47 +00:00
Chris Lattner e66b65c3a3 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46791 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-06 01:42:25 +00:00
Chris Lattner d86e6bc7ab rewrite some of the type refinement code to eliminate dangling pointers
simplify the code and generally make it more robust.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46745 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-05 08:06:13 +00:00
Ted Kremenek bffaa83147 Modified LiveVariables to perform all of its base initialization in the ctor,
and now we require a FunctionDecl* object so that we can also keep track of
all of the ParmDecls.

Modified clients of LiveVariables to conform to the new interface.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46490 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-29 05:13:23 +00:00
Ted Kremenek cb48b9c9c3 Driver now passes the top-level FunctionDecl* to GRConstants.
Refactoring: for GREngine and GRConstants, pushed references to CFG, ASTContext,
and the top-level FunctionDecl into ExplodedGraphImpl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46475 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-29 00:33:40 +00:00
Ted Kremenek 874d63fc63 Added passing "ASTContext" to both GREngine and GRConstants.
Added initial support for integer casting operations to GRConstants.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46298 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-24 02:02:54 +00:00
Ted Kremenek ee98546b0d Hooked up the GRConstants analysis to the driver.
Fixed some compilation errors with GREngine that showed up during
template instantiation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46074 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-16 18:18:48 +00:00
Chris Lattner c6fdc34ac0 Add first pieces of support for parsing and representing
extern "C" in C++ mode.  Patch by Mike Stump!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45904 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-12 07:05:38 +00:00
Chris Lattner 4b1daf0db3 Fix some 80 col violations
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45808 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-10 01:43:14 +00:00
Ted Kremenek e603df40d4 Added most of the boilerplate to the driver needed to run the graph-reachability
constant propagation analysis.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45747 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-08 18:04:06 +00:00
Ted Kremenek a526c5c67e Substituted all instances of the string "Objc" for "ObjC". This fixes
some naming inconsistencies in the names of classes pertaining to Objective-C
support in clang.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45715 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-07 19:49:32 +00:00
Chris Lattner ef5a85d364 Refactor the decl printer, patch by Mike Stump!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45497 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-02 21:04:16 +00:00
Chris Lattner 0bc735ffcf Don't attribute in file headers anymore. See llvmdev for the
discussion of this change.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45410 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-29 19:59:25 +00:00
Christopher Lamb 4c92b43383 Make output files binary mode for -emit-llvm-bc
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45348 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-24 23:49:33 +00:00
Christopher Lamb 396f9fee46 Almost the best possible handling of stdin/stdout for llvm-emit-bc!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45346 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-24 20:59:36 +00:00
Christopher Lamb 8bd848f1e8 Better handing of stdin/stdout for -emit-llvm-bc
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45345 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-24 20:56:07 +00:00
Christopher Lamb 2d6c065fa9 Allow bitcode output to be redirected to stdout.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45340 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-24 03:23:55 +00:00
Seo Sanghyeon fe947ad362 Implement -emit-llvm-bc option
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45339 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-24 01:52:34 +00:00
Ted Kremenek cf6e41baf2 Directory restructing of Analysis files.
Created include/clang/Analysis/Analyses directory.
  - Moved LiveVariables.h and UninitializedValues.h into this dir.
  
Moved ExprDeclBitVector.h into Analysis/Support.

Updated all clients who use these headers to reflect the new paths.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45292 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-21 21:42:19 +00:00
Ted Kremenek ee53364163 Converted uses of scoped_ptr to OwningPtr.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45265 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-20 19:47:16 +00:00
Ted Kremenek 5411772b87 Created initial implementation of "BuildSerializer", and ASTConsumer
which serializes ASTs to a common output directory.  This ASTConsumer
is invoked using a combination of "-o" and "-serialize" from the driver.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45241 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-20 00:34:58 +00:00
Ted Kremenek f06c92806d Split serialization ASTConsumers into two consumers: SingleFileSerializer and
BuildSerializer. The former serializes a single translation unit to a
corresponding .ast file. The second serializes ASTs to a common emission
direction.  The latter is not fully implemented yet.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45232 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-19 23:49:37 +00:00
Ted Kremenek 95041a2029 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45228 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-19 22:51:13 +00:00
Ted Kremenek fdfc198013 Removed "SourceFile" from TranslationUnit. This same information will (soon)
be available by querying the SourceManager within the ASTContext referenced by
the TranslationUnit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45223 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-19 22:24:34 +00:00
Ted Kremenek 63ea863d47 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45211 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-19 19:27:38 +00:00
Ted Kremenek 3910c7ceb9 Moved generation of the name of the serialized AST file into
CreateASTSerializer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45201 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-19 17:25:59 +00:00
Ted Kremenek dca29279d7 Moved ReadBitcodeFile and EmitBitcodeFile out of TranslationUnit and made them
the standalone functions ReadASTBitcodeFile and EmitASTBitcodeFile
respectively.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45180 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-18 21:44:50 +00:00
Ted Kremenek 77cda50080 Moved TranslationUnit from Driver to AST library.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45175 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-18 21:34:28 +00:00
Ted Kremenek 3821d401a3 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45004 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-13 17:50:11 +00:00
Chris Lattner 0404cd8ab1 Set target data layout info in module.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45003 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-13 17:34:31 +00:00
Ted Kremenek a1fa3a19bf Implemented -serialize-ast option for the driver. This is not really tested
and is a work in progress.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44967 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-13 00:37:31 +00:00
Chris Lattner be6df088d6 more cleanups changing things like getInstanceVariables to iterators.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44930 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-12 07:56:42 +00:00
Chris Lattner ab4c4d5e5e resolve some fixmes and clean up some code by eliminating the get*Vars apis to some classes and use iterators instead.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44927 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-12 07:46:12 +00:00
Ted Kremenek 7a9d49fd2b Mega-patch: ripped SourceManager out of Diagnostic/DiagnosticClient. Now
SourceManager is passed by reference, allowing the SourceManager to be
associated with a specific translation unit, and not the entire execution
of the driver.

Modified all users of Diagnostics to comply with this new interface.

Integrated SourceManager as a member variable of TargetInfo. TargetInfo will
eventually be associated with a single translation unit (just like
SourceManager).

Made the SourceManager reference in ASTContext private. Provided accessor
getSourceManager() for clients to use instead. Modified clients to comply with
new interface.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44878 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-11 21:27:55 +00:00
Chris Lattner 0d6ca11db0 Fix an ast-print/ast-dump bug.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44550 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-03 21:43:25 +00:00
Chris Lattner fb97b03e42 Warn about unsupported codegen with the diags machinery, giving us:
t.c:3322:5: warning: cannot codegen this yet
    __asm__ ("bswap   %0" : "+r" (_data));
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

instead of:

Unimplemented stmt!
(AsmStmt 0x80eaa0 <t.c:3331:5, line:3334:28>)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44501 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-02 01:40:18 +00:00
Steve Naroff 1f64432558 Several fixes/simplifications surrounding how we stream top-level decl AST's.
The following code...

typedef struct cssm_data {} CSSM_DATA, *CSSM_DATA_PTR;

struct Y { int A; };

struct X { int A; } D; 

struct X E, F;

...now produces the following output...

> ../../Debug/bin/clang xx.c -ast-print
Read top-level tag decl: 'cssm_data'
typedef struct cssm_data CSSM_DATA;
typedef struct cssm_data *CSSM_DATA_PTR;
Read top-level tag decl: 'Y'
Read top-level tag decl: 'X'
Read top-level variable decl: 'D'
Read top-level variable decl: 'E'
Read top-level variable decl: 'F'

...which is much more accurate than the previous -ast-print output...

typedef struct cssm_data CSSM_DATA;
typedef struct cssm_data CSSM_DATA;
Read top-level variable decl: 'D'
Read top-level variable decl: 'E'
Read top-level variable decl: 'E'




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44421 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-28 22:54:11 +00:00
Ted Kremenek ea75c55990 Converted AST Pretty-Printer to use iostreams instead of FILE*. This fixes
a bug where the statement pretty-printer used iostreams but the AST printer
did not.  This was an issue when dumping ASTs to something other than stderr.

Updated SerializationTest to use the new iostreams interface for the AST printer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44417 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-28 21:32:21 +00:00
Chris Lattner 45e8cbdce2 Implement support for -fwritable-strings and make the code generator
merge string literals when it is not provided.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44394 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-28 05:34:05 +00:00
Ted Kremenek 1b5a4bdc85 Migrated static functions that print decls into a DeclPrinter class,
which is now used (or subclasssed) by the ASTConsumers.  This new class
stores a FILE* that is used for writing, instead of just hardwiring output
to stderr (it defaults to stderr if no FILE* is provided).

Modified CreateASTPrinter() to accept a FILE* for printing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44377 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-27 21:46:50 +00:00
Steve Naroff 91578f3cdb Make sure Sema::ParsedFreeStandingDeclSpec() returns a decl representing the type.
Adding basic printing to StmtPrinter::PrintRawDecl().



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44208 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-17 21:21:01 +00:00
Steve Naroff aaa3cf8e52 Fix regression with ObjC method definitions and -ast-print
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44088 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-13 23:48:03 +00:00
Chris Lattner a36c48676c Clean up types, removing some casts. Patch contributed by
Cedric Venet.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44050 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-13 18:16:41 +00:00
Steve Naroff 0330071714 - Minor cleanup to yesterday's changes to Sema::ObjcActOnStartOfMethodDef();
- Add Sema::CurMethodDecl, in preparation for adding ObjcIvarRefExpr.
- Add ObjcInterfaceDecl::lookupInstanceVariable(), in prep for adding ivars.
- A couple renames in ObjcInterfaceDecl, while I was in the vicinity:-)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44015 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-12 13:56:41 +00:00
Fariborz Jahanian db8f3d3bb9 pretty priting for method definitions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43986 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-10 20:59:13 +00:00