X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FVMCore%2FAttributes.cpp;h=485be75d1b1274d5cbaee2015d5c7cc0419aaffc;hb=8c2e35269c10914c16f351449fb9b8108ccb2556;hp=37a217fc8c5a1a91f6fada3167b48d8178a32b93;hpb=d35b1a2f21b9707a501563d8e4216204bb17dbb8;p=oota-llvm.git diff --git a/lib/VMCore/Attributes.cpp b/lib/VMCore/Attributes.cpp index 37a217fc8c5..485be75d1b1 100644 --- a/lib/VMCore/Attributes.cpp +++ b/lib/VMCore/Attributes.cpp @@ -15,8 +15,8 @@ #include "llvm/Type.h" #include "llvm/ADT/StringExtras.h" #include "llvm/ADT/FoldingSet.h" -#include "llvm/System/Atomic.h" -#include "llvm/System/Mutex.h" +#include "llvm/Support/Atomic.h" +#include "llvm/Support/Mutex.h" #include "llvm/Support/Debug.h" #include "llvm/Support/ManagedStatic.h" #include "llvm/Support/raw_ostream.h" @@ -36,6 +36,10 @@ std::string Attribute::getAsString(Attributes Attrs) { Result += "noreturn "; if (Attrs & Attribute::NoUnwind) Result += "nounwind "; + if (Attrs & Attribute::UWTable) + Result += "uwtable "; + if (Attrs & Attribute::ReturnsTwice) + Result += "returns_twice "; if (Attrs & Attribute::InReg) Result += "inreg "; if (Attrs & Attribute::NoAlias) @@ -70,8 +74,8 @@ std::string Attribute::getAsString(Attributes Attrs) { Result += "noimplicitfloat "; if (Attrs & Attribute::Naked) Result += "naked "; - if (Attrs & Attribute::Hotpatch) - Result += "hotpatch "; + if (Attrs & Attribute::NonLazyBind) + Result += "nonlazybind "; if (Attrs & Attribute::StackAlignment) { Result += "alignstack("; Result += utostr(Attribute::getStackAlignmentFromAttrs(Attrs)); @@ -88,7 +92,7 @@ std::string Attribute::getAsString(Attributes Attrs) { return Result; } -Attributes Attribute::typeIncompatible(const Type *Ty) { +Attributes Attribute::typeIncompatible(Type *Ty) { Attributes Incompatible = None; if (!Ty->isIntegerTy()) @@ -106,6 +110,11 @@ Attributes Attribute::typeIncompatible(const Type *Ty) { // AttributeListImpl Definition //===----------------------------------------------------------------------===// +namespace llvm { + class AttributeListImpl; +} + +static ManagedStatic > AttributesLists; namespace llvm { static ManagedStatic > ALMutex; @@ -131,7 +140,9 @@ public: } void DropRef() { sys::SmartScopedLock Lock(*ALMutex); - sys::cas_flag new_val = RefCount--; + if (!AttributesLists.isConstructed()) + return; + sys::cas_flag new_val = --RefCount; if (new_val == 0) delete this; } @@ -147,8 +158,6 @@ public: }; } -static ManagedStatic > AttributesLists; - AttributeListImpl::~AttributeListImpl() { // NOTE: Lock must be acquired by caller. AttributesLists->RemoveNode(this);