diff options
author | Sean Hunt <rideau3@gmail.com> | 2010-06-16 23:43:53 +0000 |
---|---|---|
committer | Sean Hunt <rideau3@gmail.com> | 2010-06-16 23:43:53 +0000 |
commit | 387475d0c18aaeb022108de9d33b6c9fb7998843 (patch) | |
tree | 59fb00f350313e5229bfa01e465c3c2da30a631b /lib/Frontend/PCHReaderDecl.cpp | |
parent | f13ca06e57ac094ed05ea08c26a499af1ba0ce88 (diff) |
Implement first TD-based usage of attributes.
Currently, there are two effective changes:
- Attr::Kind has been changed to attr::Kind, in a separate namespace
rather than the Attr class. This is because the enumerator needs to
be visible to parse.
- The class definitions for the C++0x attributes other than aligned are
generated by TableGen.
The specific classes generated by TableGen are controlled by an array in
TableGen (see the accompanying commit to the LLVM repository). I will be
expanding the amount of code generated as I develop the new attributes system
while initially keeping it confined to these attributes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106172 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/PCHReaderDecl.cpp')
-rw-r--r-- | lib/Frontend/PCHReaderDecl.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/lib/Frontend/PCHReaderDecl.cpp b/lib/Frontend/PCHReaderDecl.cpp index cece1b659c..78ae5f01b7 100644 --- a/lib/Frontend/PCHReaderDecl.cpp +++ b/lib/Frontend/PCHReaderDecl.cpp @@ -679,24 +679,24 @@ Attr *PCHReader::ReadAttributes() { (void)RecCode; #define SIMPLE_ATTR(Name) \ - case Attr::Name: \ + case attr::Name: \ New = ::new (*Context) Name##Attr(); \ break #define STRING_ATTR(Name) \ - case Attr::Name: \ + case attr::Name: \ New = ::new (*Context) Name##Attr(*Context, ReadString(Record, Idx)); \ break #define UNSIGNED_ATTR(Name) \ - case Attr::Name: \ + case attr::Name: \ New = ::new (*Context) Name##Attr(Record[Idx++]); \ break Attr *Attrs = 0; while (Idx < Record.size()) { Attr *New = 0; - Attr::Kind Kind = (Attr::Kind)Record[Idx++]; + attr::Kind Kind = (attr::Kind)Record[Idx++]; bool IsInherited = Record[Idx++]; switch (Kind) { @@ -712,14 +712,14 @@ Attr *PCHReader::ReadAttributes() { STRING_ATTR(AsmLabel); SIMPLE_ATTR(BaseCheck); - case Attr::Blocks: + case attr::Blocks: New = ::new (*Context) BlocksAttr( (BlocksAttr::BlocksAttrTypes)Record[Idx++]); break; SIMPLE_ATTR(CDecl); - case Attr::Cleanup: + case attr::Cleanup: New = ::new (*Context) CleanupAttr( cast<FunctionDecl>(GetDecl(Record[Idx++]))); break; @@ -733,7 +733,7 @@ Attr *PCHReader::ReadAttributes() { SIMPLE_ATTR(FastCall); SIMPLE_ATTR(Final); - case Attr::Format: { + case attr::Format: { std::string Type = ReadString(Record, Idx); unsigned FormatIdx = Record[Idx++]; unsigned FirstArg = Record[Idx++]; @@ -741,13 +741,13 @@ Attr *PCHReader::ReadAttributes() { break; } - case Attr::FormatArg: { + case attr::FormatArg: { unsigned FormatIdx = Record[Idx++]; New = ::new (*Context) FormatArgAttr(FormatIdx); break; } - case Attr::Sentinel: { + case attr::Sentinel: { int sentinel = Record[Idx++]; int nullPos = Record[Idx++]; New = ::new (*Context) SentinelAttr(sentinel, nullPos); @@ -757,15 +757,15 @@ Attr *PCHReader::ReadAttributes() { SIMPLE_ATTR(GNUInline); SIMPLE_ATTR(Hiding); - case Attr::IBActionKind: + case attr::IBAction: New = ::new (*Context) IBActionAttr(); break; - case Attr::IBOutletKind: + case attr::IBOutlet: New = ::new (*Context) IBOutletAttr(); break; - case Attr::IBOutletCollectionKind: { + case attr::IBOutletCollection: { ObjCInterfaceDecl *D = cast_or_null<ObjCInterfaceDecl>(GetDecl(Record[Idx++])); New = ::new (*Context) IBOutletCollectionAttr(D); @@ -778,7 +778,7 @@ Attr *PCHReader::ReadAttributes() { SIMPLE_ATTR(NoReturn); SIMPLE_ATTR(NoThrow); - case Attr::NonNull: { + case attr::NonNull: { unsigned Size = Record[Idx++]; llvm::SmallVector<unsigned, 16> ArgNums; ArgNums.insert(ArgNums.end(), &Record[Idx], &Record[Idx] + Size); @@ -787,7 +787,7 @@ Attr *PCHReader::ReadAttributes() { break; } - case Attr::ReqdWorkGroupSize: { + case attr::ReqdWorkGroupSize: { unsigned X = Record[Idx++]; unsigned Y = Record[Idx++]; unsigned Z = Record[Idx++]; @@ -815,7 +815,7 @@ Attr *PCHReader::ReadAttributes() { SIMPLE_ATTR(Unused); SIMPLE_ATTR(Used); - case Attr::Visibility: + case attr::Visibility: New = ::new (*Context) VisibilityAttr( (VisibilityAttr::VisibilityTypes)Record[Idx++]); break; |