[PATCH] D46115: [ASTImporter] properly import SrcLoc of Attr
Rafael Stahl via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Apr 26 05:15:13 PDT 2018
r.stahl created this revision.
r.stahl added reviewers: NoQ, dcoughlin, xazax.hun, george.karpenkov.
Herald added subscribers: cfe-commits, martong, a.sidorin, rnkovacs.
The ASTImporter was failing to import the SourceLocation field of Attrs.
Repository:
rC Clang
https://reviews.llvm.org/D46115
Files:
lib/AST/ASTImporter.cpp
Index: lib/AST/ASTImporter.cpp
===================================================================
--- lib/AST/ASTImporter.cpp
+++ lib/AST/ASTImporter.cpp
@@ -7199,8 +7199,11 @@
Decl *ASTImporter::Imported(Decl *From, Decl *To) {
if (From->hasAttrs()) {
- for (auto *FromAttr : From->getAttrs())
- To->addAttr(FromAttr->clone(To->getASTContext()));
+ for (auto *FromAttr : From->getAttrs()) {
+ Attr *ToAttr = FromAttr->clone(To->getASTContext());
+ ToAttr->setRange(Import(FromAttr->getRange()));
+ To->addAttr(ToAttr);
+ }
}
if (From->isUsed()) {
To->setIsUsed();
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D46115.144099.patch
Type: text/x-patch
Size: 612 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180426/378530d5/attachment.bin>
More information about the cfe-commits
mailing list