diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2008-05-27 03:33:27 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2008-05-27 03:33:27 +0000 |
commit | 3e113409cb69ad9bc10224c333e47dc8395caef9 (patch) | |
tree | 0e50bae64a6b513c6eae5f814f7a2d3bae56cc26 /clang/lib/Sema/SemaDecl.cpp | |
parent | 42ed07e10e19c979824045d55eac6340155eb16d (diff) | |
download | bcm5719-llvm-3e113409cb69ad9bc10224c333e47dc8395caef9.tar.gz bcm5719-llvm-3e113409cb69ad9bc10224c333e47dc8395caef9.zip |
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.
llvm-svn: 51577
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 38dbb9b09ac..8b89045a717 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/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; |