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

40 Коммитов

Автор SHA1 Сообщение Дата
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
Fariborz Jahanian 82a5fe3d1c Patch for objc2's property ASTs, as well as pretty-priting the ASTs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43778 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-06 22:01:00 +00:00
Devang Patel 7a4718e813 Take 2.
Make target info available to clang code generator.  This is far from complete but this helps clang codegen module make progress.

At the moment target triplet and target description strings are hard coded in clang::TargetInfo


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43572 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-31 20:01:01 +00:00
Chris Lattner e03cd7b7c8 temporarily revert devang's patch to link in the llvm codegen etc.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43544 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-31 04:53:03 +00:00
Devang Patel f767e218ee Make target info available to clang code generator.
This is far from complete but this helps clang codegen module
make progress.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43536 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-31 00:59:29 +00:00
Fariborz Jahanian edcfb42e5e Pretty printing for ivar list of an interface block.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43382 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-26 16:29:12 +00:00
Steve Naroff 8de2826e4d Fix -ast-dump for ObjC.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42967 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-14 17:03:01 +00:00
Fariborz Jahanian 243b64b000 This patch implementa objective-c's @compatibilty-alias declaration.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42883 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-11 23:42:27 +00:00
Fariborz Jahanian e37882ad33 Added a new class for Interfaces qualified by protocol list.
Protocols are now sorted and made unique in the list.
Enhanced pretty printer for @interface (So, I can see the protocol list).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42776 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-08 23:06:41 +00:00
Fariborz Jahanian ab0aeb0bf3 Several small patches to do pretty printing for objective-c top-level decls
(minimal printing), Derive ObjcClassDecl from Decl. Ted may want to 
take note of the change I made to CFGRecStmtDeclVisitor.h


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42764 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-08 18:53:38 +00:00
Chris Lattner 97e8b6f3c5 Rename ASTStreamers.* -> ASTConsumers.*
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42718 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-07 06:04:32 +00:00