aboutsummaryrefslogtreecommitdiff
path: root/Driver/SerializationTest.cpp
AgeCommit message (Collapse)Author
2009-03-24Move <root>/Driver into <root>/tools/clang-cc.Daniel Dunbar
Again, I tried to update cmake but it is untested. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67605 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-13[LLVM up] Update for raw_fd_ostream change. This fixes a FIXME thatDaniel Dunbar
the Backend output should be done in binary mode. - I'd appreciate it if someone who has a Windows build could verify this. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59221 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-13Patch by Csaba Hruska!Ted Kremenek
"Here is a patch what replaces std::ostream with llvm::raw_ostream. This patch covers the AST library, but ignores Analysis lib." git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56185 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-11More #include cleaningDaniel Dunbar
- Drop Expr.h,RecordLayout.h from ASTContext.h (for DeclBase.h and SourceLocation.h) - Move ASTContext constructor into implementation git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54627 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-08Unbreak SerializationTest and the Rewriter by doing the work in ↵Ted Kremenek
HandleTranslationUnit instead of the destructor. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54513 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-04Moved LangOptions from TranslationUnit to ASTContext. This induced a ↵Ted Kremenek
variety of cleanups in some ASTConsumers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51943 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-21Fix the destruction "properly" in the sense that we actually destroy the Eli Friedman
ASTs. This is a hack, but I haven't considered how we really want to do this. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51364 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-23TranslationUnit now owns IdentifierTable, TargetInfo, and Selectors objectsTed Kremenek
when it is constructed via deserialization. This is done by recording a flag indicating that this is the case, and it deletes these objects by getting the references stored in the ASTContext object. This fixes some memory leaks that occurs when we deserialize translation units from bitcode files. The rationale between having TranslationUnit sometimes own these objects and sometimes not is that a TranslationUnit object can be constructed from state generated by the parser (Preprocessor; semantic analyzer, etc.), and thus in these cases won't own the IdentifierTable or Selectors, etc. During deserialization, there is no Preprocessor, so somebody needs to own these objects in order for them to be properly reclaimed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50149 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-03Call delete on the deserialized TranslationUnit object.Sam Bishop
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49136 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-01Update to match simplified llvm MemoryBuffer interfaces for files.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49042 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-10Add some missing #includes for GCC mainline, patch by Shantonu Sen!Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48153 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-29Don't attribute in file headers anymore. See llvmdev for theChris Lattner
discussion of this change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45410 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-20Converted uses of scoped_ptr to OwningPtr.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45265 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-19Interned MainFileID within SourceManager. Since SourceManager is referenced byTed Kremenek
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-19Removed "SourceFile" from TranslationUnit. This same information will (soon)Ted Kremenek
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-19Removed storing inode and device number in TranslationUnit.Ted Kremenek
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-18Moved ReadBitcodeFile and EmitBitcodeFile out of TranslationUnit and made themTed Kremenek
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-18Fixed broken includes introduced by recent (incomplete) patch toTed Kremenek
TranslationUnit. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45177 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-05Converted SerializationTest (--test-pickling) to use the new TranslationUnitTed Kremenek
class to serialize and deserialize translation units. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44634 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-05Modified: CreateTargetInfo(). Now takes Diagnostic* instead of Diagnostic&.Ted Kremenek
Modified: ctor of SerializationTest: Now takes LangOptions argument. We will eventually serialize this as well. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44630 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-05Added serialization support of SourceManager to the clang driver.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44592 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-03Implemented serialization of TargetInfo.Ted Kremenek
SerializationTest (subclass of ASTConsumer) now takes Diagnostics& in its ctor. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44555 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-30Implemented serialization of SelectorTable and Selectors.Ted Kremenek
Modified serialization of IdentifierTable to self-register itself with the Deserializer. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44471 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-29Only serialize top-level decls that appear at the head of a decl chain.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44438 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-29Enhanced serialization testing by also pretty-printing CFGs constructed from ↵Ted Kremenek
ASTs both before and after serialization/deserialization. If the CFGs between the pre- and post- serialized/deserialized ASTs differ, the serialization has failed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44429 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-28Converted AST Pretty-Printer to use iostreams instead of FILE*. This fixesTed Kremenek
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-28Modified --test-pickling to perform an actual cross-check of serialized ASTs:Ted Kremenek
(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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44411 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-14SourceManager, IdentifierTable, Selectors are now serialized in their ownTed Kremenek
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). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44125 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-13Added pretty-printing of statements during serialization.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44078 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-10Modifed the test serialization driver to...Ted Kremenek
(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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43974 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-06Fixed typo in the name of "ReadPreamble".Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43790 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-06Bug fix: inverted test condition to see if a serialized AST-bitcodeTed Kremenek
file had the correct preamble. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43785 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-06Revampled Serialization Tester to serialize and deserialize out an entire ↵Ted Kremenek
ASTContext and top-level decls. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43773 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-05In driver code implemented serialization of ASTContext. Working on ↵Ted Kremenek
serialization of simple ASTs. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43738 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-24Modified current clients of Bitcode-Object serialization to use theTed Kremenek
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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43306 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-23Implemented serialization for IdentifierInfo and IdentifierTable.Ted Kremenek
Updated serialization test code in the driver to test serialization of these types. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43266 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-17Updated VC++ build system.Hartmut Kaiser
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? git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43074 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-17Fix the build.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43057 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-16Started work on clang object serialization. ExperimentalTed Kremenek
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43052 91177308-0d34-0410-b5e6-96231b3b80d8