Support __attribute__(({con,de}structor)) in Parse & Sema
- Including possible priority argument
- In other news, the attribute parsing code really needs a cleanup
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54257 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Parse/AttributeList.cpp b/lib/Parse/AttributeList.cpp
index 0eaba66..b120f7e 100644
--- a/lib/Parse/AttributeList.cpp
+++ b/lib/Parse/AttributeList.cpp
@@ -50,6 +50,7 @@
Len -= 4;
}
+ // FIXME: Hand generating this is neither smart nor efficient.
switch (Len) {
case 4:
if (!memcmp(Str, "weak", 4)) return AT_weak;
@@ -85,9 +86,11 @@
case 10:
if (!memcmp(Str, "deprecated", 10)) return AT_deprecated;
if (!memcmp(Str, "visibility", 10)) return AT_visibility;
+ if (!memcmp(Str, "destructor", 10)) return AT_destructor;
break;
case 11:
if (!memcmp(Str, "vector_size", 11)) return AT_vector_size;
+ if (!memcmp(Str, "constructor", 11)) return AT_constructor;
break;
case 13:
if (!memcmp(Str, "address_space", 13)) return AT_address_space;