2008-02-14 10:14:34 +03:00
|
|
|
//===--- Attr.h - Classes for representing expressions ----------*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file defines the Attr interface and subclasses.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2008-02-14 10:43:43 +03:00
|
|
|
#ifndef LLVM_CLANG_AST_ATTR_H
|
|
|
|
#define LLVM_CLANG_AST_ATTR_H
|
2008-02-14 10:14:34 +03:00
|
|
|
|
2008-02-16 03:24:09 +03:00
|
|
|
#include <cassert>
|
2008-07-23 01:56:45 +04:00
|
|
|
#include <cstring>
|
2008-02-21 22:30:49 +03:00
|
|
|
#include <string>
|
2008-07-22 01:53:04 +04:00
|
|
|
#include <algorithm>
|
2008-02-16 02:57:38 +03:00
|
|
|
|
2008-02-14 10:14:34 +03:00
|
|
|
namespace clang {
|
|
|
|
|
|
|
|
/// Attr - This represents one attribute.
|
|
|
|
class Attr {
|
|
|
|
public:
|
|
|
|
enum Kind {
|
2008-06-08 19:45:52 +04:00
|
|
|
Alias,
|
2008-02-14 10:14:34 +03:00
|
|
|
Aligned,
|
2008-10-28 03:17:57 +03:00
|
|
|
AlwaysInline,
|
2008-02-27 23:43:06 +03:00
|
|
|
Annotate,
|
2008-08-05 05:35:17 +04:00
|
|
|
AsmLabel, // Represent GCC asm label extension.
|
2008-08-01 02:40:48 +04:00
|
|
|
Constructor,
|
2008-03-03 06:28:21 +03:00
|
|
|
Deprecated,
|
2008-08-01 02:40:48 +04:00
|
|
|
Destructor,
|
2008-03-03 06:28:21 +03:00
|
|
|
DLLImport,
|
|
|
|
DLLExport,
|
2008-07-25 08:39:19 +04:00
|
|
|
FastCall,
|
2008-03-03 06:28:21 +03:00
|
|
|
Format,
|
2008-07-25 08:39:19 +04:00
|
|
|
IBOutletKind, // Clang-specific. Use "Kind" suffix to not conflict with
|
|
|
|
NonNull,
|
|
|
|
NoReturn,
|
|
|
|
NoThrow,
|
2008-08-24 03:22:21 +04:00
|
|
|
ObjCGC,
|
2009-01-14 02:34:40 +03:00
|
|
|
ObjCNSObject,
|
2008-07-25 08:39:19 +04:00
|
|
|
Packed,
|
2008-04-25 13:32:00 +04:00
|
|
|
StdCall,
|
2008-07-16 02:26:48 +04:00
|
|
|
TransparentUnion,
|
2008-12-17 04:07:27 +03:00
|
|
|
Unavailable,
|
2008-07-25 08:39:19 +04:00
|
|
|
Unused,
|
|
|
|
Visibility,
|
2008-09-18 20:44:58 +04:00
|
|
|
Weak,
|
2008-10-06 03:32:53 +04:00
|
|
|
Blocks,
|
|
|
|
Const,
|
2009-01-31 04:16:18 +03:00
|
|
|
Pure,
|
|
|
|
Cleanup
|
2008-02-14 10:14:34 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
private:
|
2008-02-14 10:43:43 +03:00
|
|
|
Attr *Next;
|
2008-02-14 10:14:34 +03:00
|
|
|
Kind AttrKind;
|
2008-12-26 03:52:02 +03:00
|
|
|
bool Inherited : 1;
|
|
|
|
|
2008-02-14 10:14:34 +03:00
|
|
|
protected:
|
2008-12-26 03:52:02 +03:00
|
|
|
Attr(Kind AK) : Next(0), AttrKind(AK), Inherited(false) {}
|
2008-02-16 02:30:50 +03:00
|
|
|
public:
|
2008-02-14 10:14:34 +03:00
|
|
|
virtual ~Attr() {
|
2008-02-14 10:43:43 +03:00
|
|
|
delete Next;
|
2008-02-14 10:14:34 +03:00
|
|
|
}
|
2008-02-16 02:30:50 +03:00
|
|
|
|
2008-02-14 10:14:34 +03:00
|
|
|
Kind getKind() const { return AttrKind; }
|
2008-12-26 03:52:02 +03:00
|
|
|
|
2008-02-14 10:43:43 +03:00
|
|
|
Attr *getNext() { return Next; }
|
|
|
|
const Attr *getNext() const { return Next; }
|
|
|
|
void setNext(Attr *next) { Next = next; }
|
2008-12-26 03:52:02 +03:00
|
|
|
|
|
|
|
bool isInherited() const { return Inherited; }
|
|
|
|
void setInherited(bool value) { Inherited = value; }
|
|
|
|
|
2008-02-14 10:14:34 +03:00
|
|
|
void addAttr(Attr *attr) {
|
|
|
|
assert((attr != 0) && "addAttr(): attr is null");
|
2008-02-14 10:43:43 +03:00
|
|
|
|
|
|
|
// FIXME: This doesn't preserve the order in any way.
|
|
|
|
attr->Next = Next;
|
|
|
|
Next = attr;
|
2008-02-14 10:14:34 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
// Implement isa/cast/dyncast/etc.
|
|
|
|
static bool classof(const Attr *) { return true; }
|
|
|
|
};
|
|
|
|
|
|
|
|
class PackedAttr : public Attr {
|
2008-10-16 06:34:03 +04:00
|
|
|
unsigned Alignment;
|
|
|
|
|
2008-02-14 10:14:34 +03:00
|
|
|
public:
|
2008-10-16 06:34:03 +04:00
|
|
|
PackedAttr(unsigned alignment) : Attr(Packed), Alignment(alignment) {}
|
|
|
|
|
|
|
|
/// getAlignment - The specified alignment in bits.
|
|
|
|
unsigned getAlignment() const { return Alignment; }
|
|
|
|
|
2008-02-14 10:14:34 +03:00
|
|
|
// Implement isa/cast/dyncast/etc.
|
|
|
|
static bool classof(const Attr *A) {
|
|
|
|
return A->getKind() == Packed;
|
|
|
|
}
|
|
|
|
static bool classof(const PackedAttr *A) { return true; }
|
|
|
|
};
|
2008-02-16 22:51:27 +03:00
|
|
|
|
|
|
|
class AlignedAttr : public Attr {
|
|
|
|
unsigned Alignment;
|
|
|
|
public:
|
|
|
|
AlignedAttr(unsigned alignment) : Attr(Aligned), Alignment(alignment) {}
|
2008-10-16 06:34:03 +04:00
|
|
|
|
|
|
|
/// getAlignment - The specified alignment in bits.
|
2008-02-16 22:51:27 +03:00
|
|
|
unsigned getAlignment() const { return Alignment; }
|
|
|
|
|
|
|
|
// Implement isa/cast/dyncast/etc.
|
|
|
|
static bool classof(const Attr *A) {
|
|
|
|
return A->getKind() == Aligned;
|
|
|
|
}
|
|
|
|
static bool classof(const AlignedAttr *A) { return true; }
|
|
|
|
};
|
2008-02-14 10:43:43 +03:00
|
|
|
|
2008-02-21 22:30:49 +03:00
|
|
|
class AnnotateAttr : public Attr {
|
|
|
|
std::string Annotation;
|
|
|
|
public:
|
|
|
|
AnnotateAttr(const std::string &ann) : Attr(Annotate), Annotation(ann) {}
|
|
|
|
|
|
|
|
const std::string& getAnnotation() const { return Annotation; }
|
|
|
|
|
|
|
|
// Implement isa/cast/dyncast/etc.
|
|
|
|
static bool classof(const Attr *A) {
|
|
|
|
return A->getKind() == Annotate;
|
|
|
|
}
|
|
|
|
static bool classof(const AnnotateAttr *A) { return true; }
|
|
|
|
};
|
2008-06-08 19:45:52 +04:00
|
|
|
|
2008-08-05 05:35:17 +04:00
|
|
|
class AsmLabelAttr : public Attr {
|
|
|
|
std::string Label;
|
|
|
|
public:
|
|
|
|
AsmLabelAttr(const std::string &L) : Attr(AsmLabel), Label(L) {}
|
|
|
|
|
|
|
|
const std::string& getLabel() const { return Label; }
|
|
|
|
|
|
|
|
// Implement isa/cast/dyncast/etc.
|
|
|
|
static bool classof(const Attr *A) {
|
|
|
|
return A->getKind() == AsmLabel;
|
|
|
|
}
|
|
|
|
static bool classof(const AsmLabelAttr *A) { return true; }
|
|
|
|
};
|
|
|
|
|
2008-10-28 03:17:57 +03:00
|
|
|
class AlwaysInlineAttr : public Attr {
|
|
|
|
public:
|
|
|
|
AlwaysInlineAttr() : Attr(AlwaysInline) {}
|
|
|
|
|
|
|
|
// Implement isa/cast/dyncast/etc.
|
|
|
|
|
|
|
|
static bool classof(const Attr *A) { return A->getKind() == AlwaysInline; }
|
|
|
|
static bool classof(const AlwaysInlineAttr *A) { return true; }
|
|
|
|
};
|
|
|
|
|
2008-06-08 19:45:52 +04:00
|
|
|
class AliasAttr : public Attr {
|
|
|
|
std::string Aliasee;
|
|
|
|
public:
|
|
|
|
AliasAttr(const std::string &aliasee) : Attr(Alias), Aliasee(aliasee) {}
|
|
|
|
|
|
|
|
const std::string& getAliasee() const { return Aliasee; }
|
|
|
|
|
|
|
|
// Implement isa/cast/dyncast/etc.
|
|
|
|
|
|
|
|
static bool classof(const Attr *A) { return A->getKind() == Alias; }
|
|
|
|
static bool classof(const AliasAttr *A) { return true; }
|
|
|
|
};
|
2008-08-01 02:40:48 +04:00
|
|
|
|
|
|
|
class ConstructorAttr : public Attr {
|
|
|
|
int priority;
|
|
|
|
public:
|
|
|
|
ConstructorAttr(int p) : Attr(Constructor), priority(p) {}
|
2008-08-01 04:01:51 +04:00
|
|
|
|
|
|
|
int getPriority() const { return priority; }
|
2008-08-01 02:40:48 +04:00
|
|
|
|
|
|
|
// Implement isa/cast/dyncast/etc.
|
|
|
|
static bool classof(const Attr *A) { return A->getKind() == Constructor; }
|
|
|
|
static bool classof(const ConstructorAttr *A) { return true; }
|
|
|
|
};
|
2008-07-16 02:26:48 +04:00
|
|
|
|
2008-08-01 02:40:48 +04:00
|
|
|
class DestructorAttr : public Attr {
|
|
|
|
int priority;
|
|
|
|
public:
|
|
|
|
DestructorAttr(int p) : Attr(Destructor), priority(p) {}
|
2008-08-01 04:01:51 +04:00
|
|
|
|
|
|
|
int getPriority() const { return priority; }
|
2008-08-01 02:40:48 +04:00
|
|
|
|
|
|
|
// Implement isa/cast/dyncast/etc.
|
|
|
|
static bool classof(const Attr *A) { return A->getKind() == Destructor; }
|
|
|
|
static bool classof(const DestructorAttr *A) { return true; }
|
|
|
|
};
|
|
|
|
|
2008-07-16 02:26:48 +04:00
|
|
|
class IBOutletAttr : public Attr {
|
|
|
|
public:
|
|
|
|
IBOutletAttr() : Attr(IBOutletKind) {}
|
|
|
|
|
|
|
|
// Implement isa/cast/dyncast/etc.
|
|
|
|
static bool classof(const Attr *A) {
|
|
|
|
return A->getKind() == IBOutletKind;
|
|
|
|
}
|
|
|
|
static bool classof(const IBOutletAttr *A) { return true; }
|
|
|
|
};
|
2008-06-08 19:45:52 +04:00
|
|
|
|
2008-02-27 23:43:06 +03:00
|
|
|
class NoReturnAttr : public Attr {
|
|
|
|
public:
|
|
|
|
NoReturnAttr() : Attr(NoReturn) {}
|
|
|
|
|
|
|
|
// Implement isa/cast/dyncast/etc.
|
|
|
|
|
|
|
|
static bool classof(const Attr *A) { return A->getKind() == NoReturn; }
|
|
|
|
static bool classof(const NoReturnAttr *A) { return true; }
|
|
|
|
};
|
2008-02-21 22:30:49 +03:00
|
|
|
|
2008-02-29 19:48:43 +03:00
|
|
|
class DeprecatedAttr : public Attr {
|
|
|
|
public:
|
|
|
|
DeprecatedAttr() : Attr(Deprecated) {}
|
|
|
|
|
|
|
|
// Implement isa/cast/dyncast/etc.
|
|
|
|
|
|
|
|
static bool classof(const Attr *A) { return A->getKind() == Deprecated; }
|
|
|
|
static bool classof(const DeprecatedAttr *A) { return true; }
|
|
|
|
};
|
|
|
|
|
2008-12-17 04:07:27 +03:00
|
|
|
class UnavailableAttr : public Attr {
|
|
|
|
public:
|
|
|
|
UnavailableAttr() : Attr(Unavailable) {}
|
|
|
|
|
|
|
|
// Implement isa/cast/dyncast/etc.
|
|
|
|
|
|
|
|
static bool classof(const Attr *A) { return A->getKind() == Unavailable; }
|
|
|
|
static bool classof(const UnavailableAttr *A) { return true; }
|
|
|
|
};
|
|
|
|
|
2008-07-25 08:39:19 +04:00
|
|
|
class UnusedAttr : public Attr {
|
|
|
|
public:
|
|
|
|
UnusedAttr() : Attr(Unused) {}
|
|
|
|
|
|
|
|
// Implement isa/cast/dyncast/etc.
|
|
|
|
static bool classof(const Attr *A) { return A->getKind() == Unused; }
|
|
|
|
static bool classof(const UnusedAttr *A) { return true; }
|
|
|
|
};
|
|
|
|
|
2008-03-03 06:28:21 +03:00
|
|
|
class WeakAttr : public Attr {
|
|
|
|
public:
|
|
|
|
WeakAttr() : Attr(Weak) {}
|
|
|
|
|
|
|
|
// Implement isa/cast/dyncast/etc.
|
|
|
|
|
|
|
|
static bool classof(const Attr *A) { return A->getKind() == Weak; }
|
|
|
|
static bool classof(const WeakAttr *A) { return true; }
|
|
|
|
};
|
|
|
|
|
|
|
|
class NoThrowAttr : public Attr {
|
|
|
|
public:
|
|
|
|
NoThrowAttr() : Attr(NoThrow) {}
|
|
|
|
|
|
|
|
// Implement isa/cast/dyncast/etc.
|
|
|
|
|
|
|
|
static bool classof(const Attr *A) { return A->getKind() == NoThrow; }
|
|
|
|
static bool classof(const NoThrowAttr *A) { return true; }
|
|
|
|
};
|
2008-10-06 03:32:53 +04:00
|
|
|
|
|
|
|
class ConstAttr : public Attr {
|
|
|
|
public:
|
|
|
|
ConstAttr() : Attr(Const) {}
|
|
|
|
|
|
|
|
// Implement isa/cast/dyncast/etc.
|
|
|
|
|
|
|
|
static bool classof(const Attr *A) { return A->getKind() == Const; }
|
|
|
|
static bool classof(const ConstAttr *A) { return true; }
|
|
|
|
};
|
|
|
|
|
|
|
|
class PureAttr : public Attr {
|
|
|
|
public:
|
|
|
|
PureAttr() : Attr(Pure) {}
|
|
|
|
|
|
|
|
// Implement isa/cast/dyncast/etc.
|
|
|
|
|
|
|
|
static bool classof(const Attr *A) { return A->getKind() == Pure; }
|
|
|
|
static bool classof(const PureAttr *A) { return true; }
|
|
|
|
};
|
|
|
|
|
2008-07-22 01:53:04 +04:00
|
|
|
class NonNullAttr : public Attr {
|
|
|
|
unsigned* ArgNums;
|
|
|
|
unsigned Size;
|
|
|
|
public:
|
2008-08-06 01:29:52 +04:00
|
|
|
NonNullAttr(unsigned* arg_nums = 0, unsigned size = 0) : Attr(NonNull),
|
|
|
|
ArgNums(0), Size(0) {
|
|
|
|
|
2008-07-22 01:53:04 +04:00
|
|
|
if (size) {
|
|
|
|
assert (arg_nums);
|
|
|
|
ArgNums = new unsigned[size];
|
|
|
|
Size = size;
|
|
|
|
memcpy(ArgNums, arg_nums, sizeof(*ArgNums)*size);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~NonNullAttr() {
|
|
|
|
delete [] ArgNums;
|
|
|
|
}
|
|
|
|
|
2008-07-22 04:46:16 +04:00
|
|
|
bool isNonNull(unsigned arg) const {
|
2008-07-22 01:53:04 +04:00
|
|
|
return ArgNums ? std::binary_search(ArgNums, ArgNums+Size, arg) : true;
|
|
|
|
}
|
2008-08-06 01:29:52 +04:00
|
|
|
|
|
|
|
static bool classof(const Attr *A) { return A->getKind() == NonNull; }
|
|
|
|
static bool classof(const NonNullAttr *A) { return true; }
|
2008-07-22 01:53:04 +04:00
|
|
|
};
|
2008-03-03 06:28:21 +03:00
|
|
|
|
|
|
|
class FormatAttr : public Attr {
|
|
|
|
std::string Type;
|
|
|
|
int formatIdx, firstArg;
|
|
|
|
public:
|
|
|
|
FormatAttr(const std::string &type, int idx, int first) : Attr(Format),
|
|
|
|
Type(type), formatIdx(idx), firstArg(first) {}
|
|
|
|
|
|
|
|
const std::string& getType() const { return Type; }
|
|
|
|
int getFormatIdx() const { return formatIdx; }
|
|
|
|
int getFirstArg() const { return firstArg; }
|
|
|
|
|
|
|
|
// Implement isa/cast/dyncast/etc.
|
|
|
|
|
|
|
|
static bool classof(const Attr *A) { return A->getKind() == Format; }
|
|
|
|
static bool classof(const FormatAttr *A) { return true; }
|
|
|
|
};
|
|
|
|
|
|
|
|
class VisibilityAttr : public Attr {
|
|
|
|
public:
|
2008-05-22 04:50:06 +04:00
|
|
|
/// @brief An enumeration for the kinds of visibility of symbols.
|
|
|
|
enum VisibilityTypes {
|
|
|
|
DefaultVisibility = 0,
|
|
|
|
HiddenVisibility,
|
|
|
|
ProtectedVisibility
|
|
|
|
};
|
|
|
|
private:
|
|
|
|
VisibilityTypes VisibilityType;
|
|
|
|
public:
|
|
|
|
VisibilityAttr(VisibilityTypes v) : Attr(Visibility),
|
2008-03-03 06:28:21 +03:00
|
|
|
VisibilityType(v) {}
|
|
|
|
|
2008-05-22 04:50:06 +04:00
|
|
|
VisibilityTypes getVisibility() const { return VisibilityType; }
|
2008-03-03 06:28:21 +03:00
|
|
|
|
|
|
|
// Implement isa/cast/dyncast/etc.
|
|
|
|
|
|
|
|
static bool classof(const Attr *A) { return A->getKind() == Visibility; }
|
|
|
|
static bool classof(const VisibilityAttr *A) { return true; }
|
|
|
|
};
|
|
|
|
|
|
|
|
class DLLImportAttr : public Attr {
|
|
|
|
public:
|
|
|
|
DLLImportAttr() : Attr(DLLImport) {}
|
|
|
|
|
|
|
|
// Implement isa/cast/dyncast/etc.
|
|
|
|
|
|
|
|
static bool classof(const Attr *A) { return A->getKind() == DLLImport; }
|
|
|
|
static bool classof(const DLLImportAttr *A) { return true; }
|
|
|
|
};
|
|
|
|
|
|
|
|
class DLLExportAttr : public Attr {
|
|
|
|
public:
|
|
|
|
DLLExportAttr() : Attr(DLLExport) {}
|
|
|
|
|
|
|
|
// Implement isa/cast/dyncast/etc.
|
|
|
|
|
|
|
|
static bool classof(const Attr *A) { return A->getKind() == DLLExport; }
|
|
|
|
static bool classof(const DLLExportAttr *A) { return true; }
|
|
|
|
};
|
|
|
|
|
2008-03-07 23:04:22 +03:00
|
|
|
class FastCallAttr : public Attr {
|
|
|
|
public:
|
|
|
|
FastCallAttr() : Attr(FastCall) {}
|
|
|
|
|
|
|
|
// Implement isa/cast/dyncast/etc.
|
|
|
|
|
|
|
|
static bool classof(const Attr *A) { return A->getKind() == FastCall; }
|
|
|
|
static bool classof(const FastCallAttr *A) { return true; }
|
|
|
|
};
|
|
|
|
|
|
|
|
class StdCallAttr : public Attr {
|
|
|
|
public:
|
|
|
|
StdCallAttr() : Attr(StdCall) {}
|
|
|
|
|
|
|
|
// Implement isa/cast/dyncast/etc.
|
|
|
|
|
|
|
|
static bool classof(const Attr *A) { return A->getKind() == StdCall; }
|
|
|
|
static bool classof(const StdCallAttr *A) { return true; }
|
|
|
|
};
|
|
|
|
|
2008-04-25 13:32:00 +04:00
|
|
|
class TransparentUnionAttr : public Attr {
|
|
|
|
public:
|
|
|
|
TransparentUnionAttr() : Attr(TransparentUnion) {}
|
|
|
|
|
|
|
|
// Implement isa/cast/dyncast/etc.
|
|
|
|
|
|
|
|
static bool classof(const Attr *A) { return A->getKind() == TransparentUnion; }
|
|
|
|
static bool classof(const TransparentUnionAttr *A) { return true; }
|
|
|
|
};
|
|
|
|
|
2008-08-24 03:22:21 +04:00
|
|
|
class ObjCGCAttr : public Attr {
|
|
|
|
public:
|
|
|
|
enum GCAttrTypes {
|
|
|
|
Weak = 0,
|
|
|
|
Strong
|
|
|
|
};
|
|
|
|
private:
|
|
|
|
GCAttrTypes GCAttrType;
|
|
|
|
public:
|
|
|
|
ObjCGCAttr(GCAttrTypes t) : Attr(ObjCGC), GCAttrType(t) {}
|
|
|
|
|
|
|
|
GCAttrTypes getType() const { return GCAttrType; }
|
|
|
|
|
|
|
|
// Implement isa/cast/dyncast/etc.
|
|
|
|
|
|
|
|
static bool classof(const Attr *A) { return A->getKind() == ObjCGC; }
|
|
|
|
static bool classof(const ObjCGCAttr *A) { return true; }
|
|
|
|
};
|
|
|
|
|
2009-01-14 02:34:40 +03:00
|
|
|
class ObjCNSObjectAttr : public Attr {
|
|
|
|
// Implement isa/cast/dyncast/etc.
|
|
|
|
public:
|
|
|
|
ObjCNSObjectAttr() : Attr(ObjCNSObject) {}
|
|
|
|
|
|
|
|
static bool classof(const Attr *A) { return A->getKind() == ObjCNSObject; }
|
|
|
|
static bool classof(const ObjCNSObjectAttr *A) { return true; }
|
|
|
|
};
|
|
|
|
|
2008-09-18 20:44:58 +04:00
|
|
|
class BlocksAttr : public Attr {
|
|
|
|
public:
|
|
|
|
enum BlocksAttrTypes {
|
|
|
|
ByRef = 0
|
|
|
|
};
|
|
|
|
private:
|
|
|
|
BlocksAttrTypes BlocksAttrType;
|
|
|
|
public:
|
|
|
|
BlocksAttr(BlocksAttrTypes t) : Attr(Blocks), BlocksAttrType(t) {}
|
|
|
|
|
|
|
|
BlocksAttrTypes getType() const { return BlocksAttrType; }
|
|
|
|
|
|
|
|
// Implement isa/cast/dyncast/etc.
|
|
|
|
|
|
|
|
static bool classof(const Attr *A) { return A->getKind() == Blocks; }
|
2009-01-14 02:34:40 +03:00
|
|
|
static bool classof(const BlocksAttr *A) { return true; }
|
2008-09-18 20:44:58 +04:00
|
|
|
};
|
|
|
|
|
2009-01-31 04:16:18 +03:00
|
|
|
class FunctionDecl;
|
|
|
|
|
|
|
|
class CleanupAttr : public Attr {
|
|
|
|
FunctionDecl *FD;
|
|
|
|
|
|
|
|
public:
|
|
|
|
CleanupAttr(FunctionDecl *fd) : Attr(Cleanup), FD(fd) {}
|
|
|
|
|
|
|
|
const FunctionDecl *getFunctionDecl() const { return FD; }
|
|
|
|
|
|
|
|
// Implement isa/cast/dyncast/etc.
|
|
|
|
|
|
|
|
static bool classof(const Attr *A) { return A->getKind() == Cleanup; }
|
|
|
|
static bool classof(const CleanupAttr *A) { return true; }
|
|
|
|
};
|
|
|
|
|
2008-02-14 10:14:34 +03:00
|
|
|
} // end namespace clang
|
|
|
|
|
|
|
|
#endif
|