summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-doc/BitcodeWriter.cpp
diff options
context:
space:
mode:
authorDiego Astiazaran <diegoaat97@gmail.com>2019-08-09 17:49:41 +0000
committerDiego Astiazaran <diegoaat97@gmail.com>2019-08-09 17:49:41 +0000
commit665e9676c257124b97a469b98a05c42df9b99d1d (patch)
treef8d104607da2485119a540c893c342dc635a1677 /clang-tools-extra/clang-doc/BitcodeWriter.cpp
parent2bf522aea62e4fb653cacb68072167d25149099e (diff)
[clang-format] Add link to source code in file definitions
Two command line options have been added to clang-doc. --repository=<string> - URL of repository that hosts code; used for links to definition locations. --source-root=<string> - Directory where processed files are stored. Links to definition locations will only be generated if the file is in this dir. If the file is in the source-root and a repository options is passed; a link to the source code will be rendered by the HTML generator. Differential Revision: https://reviews.llvm.org/D65483 llvm-svn: 368460
Diffstat (limited to 'clang-tools-extra/clang-doc/BitcodeWriter.cpp')
-rw-r--r--clang-tools-extra/clang-doc/BitcodeWriter.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/clang-tools-extra/clang-doc/BitcodeWriter.cpp b/clang-tools-extra/clang-doc/BitcodeWriter.cpp
index d26f3dbfe831..5142f1df6ee6 100644
--- a/clang-tools-extra/clang-doc/BitcodeWriter.cpp
+++ b/clang-tools-extra/clang-doc/BitcodeWriter.cpp
@@ -77,10 +77,13 @@ static void LocationAbbrev(std::shared_ptr<llvm::BitCodeAbbrev> &Abbrev) {
{// 0. Fixed-size integer (line number)
llvm::BitCodeAbbrevOp(llvm::BitCodeAbbrevOp::Fixed,
BitCodeConstants::LineNumberSize),
- // 1. Fixed-size integer (length of the following string (filename))
+ // 1. Boolean (IsFileInRootDir)
+ llvm::BitCodeAbbrevOp(llvm::BitCodeAbbrevOp::Fixed,
+ BitCodeConstants::BoolSize),
+ // 2. Fixed-size integer (length of the following string (filename))
llvm::BitCodeAbbrevOp(llvm::BitCodeAbbrevOp::Fixed,
BitCodeConstants::StringLengthSize),
- // 2. The string blob
+ // 3. The string blob
llvm::BitCodeAbbrevOp(llvm::BitCodeAbbrevOp::Blob)});
}
@@ -316,6 +319,7 @@ void ClangDocBitcodeWriter::emitRecord(const Location &Loc, RecordId ID) {
// FIXME: Assert that the line number is of the appropriate size.
Record.push_back(Loc.LineNumber);
assert(Loc.Filename.size() < (1U << BitCodeConstants::StringLengthSize));
+ Record.push_back(Loc.IsFileInRootDir);
Record.push_back(Loc.Filename.size());
Stream.EmitRecordWithBlob(Abbrevs.get(ID), Record, Loc.Filename);
}