зеркало из https://github.com/microsoft/clang-1.git
"this patch properly addresses escaping < and > which might appear
(e.g. for C++ operators) in the xml dump. I also re-enabled the unit test for ast-print-xml (or so I think) at least, make test didn't fail..." patch by Sebastien Binet! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103671 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
face9818b5
Коммит
edd8df9cd2
|
@ -146,12 +146,23 @@ inline void DocumentXML::initialize(ASTContext &Context) {
|
|||
//---------------------------------------------------------
|
||||
template<class T>
|
||||
inline void DocumentXML::addAttribute(const char* pName, const T& value) {
|
||||
Out << ' ' << pName << "=\"" << value << "\"";
|
||||
std::string repr;
|
||||
{
|
||||
llvm::raw_string_ostream buf(repr);
|
||||
buf << value;
|
||||
buf.flush();
|
||||
}
|
||||
|
||||
Out << ' ' << pName << "=\""
|
||||
<< DocumentXML::escapeString(repr.c_str(), repr.size())
|
||||
<< "\"";
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
inline void DocumentXML::addPtrAttribute(const char* pName, const char* text) {
|
||||
Out << ' ' << pName << "=\"" << text << "\"";
|
||||
Out << ' ' << pName << "=\""
|
||||
<< DocumentXML::escapeString(text, strlen(text))
|
||||
<< "\"";
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
|
|
|
@ -49,7 +49,8 @@ class DocumentXML::DeclPrinter : public DeclVisitor<DocumentXML::DeclPrinter> {
|
|||
addSubNodes(cast<RecordDecl>(RD));
|
||||
|
||||
if (RD->isDefinition()) {
|
||||
Doc.addAttribute("num_bases", RD->getNumBases());
|
||||
// FIXME: This breaks XML generation
|
||||
//Doc.addAttribute("num_bases", RD->getNumBases());
|
||||
|
||||
for (CXXRecordDecl::base_class_iterator
|
||||
base = RD->bases_begin(),
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// RUN: %clang_cc1 -fsyntax-only %s
|
||||
// RUN: %clang_cc1 -ast-print %s
|
||||
// RUN: %clang_cc1 -ast-dump %s
|
||||
// FIXME: %clang_cc1 -ast-print-xml -o %t %s
|
||||
// RUN: %clang_cc1 -ast-print-xml -o %t %s
|
||||
// RUN: %clang_cc1 -print-decl-contexts %s
|
||||
// RUN: %clang_cc1 -fdump-record-layouts %s
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче