diff options
author | dim <dim@FreeBSD.org> | 2011-02-27 01:32:10 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2011-02-27 01:32:10 +0000 |
commit | b951d621be1d00a520871c689c1cd687b6aa3ae6 (patch) | |
tree | 5c342f2374324ffec4626f558d9aa49f323f90b4 /contrib/llvm/tools/clang/lib/AST/ASTImporter.cpp | |
parent | 4004d6a3076e94bd23e681411c43682267a202fe (diff) | |
parent | a0fb00f9837bd0d2e5948f16f6a6b82a7a628f51 (diff) | |
download | FreeBSD-src-b951d621be1d00a520871c689c1cd687b6aa3ae6.zip FreeBSD-src-b951d621be1d00a520871c689c1cd687b6aa3ae6.tar.gz |
Update llvm/clang to trunk r126547.
There are several bugfixes in this update, but the most important one is
to ensure __start_ and __stop_ symbols for linker sets and kernel module
metadata are always emitted in object files:
http://llvm.org/bugs/show_bug.cgi?id=9292
Before this fix, if you compiled kernel modules with clang, they would
not be properly processed by kldxref, and if they had any dependencies,
the kernel would fail to load those. Another problem occurred when
attempting to mount a tmpfs filesystem, which would result in 'operation
not supported by device'.
Diffstat (limited to 'contrib/llvm/tools/clang/lib/AST/ASTImporter.cpp')
-rw-r--r-- | contrib/llvm/tools/clang/lib/AST/ASTImporter.cpp | 48 |
1 files changed, 12 insertions, 36 deletions
diff --git a/contrib/llvm/tools/clang/lib/AST/ASTImporter.cpp b/contrib/llvm/tools/clang/lib/AST/ASTImporter.cpp index 65c0a3b..21f10fb 100644 --- a/contrib/llvm/tools/clang/lib/AST/ASTImporter.cpp +++ b/contrib/llvm/tools/clang/lib/AST/ASTImporter.cpp @@ -2097,11 +2097,7 @@ Decl *ASTNodeImporter::VisitEnumDecl(EnumDecl *D) { D->isScoped(), D->isScopedUsingClassTag(), D->isFixed()); // Import the qualifier, if any. - if (D->getQualifier()) { - NestedNameSpecifier *NNS = Importer.Import(D->getQualifier()); - SourceRange NNSRange = Importer.Import(D->getQualifierRange()); - D2->setQualifierInfo(NNS, NNSRange); - } + D2->setQualifierInfo(Importer.Import(D->getQualifierLoc())); D2->setAccess(D->getAccess()); D2->setLexicalDeclContext(LexicalDC); Importer.Imported(D, D2); @@ -2225,12 +2221,8 @@ Decl *ASTNodeImporter::VisitRecordDecl(RecordDecl *D) { Name.getAsIdentifierInfo(), Importer.Import(D->getTagKeywordLoc())); } - // Import the qualifier, if any. - if (D->getQualifier()) { - NestedNameSpecifier *NNS = Importer.Import(D->getQualifier()); - SourceRange NNSRange = Importer.Import(D->getQualifierRange()); - D2->setQualifierInfo(NNS, NNSRange); - } + + D2->setQualifierInfo(Importer.Import(D->getQualifierLoc())); D2->setLexicalDeclContext(LexicalDC); LexicalDC->addDecl(D2); } @@ -2408,11 +2400,7 @@ Decl *ASTNodeImporter::VisitFunctionDecl(FunctionDecl *D) { } // Import the qualifier, if any. - if (D->getQualifier()) { - NestedNameSpecifier *NNS = Importer.Import(D->getQualifier()); - SourceRange NNSRange = Importer.Import(D->getQualifierRange()); - ToFunction->setQualifierInfo(NNS, NNSRange); - } + ToFunction->setQualifierInfo(Importer.Import(D->getQualifierLoc())); ToFunction->setAccess(D->getAccess()); ToFunction->setLexicalDeclContext(LexicalDC); ToFunction->setVirtualAsWritten(D->isVirtualAsWritten()); @@ -2666,12 +2654,7 @@ Decl *ASTNodeImporter::VisitVarDecl(VarDecl *D) { Name.getAsIdentifierInfo(), T, TInfo, D->getStorageClass(), D->getStorageClassAsWritten()); - // Import the qualifier, if any. - if (D->getQualifier()) { - NestedNameSpecifier *NNS = Importer.Import(D->getQualifier()); - SourceRange NNSRange = Importer.Import(D->getQualifierRange()); - ToVar->setQualifierInfo(NNS, NNSRange); - } + ToVar->setQualifierInfo(Importer.Import(D->getQualifierLoc())); ToVar->setAccess(D->getAccess()); ToVar->setLexicalDeclContext(LexicalDC); Importer.Imported(D, ToVar); @@ -3591,14 +3574,7 @@ Decl *ASTNodeImporter::VisitClassTemplateDecl(ClassTemplateDecl *D) { Name.getAsIdentifierInfo(), Importer.Import(DTemplated->getTagKeywordLoc())); D2Templated->setAccess(DTemplated->getAccess()); - - - // Import the qualifier, if any. - if (DTemplated->getQualifier()) { - NestedNameSpecifier *NNS = Importer.Import(DTemplated->getQualifier()); - SourceRange NNSRange = Importer.Import(DTemplated->getQualifierRange()); - D2Templated->setQualifierInfo(NNS, NNSRange); - } + D2Templated->setQualifierInfo(Importer.Import(DTemplated->getQualifierLoc())); D2Templated->setLexicalDeclContext(LexicalDC); // Create the class template declaration itself. @@ -3703,12 +3679,7 @@ Decl *ASTNodeImporter::VisitClassTemplateSpecializationDecl( ClassTemplate->AddSpecialization(D2, InsertPos); // Import the qualifier, if any. - if (D->getQualifier()) { - NestedNameSpecifier *NNS = Importer.Import(D->getQualifier()); - SourceRange NNSRange = Importer.Import(D->getQualifierRange()); - D2->setQualifierInfo(NNS, NNSRange); - } - + D2->setQualifierInfo(Importer.Import(D->getQualifierLoc())); // Add the specialization to this context. D2->setLexicalDeclContext(LexicalDC); @@ -4067,6 +4038,11 @@ NestedNameSpecifier *ASTImporter::Import(NestedNameSpecifier *FromNNS) { return 0; } +NestedNameSpecifierLoc ASTImporter::Import(NestedNameSpecifierLoc FromNNS) { + // FIXME: Implement! + return NestedNameSpecifierLoc(); +} + TemplateName ASTImporter::Import(TemplateName From) { switch (From.getKind()) { case TemplateName::Template: |