Commit Graph

27 Commits

Author SHA1 Message Date
Ted Kremenek 71d643f8b1 Converted uses of scoped_ptr to OwningPtr.
llvm-svn: 45265
2007-12-20 19:47:16 +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 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 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 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 25dbd71a4c Fixed broken includes introduced by recent (incomplete) patch to
TranslationUnit.

llvm-svn: 45177
2007-12-18 21:36:21 +00:00
Ted Kremenek e095881856 Converted SerializationTest (--test-pickling) to use the new TranslationUnit
class to serialize and deserialize translation units.

llvm-svn: 44634
2007-12-05 22:08:43 +00:00
Ted Kremenek dd1a7aade5 Modified: CreateTargetInfo(). Now takes Diagnostic* instead of Diagnostic&.
Modified: ctor of SerializationTest: Now takes LangOptions argument.  We
          will eventually serialize this as well.

llvm-svn: 44630
2007-12-05 21:34:36 +00:00
Ted Kremenek 166e505d27 Added serialization support of SourceManager to the clang driver.
llvm-svn: 44592
2007-12-05 00:26:13 +00:00
Ted Kremenek 8e3a2a93aa Implemented serialization of TargetInfo.
SerializationTest (subclass of ASTConsumer) now takes Diagnostics& in its ctor.

llvm-svn: 44555
2007-12-03 22:48:14 +00:00
Ted Kremenek c9bcda94ae Implemented serialization of SelectorTable and Selectors.
Modified serialization of IdentifierTable to self-register itself with
the Deserializer.

llvm-svn: 44471
2007-11-30 22:46:56 +00:00
Ted Kremenek 870600d625 Only serialize top-level decls that appear at the head of a decl chain.
llvm-svn: 44438
2007-11-29 19:04:54 +00:00
Ted Kremenek 1150e25901 Enhanced serialization testing by also pretty-printing CFGs constructed from ASTs
both before and after serialization/deserialization. If the CFGs between the pre-
and post- serialized/deserialized ASTs differ, the serialization has failed.

llvm-svn: 44429
2007-11-29 01:24:25 +00:00
Ted Kremenek 5933768bec 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.

llvm-svn: 44417
2007-11-28 21:32:21 +00:00
Ted Kremenek ac76a41717 Modified --test-pickling to perform an actual cross-check of serialized ASTs:
(1) Parsed ASTs are pretty-printed to a text file.
(2) The ASTs are serialized to disk.
(3) The ASTs are deserialized from disk.
(4) The deserialized ASTs are pretty-printed to a text file.
(5) The two pretty-printed files are compared. If they are different, the test
    fails.

llvm-svn: 44411
2007-11-28 19:21:47 +00:00
Ted Kremenek 31ae973708 SourceManager, IdentifierTable, Selectors are now serialized in their own
block separate from ASTContext. This block is serialized out AFTER writing out
ASTContext, but deserialized BEFORE reading in ASTContext. This permits the
optimization of the serialization of the IdentifierTable where we only write
out identifiers that are used.

This was needed because TagDecls are owned by Types, and TagDecls contain
identifiers. Thus types need to be written out first to register with the
serializer any identifiers they refer to (and hence need to be serialized out
with IdentifierTable).

llvm-svn: 44125
2007-11-14 17:46:35 +00:00
Ted Kremenek 767e7507c2 Added pretty-printing of statements during serialization.
llvm-svn: 44078
2007-11-13 22:56:10 +00:00
Ted Kremenek 11d700bfba Modifed the test serialization driver to...
(1) serialize out top-level decls BEFORE serializing out translation unit
structures like ASTContext.

(2) deserialize out translation unit structures like ASTContext before
top-level decls by first skipping the decls in the bitstream, deserializing
ASTContext and friends, and then jumping back to the bitstream block with the
decls and then deserializing them.

Change (1) allows us to utilize the pointer-tracking system in the Serializer
to only serialize out metadata that is actually referenced by the ASTS.

Change (2) allows us to deserialize the metadata first as before, which
signficantly reduces the amount of pointer backpatching the deserializer
would have to do if the decls were deserialized first.

llvm-svn: 43974
2007-11-10 02:07:12 +00:00
Ted Kremenek fa2bf434cc Fixed typo in the name of "ReadPreamble".
llvm-svn: 43790
2007-11-06 23:52:19 +00:00
Ted Kremenek 93d446f535 Bug fix: inverted test condition to see if a serialized AST-bitcode
file had the correct preamble.

llvm-svn: 43785
2007-11-06 22:23:03 +00:00
Ted Kremenek 3a68de993a Revampled Serialization Tester to serialize and deserialize out an entire ASTContext and top-level decls.
llvm-svn: 43773
2007-11-06 19:50:53 +00:00
Ted Kremenek 15f50ba755 In driver code implemented serialization of ASTContext. Working on serialization of simple ASTs.
llvm-svn: 43738
2007-11-05 21:39:35 +00:00
Ted Kremenek 37a3275919 Modified current clients of Bitcode-Object serialization to use the
new split-header file configuration (Serialize.h and Deserialize.h)
now in place in the core LLVM repository.

Removed unneeded SerializeTrait specializations for enums in
TokenKinds.h

llvm-svn: 43306
2007-10-24 19:06:02 +00:00
Ted Kremenek f25f4a3de0 Implemented serialization for IdentifierInfo and IdentifierTable.
Updated serialization test code in the driver to test serialization of
these types.

llvm-svn: 43266
2007-10-23 22:18:37 +00:00
Hartmut Kaiser 7078da8e58 Updated VC++ build system.
Silenced some VC++ warnings.
Had to rephrase a partial specialization of the IntrospectionTrait struct in SerializationTest.cpp, please review.
Added a compiler specific workaround in IdentifierTable.h. Is that the way to fix this kind of issues?

llvm-svn: 43074
2007-10-17 15:00:17 +00:00
Anders Carlsson 86edafc6d6 Fix the build.
llvm-svn: 43057
2007-10-17 00:50:25 +00:00
Ted Kremenek 4e816133c8 Started work on clang object serialization. Experimental
serialization logic as well as driver code is now in
Driver/SerializationTest.cpp.  The status of this code is that it
should be used by no clients.

Added --test-pickling option to driver to run the serialization code.

Modified IdentifierInfo and IdentifierTable to have friend classes
that permit object serialization.  Such friendship may not be needed
in the final design.

llvm-svn: 43052
2007-10-16 23:37:27 +00:00