<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Dec 9, 2014 at 4:00 PM, Sean Callanan <span dir="ltr"><<a href="mailto:scallanan@apple.com" target="_blank">scallanan@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: spyffe<br>
Date: Tue Dec 9 18:00:37 2014<br>
New Revision: 223860<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=223860&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=223860&view=rev</a><br>
Log:<br>
Updated the AST importer to support importing<br>
LinkageSpecDecls. This is relevant when LLDB<br>
wants to import Decls from non-C++ modules,<br>
since many declarations are in extern "C"<br>
blocks.<br>
<br>
Modified:<br>
cfe/trunk/lib/AST/ASTImporter.cpp<br>
<br>
Modified: cfe/trunk/lib/AST/ASTImporter.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTImporter.cpp?rev=223860&r1=223859&r2=223860&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTImporter.cpp?rev=223860&r1=223859&r2=223860&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/AST/ASTImporter.cpp (original)<br>
+++ cfe/trunk/lib/AST/ASTImporter.cpp Tue Dec 9 18:00:37 2014<br>
@@ -151,6 +151,7 @@ namespace clang {<br>
Decl *VisitObjCMethodDecl(ObjCMethodDecl *D);<br>
Decl *VisitObjCCategoryDecl(ObjCCategoryDecl *D);<br>
Decl *VisitObjCProtocolDecl(ObjCProtocolDecl *D);<br>
+ Decl *VisitLinkageSpecDecl(LinkageSpecDecl *D);<br>
Decl *VisitObjCInterfaceDecl(ObjCInterfaceDecl *D);<br>
Decl *VisitObjCCategoryImplDecl(ObjCCategoryImplDecl *D);<br>
Decl *VisitObjCImplementationDecl(ObjCImplementationDecl *D);<br>
@@ -3470,6 +3471,35 @@ Decl *ASTNodeImporter::VisitObjCProtocol<br>
return ToProto;<br>
}<br>
<br>
+Decl *ASTNodeImporter::VisitLinkageSpecDecl(LinkageSpecDecl *D) {<br>
+ DeclContext *DC = Importer.ImportContext(D->getDeclContext());<br>
+ DeclContext *LexicalDC = Importer.ImportContext(D->getLexicalDeclContext());<br>
+<br>
+ SourceLocation ExternLoc = Importer.Import(D->getExternLoc());<br>
+ SourceLocation LangLoc = Importer.Import(D->getLocation());<br>
+<br>
+ bool HasBraces = D->hasBraces();<br>
+<br>
+ LinkageSpecDecl *ToLinkageSpec = LinkageSpecDecl::Create(Importer.getToContext(),<br></blockquote><div><br></div><div>clang follows llvm style: Please use <= 80 columns per line. You can use clang-format-diff.py (or `git format`) to let clang-format fix things like this automatically for you before you commit.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+ DC,<br>
+ ExternLoc,<br>
+ LangLoc,<br>
+ D->getLanguage(),<br>
+ HasBraces);<br>
+<br>
+ if (HasBraces) {<br>
+ SourceLocation RBraceLoc = Importer.Import(D->getRBraceLoc());<br>
+ ToLinkageSpec->setRBraceLoc(RBraceLoc);<br>
+ }<br>
+<br>
+ ToLinkageSpec->setLexicalDeclContext(LexicalDC);<br>
+ LexicalDC->addDeclInternal(ToLinkageSpec);<br>
+<br>
+ Importer.Imported(D, ToLinkageSpec);<br>
+<br>
+ return ToLinkageSpec;<br>
+}<br>
+<br>
bool ASTNodeImporter::ImportDefinition(ObjCInterfaceDecl *From,<br>
ObjCInterfaceDecl *To,<br>
ImportDefinitionKind Kind) {<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div></div>