aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2008-05-27 03:33:27 +0000
committerEli Friedman <eli.friedman@gmail.com>2008-05-27 03:33:27 +0000
commit3c0eb160ca1361a82b9f15b3b40a2425adc14d0f (patch)
tree1ba325230d8ddcb4586cdcef43ea08c3e417f875 /lib/Sema/SemaDecl.cpp
parentcbadaf6ced6d664015ee409f62ab1bc20ae0bf73 (diff)
Implementation of gcc mode attribute; this is significant because
it fixes PR2204. Not too much to say about the implementation; it works in a similar way to the vector size attribute. At some point, we need to modify the targets to provide information about the appropriate types. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51577 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 38dbb9b09a..8b89045a71 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -2384,6 +2384,17 @@ void Sema::HandleDeclAttribute(Decl *New, AttributeList *Attr) {
vDecl->setType(newType);
}
break;
+ case AttributeList::AT_mode:
+ if (TypedefDecl *tDecl = dyn_cast<TypedefDecl>(New)) {
+ QualType newType = HandleModeTypeAttribute(tDecl->getUnderlyingType(),
+ Attr);
+ tDecl->setUnderlyingType(newType);
+ } else if (ValueDecl *vDecl = dyn_cast<ValueDecl>(New)) {
+ QualType newType = HandleModeTypeAttribute(vDecl->getType(), Attr);
+ vDecl->setType(newType);
+ }
+ // FIXME: Diagnostic?
+ break;
case AttributeList::AT_deprecated:
HandleDeprecatedAttribute(New, Attr);
break;