This machine mirrors various open-source projects. 20 Gbit/s uplink. If there are any issues or you want another project mirrored, please contact mirror-service -=AT=- netcologne DOT de !
00001 //===-- basic/IdentifierInfo.h -------------------------------- -*- C++ -*-===// 00002 // 00003 // This file is distributed under the MIT license. See LICENSE.txt for details. 00004 // 00005 // Copyright (C) 2008-2009 Stephen Wilson 00006 // 00007 //===----------------------------------------------------------------------===// 00008 00009 #ifndef COMMA_BASIC_IDENTIFIERINFO_HDR_GUARD 00010 #define COMMA_BASIC_IDENTIFIERINFO_HDR_GUARD 00011 00012 #include "comma/basic/Attributes.h" 00013 00014 #include "llvm/ADT/StringMap.h" 00015 00016 #include <cassert> 00017 00018 namespace comma { 00019 00036 class IdentifierInfo { 00037 00038 public: 00039 IdentifierInfo() 00040 : attributeID(attrib::UNKNOWN_ATTRIBUTE), 00041 metadata(0) { } 00042 00045 const char *getString() const { 00046 return llvm::StringMapEntry<IdentifierInfo>:: 00047 GetStringMapEntryFromValue(*this).getKeyData(); 00048 } 00049 00052 template<typename T> 00053 T* getMetadata() const { return static_cast<T*>(metadata); } 00054 00059 void setMetadata(void *mdata) { metadata = mdata; } 00060 00062 bool hasMetadata() const { return metadata != 0; } 00063 00065 void setAttributeID(attrib::AttributeID ID) { attributeID = ID; } 00066 00068 attrib::AttributeID getAttributeID() const { return attributeID; } 00069 00070 private: 00071 attrib::AttributeID attributeID : 8; 00072 void *metadata; 00073 }; 00074 00075 } // End comma namespace 00076 00077 #endif