From: Reid Kleckner Date: Fri, 28 Feb 2014 01:12:55 +0000 (+0000) Subject: Attempt to fix non-MSVC build X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ea890c87c825a3cc4b00f0fb81e1c6a40eb53f5a;p=clang Attempt to fix non-MSVC build git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202458 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/RecordLayoutBuilder.cpp b/lib/AST/RecordLayoutBuilder.cpp index 06f6ecb3dd..cc0d7fded9 100644 --- a/lib/AST/RecordLayoutBuilder.cpp +++ b/lib/AST/RecordLayoutBuilder.cpp @@ -3070,6 +3070,16 @@ static void PrintIndentNoOffset(raw_ostream &OS, unsigned IndentLevel) { OS.indent(IndentLevel * 2); } +namespace { +struct BaseOffsetComparator { + const ASTRecordLayout &RL; + BaseOffsetComparator(const ASTRecordLayout &RL) : RL(RL) {} + bool operator()(const CXXRecordDecl *L, const CXXRecordDecl *R) const { + return RL.getBaseClassOffset(L) < RL.getBaseClassOffset(R); + } +}; +} + static void DumpCXXRecordLayout(raw_ostream &OS, const CXXRecordDecl *RD, const ASTContext &C, CharUnits Offset, @@ -3114,13 +3124,6 @@ static void DumpCXXRecordLayout(raw_ostream &OS, } // Sort nvbases by offset. - struct BaseOffsetComparator { - const ASTRecordLayout &RL; - BaseOffsetComparator(const ASTRecordLayout &RL) : RL(RL) {} - bool operator()(const CXXRecordDecl *L, const CXXRecordDecl *R) const { - return RL.getBaseClassOffset(L) < RL.getBaseClassOffset(R); - } - }; BaseOffsetComparator Cmp(Layout); std::stable_sort(Bases.begin(), Bases.end(), Cmp);