forked from OSchip/llvm-project
Fix unused variable warning in tablegen generated code
llvm-svn: 338831
This commit is contained in:
parent
9b30213828
commit
cd75901de3
|
@ -3274,11 +3274,15 @@ static std::string GenerateCustomAppertainsTo(const Record &Subject,
|
|||
return "";
|
||||
}
|
||||
|
||||
const StringRef CheckCodeValue = Subject.getValueAsString("CheckCode");
|
||||
|
||||
OS << "static bool " << FnName << "(const Decl *D) {\n";
|
||||
OS << " if (const auto *S = dyn_cast<";
|
||||
OS << GetSubjectWithSuffix(Base);
|
||||
OS << ">(D))\n";
|
||||
OS << " return " << Subject.getValueAsString("CheckCode") << ";\n";
|
||||
if (CheckCodeValue != "false") {
|
||||
OS << " if (const auto *S = dyn_cast<";
|
||||
OS << GetSubjectWithSuffix(Base);
|
||||
OS << ">(D))\n";
|
||||
OS << " return " << Subject.getValueAsString("CheckCode") << ";\n";
|
||||
}
|
||||
OS << " return false;\n";
|
||||
OS << "}\n\n";
|
||||
|
||||
|
|
Loading…
Reference in New Issue