aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/PCHContainerOperations.cpp
AgeCommit message (Collapse)AuthorFilesLines
2016-11-08Bitcode: Decouple block info block state from reader.Peter Collingbourne1-3/+3
As proposed on llvm-dev: http://lists.llvm.org/pipermail/llvm-dev/2016-October/106630.html Move block info block state to a new class, BitstreamBlockInfo. Clients may set the block info for a particular cursor with the BitstreamCursor::setBlockInfo() method. At this point BitstreamReader is not much more than a container for an ArrayRef<uint8_t>, so remove it and replace all uses with direct uses of memory buffers. Differential Revision: https://reviews.llvm.org/D26259 llvm-svn: 286207
2016-11-02Bitcode: Change reader interface to take memory buffers.Peter Collingbourne1-2/+1
As proposed on llvm-dev: http://lists.llvm.org/pipermail/llvm-dev/2016-October/106595.html This change also fixes an API oddity where BitstreamCursor::Read() would return zero for the first read past the end of the bitstream, but would report_fatal_error for subsequent reads. Now we always report_fatal_error for all reads past the end. Updated clients to check for the end of the bitstream before reading from it. I also needed to add padding to the invalid bitcode tests in test/Bitcode/. This is because the streaming interface was not checking that the file size is a multiple of 4. Differential Revision: https://reviews.llvm.org/D26219 llvm-svn: 285773
2016-07-15Frontend: Simplify ownership model for clang's output streams.Peter Collingbourne1-5/+5
This changes the CompilerInstance::createOutputFile function to return a std::unique_ptr<llvm::raw_ostream>, rather than an llvm::raw_ostream implicitly owned by the CompilerInstance. This in most cases required that I move ownership of the output stream to the relevant ASTConsumer. The motivation for this change is to allow BackendConsumer to be a client of interfaces such as D20268 which take ownership of the output stream. Differential Revision: http://reviews.llvm.org/D21537 llvm-svn: 275507
2016-05-27Apply clang-tidy's misc-move-constructor-init throughout Clang.Benjamin Kramer1-2/+3
No functionality change intended, maybe a tiny performance improvement. llvm-svn: 270996
2016-02-01Remove the egregious PCHContainer layering hack that doesn't seem to be ↵Benjamin Kramer1-0/+3
necessary anymore. llvm-svn: 259355
2015-09-19Further simplify the interface of PCHContainerGeneratorAdrian Prantl1-3/+3
by dropping the const qualifier on the CI. NFC llvm-svn: 248101
2015-09-18Simplify the interface of PCHContainerGenerator and friendsAdrian Prantl1-14/+5
by passing in a CompilerInstance instead of all its individual members. NFC. llvm-svn: 248053
2015-09-10Re-commit r247218: "Fix Clang-tidy misc-use-override warnings, other minor ↵Hans Wennborg1-2/+4
fixes" This never broke the build; it was the LLVM side, r247216, that caused problems. llvm-svn: 247302
2015-09-10Revert r247218: "Fix Clang-tidy misc-use-override warnings, other minor fixes"Hans Wennborg1-4/+2
Seems it broke the Polly build. From http://lab.llvm.org:8011/builders/perf-x86_64-penryn-O3-polly-fast/builds/11687/steps/compile/logs/stdio: In file included from /home/grosser/buildslave/perf-x86_64-penryn-O3-polly-fast/llvm.src/lib/TableGen/Record.cpp:14:0: /home/grosser/buildslave/perf-x86_64-penryn-O3-polly-fast/llvm.src/include/llvm/TableGen/Record.h:369:3: error: looser throw specifier for 'virtual llvm::TypedInit::~TypedInit()' /home/grosser/buildslave/perf-x86_64-penryn-O3-polly-fast/llvm.src/include/llvm/TableGen/Record.h:270:11: error: overriding 'virtual llvm::Init::~Init() noexcept (true)' llvm-svn: 247222
2015-09-10Fix Clang-tidy misc-use-override warnings, other minor fixesHans Wennborg1-2/+4
Patch by Eugene Zelenko! Differential Revision: http://reviews.llvm.org/D12741 llvm-svn: 247218
2015-07-17Make the clang module container format selectable from the command line.Adrian Prantl1-13/+18
- introduces a new cc1 option -fmodule-format=[raw,obj] with 'raw' being the default - supports arbitrary module container formats that libclang is agnostic to - adds the format to the module hash to avoid collisions - splits the old PCHContainerOperations into PCHContainerWriter and a PCHContainerReader. Thanks to Richard Smith for reviewing this patch! llvm-svn: 242499
2015-07-09Revert r241770 and add Basic to the dependencies of clang-check instead.Adrian Prantl1-3/+0
PR24067. llvm-svn: 241782
2015-07-09Move the definition of ~PCHContainerOperations from Basic into Frontend.Adrian Prantl1-0/+3
Fixes PR24067. llvm-svn: 241770
2015-07-08Revert "Revert r241620 and follow-up commits" and move the initializationAdrian Prantl1-2/+0
of the llvm targets from clang/CodeGen into ClangCheck.cpp and CIndex.cpp. llvm-svn: 241653
2015-07-07Revert r241620 and follow-up commits while investigating linux buildbot ↵Adrian Prantl1-0/+2
failures. llvm-svn: 241642
2015-07-07Wrap clang modules and pch files in an object file container.Adrian Prantl1-2/+0
This patch adds ObjectFilePCHContainerOperations uses the LLVM backend to put the contents of a PCH into a __clangast section inside a COFF, ELF, or Mach-O object file container. This is done to facilitate module debugging by makeing it possible to store the debug info for the types defined by a module alongside the AST. rdar://problem/20091852 llvm-svn: 241620
2015-06-20Introduce a PCHContainerOperations interface (NFC).Adrian Prantl1-0/+70
A PCHContainerOperations abstract interface provides operations for creating and unwrapping containers for serialized ASTs (precompiled headers and clang modules). The default implementation is RawPCHContainerOperations, which uses a flat file for the output. The main application for this interface will be an ObjectFilePCHContainerOperations implementation that uses LLVM to wrap the module in an ELF/Mach-O/COFF container to store debug info alongside the AST. rdar://problem/20091852 llvm-svn: 240225