diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2016-06-15 11:19:39 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2016-06-15 11:19:39 +0000 |
commit | 0253605771b8bd9d414aba74fe2742c730d6fd1a (patch) | |
tree | 9f1f4daca071856ea8ee6557143d4f31aa230da2 /lib/Serialization/ASTWriterStmt.cpp | |
parent | 2c5cc518e88b851359b952e36c5e479a752642b2 (diff) |
[MSVC] Late parsing of in-class defined member functions in template
classes.
MSVC actively uses unqualified lookup in dependent bases, lookup at the
instantiation point (non-dependent names may be resolved on things
declared later) etc. and all this stuff is the main cause of
incompatibility between clang and MSVC.
Clang tries to emulate MSVC behavior but it may fail in many cases.
clang could store lexed tokens for member functions definitions within
ClassTemplateDecl for later parsing during template instantiation.
It will allow resolving many possible issues with lookup in dependent
base classes and removing many already existing MSVC-specific
hacks/workarounds from the clang code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@272774 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Serialization/ASTWriterStmt.cpp')
-rw-r--r-- | lib/Serialization/ASTWriterStmt.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/Serialization/ASTWriterStmt.cpp b/lib/Serialization/ASTWriterStmt.cpp index 5382b4af92..942485f209 100644 --- a/lib/Serialization/ASTWriterStmt.cpp +++ b/lib/Serialization/ASTWriterStmt.cpp @@ -297,6 +297,18 @@ void ASTStmtWriter::VisitMSAsmStmt(MSAsmStmt *S) { Code = serialization::STMT_MSASM; } +void ASTStmtWriter::VisitMSLateParsedCompoundStmt(MSLateParsedCompoundStmt *S) { + VisitStmt(S); + Record.push_back(S->tokens().size()); + Record.AddSourceLocation(S->getLocStart()); + Record.AddSourceLocation(S->getLocEnd()); + Record.AddString(S->getStringRepresentation()); + for (auto &Tok : S->tokens()) + Writer.AddToken(Tok, Record.getRecordData()); + + Code = serialization::STMT_MS_LATE_PARSED_COMPOUND; +} + void ASTStmtWriter::VisitCoroutineBodyStmt(CoroutineBodyStmt *S) { // FIXME: Implement coroutine serialization. llvm_unreachable("unimplemented"); |