diff options
author | Brett Wilson <brettw@gmail.com> | 2022-12-07 10:22:05 -0800 |
---|---|---|
committer | Brett Wilson <brettw@gmail.com> | 2022-12-07 10:22:51 -0800 |
commit | 91b38c6aaddefabad2a4c959ea3865e356761ed5 (patch) | |
tree | d1bc4aa66f0e8d9a7c2a06b03b713b383a23f7be /clang-tools-extra/clang-doc/BitcodeReader.cpp | |
parent | f1fd5c9b365b1280923fa83444af024fa5204a29 (diff) | |
download | llvm-91b38c6aaddefabad2a4c959ea3865e356761ed5.zip llvm-91b38c6aaddefabad2a4c959ea3865e356761ed5.tar.gz llvm-91b38c6aaddefabad2a4c959ea3865e356761ed5.tar.bz2 |
Revert "[clang-doc] Add template support."
Causes a build failure in YAML specializations.
This reverts commit 0f6dbb5f164662c3e6a167a89e7a89f07c60e32b.
Diffstat (limited to 'clang-tools-extra/clang-doc/BitcodeReader.cpp')
-rw-r--r-- | clang-tools-extra/clang-doc/BitcodeReader.cpp | 85 |
1 files changed, 0 insertions, 85 deletions
diff --git a/clang-tools-extra/clang-doc/BitcodeReader.cpp b/clang-tools-extra/clang-doc/BitcodeReader.cpp index 3fb8505..0720114 100644 --- a/clang-tools-extra/clang-doc/BitcodeReader.cpp +++ b/clang-tools-extra/clang-doc/BitcodeReader.cpp @@ -351,8 +351,6 @@ llvm::Error parseRecord(const Record &R, unsigned ID, llvm::StringRef Blob, return decodeRecord(R, I->USR, Blob); case REFERENCE_NAME: return decodeRecord(R, I->Name, Blob); - case REFERENCE_QUAL_NAME: - return decodeRecord(R, I->QualName, Blob); case REFERENCE_TYPE: return decodeRecord(R, I->RefType, Blob); case REFERENCE_PATH: @@ -365,29 +363,6 @@ llvm::Error parseRecord(const Record &R, unsigned ID, llvm::StringRef Blob, } } -llvm::Error parseRecord(const Record &R, unsigned ID, llvm::StringRef Blob, - TemplateInfo *I) { - // Currently there are no child records of TemplateInfo (only child blocks). - return llvm::createStringError(llvm::inconvertibleErrorCode(), - "invalid field for TemplateParamInfo"); -} - -llvm::Error parseRecord(const Record &R, unsigned ID, llvm::StringRef Blob, - TemplateSpecializationInfo *I) { - if (ID == TEMPLATE_SPECIALIZATION_OF) - return decodeRecord(R, I->SpecializationOf, Blob); - return llvm::createStringError(llvm::inconvertibleErrorCode(), - "invalid field for TemplateParamInfo"); -} - -llvm::Error parseRecord(const Record &R, unsigned ID, llvm::StringRef Blob, - TemplateParamInfo *I) { - if (ID == TEMPLATE_PARAM_CONTENTS) - return decodeRecord(R, I->Contents, Blob); - return llvm::createStringError(llvm::inconvertibleErrorCode(), - "invalid field for TemplateParamInfo"); -} - template <typename T> llvm::Expected<CommentInfo *> getCommentInfo(T I) { return llvm::createStringError(llvm::inconvertibleErrorCode(), "invalid type cannot contain CommentInfo"); @@ -620,45 +595,6 @@ template <> void addChild(BaseRecordInfo *I, FunctionInfo &&R) { I->Children.Functions.emplace_back(std::move(R)); } -// TemplateParam children. These go into either a TemplateInfo (for template -// parameters) or TemplateSpecializationInfo (for the specialization's -// parameters). -template <typename T> void addTemplateParam(T I, TemplateParamInfo &&P) { - llvm::errs() << "invalid container for template parameter"; - exit(1); -} -template <> void addTemplateParam(TemplateInfo *I, TemplateParamInfo &&P) { - I->Params.emplace_back(std::move(P)); -} -template <> -void addTemplateParam(TemplateSpecializationInfo *I, TemplateParamInfo &&P) { - I->Params.emplace_back(std::move(P)); -} - -// Template info. These apply to either records or functions. -template <typename T> void addTemplate(T I, TemplateInfo &&P) { - llvm::errs() << "invalid container for template info"; - exit(1); -} -template <> void addTemplate(RecordInfo *I, TemplateInfo &&P) { - I->Template.emplace(std::move(P)); -} -template <> void addTemplate(FunctionInfo *I, TemplateInfo &&P) { - I->Template.emplace(std::move(P)); -} - -// Template specializations go only into template records. -template <typename T> -void addTemplateSpecialization(T I, TemplateSpecializationInfo &&TSI) { - llvm::errs() << "invalid container for template specialization info"; - exit(1); -} -template <> -void addTemplateSpecialization(TemplateInfo *I, - TemplateSpecializationInfo &&TSI) { - I->Specialization.emplace(std::move(TSI)); -} - // Read records from bitcode into a given info. template <typename T> llvm::Error ClangDocBitcodeReader::readRecord(unsigned ID, T I) { @@ -783,27 +719,6 @@ llvm::Error ClangDocBitcodeReader::readSubBlock(unsigned ID, T I) { addChild(I, std::move(EV)); return llvm::Error::success(); } - case BI_TEMPLATE_BLOCK_ID: { - TemplateInfo TI; - if (auto Err = readBlock(ID, &TI)) - return Err; - addTemplate(I, std::move(TI)); - return llvm::Error::success(); - } - case BI_TEMPLATE_SPECIALIZATION_BLOCK_ID: { - TemplateSpecializationInfo TSI; - if (auto Err = readBlock(ID, &TSI)) - return Err; - addTemplateSpecialization(I, std::move(TSI)); - return llvm::Error::success(); - } - case BI_TEMPLATE_PARAM_BLOCK_ID: { - TemplateParamInfo TPI; - if (auto Err = readBlock(ID, &TPI)) - return Err; - addTemplateParam(I, std::move(TPI)); - return llvm::Error::success(); - } case BI_TYPEDEF_BLOCK_ID: { TypedefInfo TI; if (auto Err = readBlock(ID, &TI)) |