Record the full source range of an attribute.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139599 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp
index 2f2e280..fc85832 100644
--- a/lib/Sema/SemaDeclAttr.cpp
+++ b/lib/Sema/SemaDeclAttr.cpp
@@ -1998,7 +1998,7 @@
if (NoThrowAttr *Existing = D->getAttr<NoThrowAttr>()) {
if (Existing->getLocation().isInvalid())
- Existing->setLocation(Attr.getLoc());
+ Existing->setRange(Attr.getRange());
} else {
D->addAttr(::new (S.Context) NoThrowAttr(Attr.getLoc(), S.Context));
}
@@ -2013,7 +2013,7 @@
if (ConstAttr *Existing = D->getAttr<ConstAttr>()) {
if (Existing->getLocation().isInvalid())
- Existing->setLocation(Attr.getLoc());
+ Existing->setRange(Attr.getRange());
} else {
D->addAttr(::new (S.Context) ConstAttr(Attr.getLoc(), S.Context));
}
@@ -2393,7 +2393,7 @@
// If we don't have a valid location for this attribute, adopt the
// location.
if (f->getLocation().isInvalid())
- f->setLocation(Attr.getLoc());
+ f->setRange(Attr.getRange());
return;
}
}