summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/AttributeList.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-02-14 07:37:35 +0000
committerChris Lattner <sabre@nondot.org>2009-02-14 07:37:35 +0000
commit237f27573f78b0701f206c2ac1a67e15ecbfa20e (patch)
tree1b21f85c6c7d5b1327a5035149d60c0d980883d1 /clang/lib/Parse/AttributeList.cpp
parent3a23073918af9ca6dd9cef5549191455ba60603b (diff)
downloadbcm5719-llvm-237f27573f78b0701f206c2ac1a67e15ecbfa20e.tar.gz
bcm5719-llvm-237f27573f78b0701f206c2ac1a67e15ecbfa20e.zip
Several related changes:
1) implement parser and sema support for reading and verifying attribute(warnunusedresult). 2) rename hasLocalSideEffect to isUnusedResultAWarning, inverting the sense of its result. 3) extend isUnusedResultAWarning to directly return the loc and range info that should be reported to the user. Make it substantially more precise in some cases than what was previously reported. 4) teach isUnusedResultAWarning about CallExpr to decls that are pure/const/warnunusedresult, fixing a fixme. 5) change warn_attribute_wrong_decl_type to not pass in english strings, instead, pass in integers and use %select. llvm-svn: 64543
Diffstat (limited to 'clang/lib/Parse/AttributeList.cpp')
-rw-r--r--clang/lib/Parse/AttributeList.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Parse/AttributeList.cpp b/clang/lib/Parse/AttributeList.cpp
index 5b70a5908db..6ce55ea5c59 100644
--- a/clang/lib/Parse/AttributeList.cpp
+++ b/clang/lib/Parse/AttributeList.cpp
@@ -113,6 +113,9 @@ AttributeList::Kind AttributeList::getKind(const IdentifierInfo *Name) {
case 15:
if (!memcmp(Str, "ext_vector_type", 15)) return AT_ext_vector_type;
break;
+ case 16:
+ if (!memcmp(Str, "warnunusedresult", 16)) return AT_warn_unused_result;
+ break;
case 17:
if (!memcmp(Str, "transparent_union", 17)) return AT_transparent_union;
break;
OpenPOWER on IntegriCloud