From f298113c4ee410f561731921f4cabacdb8ddc232 Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Fri, 11 Dec 2020 19:49:16 -0800 Subject: [PATCH] Fix code generation for Endian template parameter values on LLVM 11 --- atdna/main.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/atdna/main.cpp b/atdna/main.cpp index b21eda3..464388b 100644 --- a/atdna/main.cpp +++ b/atdna/main.cpp @@ -419,7 +419,7 @@ class ATDNAEmitVisitor : public clang::RecursiveASTVisitor { regType = regType->getUnqualifiedDesugaredType(); } - std::string fieldName = field->getName(); + std::string fieldName = field->getName().str(); std::string propIdExpr = GetPropIdExpr(field, fieldName); if (regType->getTypeClass() == clang::Type::TemplateSpecialization) { @@ -431,6 +431,8 @@ class ATDNAEmitVisitor : public clang::RecursiveASTVisitor { llvm::APSInt endian(64, -1); std::string endianExprStr; bool defaultEndian = true; + /* FIXME: The is the following code required? */ +#if 0 if (classParms->size() >= 2) { const clang::NamedDecl* endianParm = classParms->getParam(1); if (endianParm->getKind() == clang::Decl::NonTypeTemplateParm) { @@ -439,7 +441,7 @@ class ATDNAEmitVisitor : public clang::RecursiveASTVisitor { nttParm->print(strStream, context.getPrintingPolicy()); } } - +#endif for (const clang::TemplateArgument& arg : *tsType) { if (arg.getKind() == clang::TemplateArgument::Expression) { const clang::Expr* expr = arg.getAsExpr(); @@ -818,7 +820,7 @@ class ATDNAEmitVisitor : public clang::RecursiveASTVisitor { regType = regType->getUnqualifiedDesugaredType(); } - std::string fieldName = field->getName(); + std::string fieldName = field->getName().str(); std::string propIdExpr = GetPropIdExpr(field, fieldName); if (regType->getTypeClass() == clang::Type::TemplateSpecialization) {