aboutsummaryrefslogtreecommitdiff
path: root/clang-tools-extra/clang-doc/BitcodeReader.cpp
diff options
context:
space:
mode:
authorPaul Kirth <paulkirth@google.com>2025-04-29 14:57:35 -0700
committerGitHub <noreply@github.com>2025-04-29 14:57:35 -0700
commit97ec3ef4ab0eaf5e1fde9a3bf4bf4a9aaad49f33 (patch)
treeb97d07e95cc380531faff01b20c50a71a9b42c03 /clang-tools-extra/clang-doc/BitcodeReader.cpp
parentd431921677ae923d189ff2d6f188f676a2964ed8 (diff)
downloadllvm-97ec3ef4ab0eaf5e1fde9a3bf4bf4a9aaad49f33.zip
llvm-97ec3ef4ab0eaf5e1fde9a3bf4bf4a9aaad49f33.tar.gz
llvm-97ec3ef4ab0eaf5e1fde9a3bf4bf4a9aaad49f33.tar.bz2
[clang-doc] Add start and end line numbers (#137732)
This patch adds start and end line numbers to clang-doc. Currently clang-doc only encodes the start line numbers of records, struct, etc. This patch adds start and end line number to clang-doc bitcode which is passed to the generator. This will be used by the mustache backend to generate line ranges. Based on the orginal patch in #135081. Co-author: Paul Kirth <paulkirth@google.com> Co-authored-by: PeterChou1 <peter.chou@mail.utoronto.ca>
Diffstat (limited to 'clang-tools-extra/clang-doc/BitcodeReader.cpp')
-rw-r--r--clang-tools-extra/clang-doc/BitcodeReader.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/clang-tools-extra/clang-doc/BitcodeReader.cpp b/clang-tools-extra/clang-doc/BitcodeReader.cpp
index 92674c5..f8e338eb7 100644
--- a/clang-tools-extra/clang-doc/BitcodeReader.cpp
+++ b/clang-tools-extra/clang-doc/BitcodeReader.cpp
@@ -79,7 +79,8 @@ static llvm::Error decodeRecord(const Record &R, std::optional<Location> &Field,
if (R[0] > INT_MAX)
return llvm::createStringError(llvm::inconvertibleErrorCode(),
"integer too large to parse");
- Field.emplace(static_cast<int>(R[0]), Blob, static_cast<bool>(R[1]));
+ Field.emplace(static_cast<int>(R[0]), static_cast<int>(R[1]), Blob,
+ static_cast<bool>(R[2]));
return llvm::Error::success();
}
@@ -130,7 +131,8 @@ static llvm::Error decodeRecord(const Record &R,
if (R[0] > INT_MAX)
return llvm::createStringError(llvm::inconvertibleErrorCode(),
"integer too large to parse");
- Field.emplace_back(static_cast<int>(R[0]), Blob, static_cast<bool>(R[1]));
+ Field.emplace_back(static_cast<int>(R[0]), static_cast<int>(R[1]), Blob,
+ static_cast<bool>(R[2]));
return llvm::Error::success();
}