[cfe-commits] r47118 - /cfe/trunk/include/clang/AST/Attr.h
Anders Carlsson
andersca at mac.com
Wed Feb 13 23:43:43 PST 2008
Author: andersca
Date: Thu Feb 14 01:43:43 2008
New Revision: 47118
URL: http://llvm.org/viewvc/llvm-project?rev=47118&view=rev
Log:
Address comments from Chris.
Modified:
cfe/trunk/include/clang/AST/Attr.h
Modified: cfe/trunk/include/clang/AST/Attr.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Attr.h?rev=47118&r1=47117&r2=47118&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Attr.h (original)
+++ cfe/trunk/include/clang/AST/Attr.h Thu Feb 14 01:43:43 2008
@@ -11,8 +11,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_CLANG_AST_EXPR_H
-#define LLVM_CLANG_AST_EXPR_H
+#ifndef LLVM_CLANG_AST_ATTR_H
+#define LLVM_CLANG_AST_ATTR_H
namespace clang {
@@ -20,39 +20,33 @@
class Attr {
public:
enum Kind {
- AddressSpace,
Aligned,
- OCUVectorType,
- Packed,
- VectorSize
+ Packed
};
private:
- Attr *next;
-
+ Attr *Next;
Kind AttrKind;
protected:
Attr(Kind AK) : AttrKind(AK) {}
virtual ~Attr() {
- if (Next)
- delete Next;
+ delete Next;
}
public:
Kind getKind() const { return AttrKind; }
- Attr *getNext() const { return Next; }
- void setNext(Attr *N) { Next = N; }
+ Attr *getNext() { return Next; }
+ const Attr *getNext() const { return Next; }
+ void setNext(Attr *next) { Next = next; }
void addAttr(Attr *attr) {
assert((attr != 0) && "addAttr(): attr is null");
- Attr *next = this, *prev;
- do {
- prev = next;
- next = next->getNext();
- } while (next);
- prev->setNext(attr);
+
+ // FIXME: This doesn't preserve the order in any way.
+ attr->Next = Next;
+ Next = attr;
}
// Implement isa/cast/dyncast/etc.
@@ -69,7 +63,7 @@
}
static bool classof(const PackedAttr *A) { return true; }
};
-
+
} // end namespace clang
#endif
More information about the cfe-commits
mailing list