Reformat.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191997 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Christopher 2013-10-04 23:15:52 +00:00
parent fc75310230
commit f2fff255de

View File

@ -59,8 +59,8 @@ namespace llvm {
class DIDescriptor {
// Befriends DIRef so DIRef can befriend the protected member
// function: getFieldAs<DIRef>.
template <typename T>
friend class DIRef;
template <typename T> friend class DIRef;
public:
enum {
FlagPrivate = 1 << 0,
@ -78,6 +78,7 @@ namespace llvm {
FlagStaticMember = 1 << 12,
FlagIndirectVariable = 1 << 13
};
protected:
const MDNode *DbgNode;
@ -89,8 +90,7 @@ namespace llvm {
int64_t getInt64Field(unsigned Elt) const;
DIDescriptor getDescriptorField(unsigned Elt) const;
template <typename DescTy>
DescTy getFieldAs(unsigned Elt) const {
template <typename DescTy> DescTy getFieldAs(unsigned Elt) const {
return DescTy(getDescriptorField(Elt));
}
@ -114,12 +114,8 @@ namespace llvm {
// implicitly convertable to bool.
LLVM_EXPLICIT operator bool() const { return DbgNode != 0; }
bool operator==(DIDescriptor Other) const {
return DbgNode == Other.DbgNode;
}
bool operator!=(DIDescriptor Other) const {
return !operator==(Other);
}
bool operator==(DIDescriptor Other) const { return DbgNode == Other.DbgNode; }
bool operator!=(DIDescriptor Other) const { return !operator==(Other); }
uint16_t getTag() const {
return getUnsignedField(0) & ~LLVMDebugVersionMask;
@ -157,6 +153,7 @@ namespace llvm {
class DISubrange : public DIDescriptor {
friend class DIDescriptor;
void printInternal(raw_ostream &OS) const;
public:
explicit DISubrange(const MDNode *N = 0) : DIDescriptor(N) {}
@ -182,6 +179,7 @@ namespace llvm {
class DIEnumerator : public DIDescriptor {
friend class DIDescriptor;
void printInternal(raw_ostream &OS) const;
public:
explicit DIEnumerator(const MDNode *N = 0) : DIDescriptor(N) {}
@ -190,8 +188,7 @@ namespace llvm {
bool Verify() const;
};
template <typename T>
class DIRef;
template <typename T> class DIRef;
typedef DIRef<DIScope> DIScopeRef;
typedef DIRef<DIType> DITypeRef;
@ -200,6 +197,7 @@ namespace llvm {
protected:
friend class DIDescriptor;
void printInternal(raw_ostream &OS) const;
public:
explicit DIScope(const MDNode *N = 0) : DIDescriptor(N) {}
@ -216,8 +214,7 @@ namespace llvm {
/// Represents reference to a DIDescriptor, abstracts over direct and
/// identifier-based metadata references.
template <typename T>
class DIRef {
template <typename T> class DIRef {
template <typename DescTy>
friend DescTy DIDescriptor::getFieldAs(unsigned Elt) const;
friend DIScopeRef DIScope::getContext() const;
@ -227,6 +224,7 @@ namespace llvm {
/// MDString specifies the type identifier.
const Value *Val;
explicit DIRef(const Value *V);
public:
T resolve(const DITypeIdentifierMap &Map) const {
if (!Val)
@ -247,18 +245,14 @@ namespace llvm {
};
/// Specialize getFieldAs to handle fields that are references to DIScopes.
template <>
DIScopeRef DIDescriptor::getFieldAs<DIScopeRef>(unsigned Elt) const;
template <> DIScopeRef DIDescriptor::getFieldAs<DIScopeRef>(unsigned Elt) const;
/// Specialize DIRef constructor for DIScopeRef.
template <>
DIRef<DIScope>::DIRef(const Value *V);
template <> DIRef<DIScope>::DIRef(const Value *V);
/// Specialize getFieldAs to handle fields that are references to DITypes.
template <>
DITypeRef DIDescriptor::getFieldAs<DITypeRef>(unsigned Elt) const;
template <> DITypeRef DIDescriptor::getFieldAs<DITypeRef>(unsigned Elt) const;
/// Specialize DIRef constructor for DITypeRef.
template <>
DIRef<DIType>::DIRef(const Value *V);
template <> DIRef<DIType>::DIRef(const Value *V);
/// DIType - This is a wrapper for a type.
/// FIXME: Types should be factored much better so that CV qualifiers and
@ -283,15 +277,9 @@ namespace llvm {
// carry this is just plain insane.
uint64_t getOffsetInBits() const { return getUInt64Field(7); }
unsigned getFlags() const { return getUnsignedField(8); }
bool isPrivate() const {
return (getFlags() & FlagPrivate) != 0;
}
bool isProtected() const {
return (getFlags() & FlagProtected) != 0;
}
bool isForwardDecl() const {
return (getFlags() & FlagFwdDecl) != 0;
}
bool isPrivate() const { return (getFlags() & FlagPrivate) != 0; }
bool isProtected() const { return (getFlags() & FlagProtected) != 0; }
bool isForwardDecl() const { return (getFlags() & FlagFwdDecl) != 0; }
// isAppleBlock - Return true if this is the Apple Blocks extension.
bool isAppleBlockExtension() const {
return (getFlags() & FlagAppleBlock) != 0;
@ -299,27 +287,15 @@ namespace llvm {
bool isBlockByrefStruct() const {
return (getFlags() & FlagBlockByrefStruct) != 0;
}
bool isVirtual() const {
return (getFlags() & FlagVirtual) != 0;
}
bool isArtificial() const {
return (getFlags() & FlagArtificial) != 0;
}
bool isObjectPointer() const {
return (getFlags() & FlagObjectPointer) != 0;
}
bool isVirtual() const { return (getFlags() & FlagVirtual) != 0; }
bool isArtificial() const { return (getFlags() & FlagArtificial) != 0; }
bool isObjectPointer() const { return (getFlags() & FlagObjectPointer) != 0; }
bool isObjcClassComplete() const {
return (getFlags() & FlagObjcClassComplete) != 0;
}
bool isVector() const {
return (getFlags() & FlagVector) != 0;
}
bool isStaticMember() const {
return (getFlags() & FlagStaticMember) != 0;
}
bool isValid() const {
return DbgNode && isType();
}
bool isVector() const { return (getFlags() & FlagVector) != 0; }
bool isStaticMember() const { return (getFlags() & FlagStaticMember) != 0; }
bool isValid() const { return DbgNode && isType(); }
/// isUnsignedDIType - Return true if type encoding is unsigned.
bool isUnsignedDIType();
@ -384,6 +360,7 @@ namespace llvm {
class DICompositeType : public DIDerivedType {
friend class DIDescriptor;
void printInternal(raw_ostream &OS) const;
public:
explicit DICompositeType(const MDNode *N = 0) : DIDerivedType(N) {}
@ -391,9 +368,7 @@ namespace llvm {
void setTypeArray(DIArray Elements, DIArray TParams = DIArray());
void addMember(DIDescriptor D);
unsigned getRunTimeLang() const { return getUnsignedField(11); }
DITypeRef getContainingType() const {
return getFieldAs<DITypeRef>(12);
}
DITypeRef getContainingType() const { return getFieldAs<DITypeRef>(12); }
void setContainingType(DICompositeType ContainingType);
DIArray getTemplateParams() const { return getFieldAs<DIArray>(13); }
MDString *getIdentifier() const;
@ -405,6 +380,7 @@ namespace llvm {
/// DIFile - This is a wrapper for a file.
class DIFile : public DIScope {
friend class DIDescriptor;
public:
explicit DIFile(const MDNode *N = 0) : DIScope(N) {}
MDNode *getFileNode() const;
@ -415,6 +391,7 @@ namespace llvm {
class DICompileUnit : public DIScope {
friend class DIDescriptor;
void printInternal(raw_ostream &OS) const;
public:
explicit DICompileUnit(const MDNode *N = 0) : DIScope(N) {}
@ -441,6 +418,7 @@ namespace llvm {
class DISubprogram : public DIScope {
friend class DIDescriptor;
void printInternal(raw_ostream &OS) const;
public:
explicit DISubprogram(const MDNode *N = 0) : DIScope(N) {}
@ -459,31 +437,23 @@ namespace llvm {
unsigned getVirtuality() const { return getUnsignedField(10); }
unsigned getVirtualIndex() const { return getUnsignedField(11); }
DITypeRef getContainingType() const {
return getFieldAs<DITypeRef>(12);
}
DITypeRef getContainingType() const { return getFieldAs<DITypeRef>(12); }
unsigned getFlags() const {
return getUnsignedField(13);
}
unsigned getFlags() const { return getUnsignedField(13); }
unsigned isArtificial() const {
return (getUnsignedField(13) & FlagArtificial) != 0;
}
/// isPrivate - Return true if this subprogram has "private"
/// access specifier.
bool isPrivate() const {
return (getUnsignedField(13) & FlagPrivate) != 0;
}
bool isPrivate() const { return (getUnsignedField(13) & FlagPrivate) != 0; }
/// isProtected - Return true if this subprogram has "protected"
/// access specifier.
bool isProtected() const {
return (getUnsignedField(13) & FlagProtected) != 0;
}
/// isExplicit - Return true if this subprogram is marked as explicit.
bool isExplicit() const {
return (getUnsignedField(13) & FlagExplicit) != 0;
}
bool isExplicit() const { return (getUnsignedField(13) & FlagExplicit) != 0; }
/// isPrototyped - Return true if this subprogram is prototyped.
bool isPrototyped() const {
return (getUnsignedField(13) & FlagPrototyped) != 0;
@ -543,6 +513,7 @@ namespace llvm {
class DINameSpace : public DIScope {
friend class DIDescriptor;
void printInternal(raw_ostream &OS) const;
public:
explicit DINameSpace(const MDNode *N = 0) : DIScope(N) {}
DIScope getContext() const { return getFieldAs<DIScope>(2); }
@ -559,9 +530,7 @@ namespace llvm {
DIScope getContext() const { return getFieldAs<DIScope>(1); }
StringRef getName() const { return getStringField(2); }
DIType getType() const { return getFieldAs<DIType>(3); }
StringRef getFilename() const {
return getFieldAs<DIFile>(4).getFilename();
}
StringRef getFilename() const { return getFieldAs<DIFile>(4).getFilename(); }
StringRef getDirectory() const {
return getFieldAs<DIFile>(4).getDirectory();
}
@ -579,9 +548,7 @@ namespace llvm {
StringRef getName() const { return getStringField(2); }
DIType getType() const { return getFieldAs<DIType>(3); }
Value *getValue() const;
StringRef getFilename() const {
return getFieldAs<DIFile>(5).getFilename();
}
StringRef getFilename() const { return getFieldAs<DIFile>(5).getFilename(); }
StringRef getDirectory() const {
return getFieldAs<DIFile>(5).getDirectory();
}
@ -594,6 +561,7 @@ namespace llvm {
class DIGlobalVariable : public DIDescriptor {
friend class DIDescriptor;
void printInternal(raw_ostream &OS) const;
public:
explicit DIGlobalVariable(const MDNode *N = 0) : DIDescriptor(N) {}
@ -601,12 +569,9 @@ namespace llvm {
StringRef getName() const { return getStringField(3); }
StringRef getDisplayName() const { return getStringField(4); }
StringRef getLinkageName() const { return getStringField(5); }
StringRef getFilename() const {
return getFieldAs<DIFile>(6).getFilename();
}
StringRef getFilename() const { return getFieldAs<DIFile>(6).getFilename(); }
StringRef getDirectory() const {
return getFieldAs<DIFile>(6).getDirectory();
}
unsigned getLineNumber() const { return getUnsignedField(7); }
@ -629,15 +594,14 @@ namespace llvm {
class DIVariable : public DIDescriptor {
friend class DIDescriptor;
void printInternal(raw_ostream &OS) const;
public:
explicit DIVariable(const MDNode *N = 0) : DIDescriptor(N) {}
DIScope getContext() const { return getFieldAs<DIScope>(1); }
StringRef getName() const { return getStringField(2); }
DIFile getFile() const { return getFieldAs<DIFile>(3); }
unsigned getLineNumber() const {
return (getUnsignedField(4) << 8) >> 8;
}
unsigned getLineNumber() const { return (getUnsignedField(4) << 8) >> 8; }
unsigned getArgNumber() const {
unsigned L = getUnsignedField(4);
return L >> 24;
@ -665,9 +629,7 @@ namespace llvm {
bool Verify() const;
/// HasComplexAddr - Return true if the variable has a complex address.
bool hasComplexAddress() const {
return getNumAddrElements() > 0;
}
bool hasComplexAddress() const { return getNumAddrElements() > 0; }
unsigned getNumAddrElements() const;
@ -677,9 +639,7 @@ namespace llvm {
/// isBlockByrefVariable - Return true if the variable was declared as
/// a "__block" variable (Apple Blocks).
bool isBlockByrefVariable() const {
return getType().isBlockByrefStruct();
}
bool isBlockByrefVariable() const { return getType().isBlockByrefStruct(); }
/// isInlinedFnArgument - Return true if this variable provides debugging
/// information for an inlined function arguments.
@ -706,6 +666,7 @@ namespace llvm {
class DIObjCProperty : public DIDescriptor {
friend class DIDescriptor;
void printInternal(raw_ostream &OS) const;
public:
explicit DIObjCProperty(const MDNode *N) : DIDescriptor(N) {}
@ -713,12 +674,8 @@ namespace llvm {
DIFile getFile() const { return getFieldAs<DIFile>(2); }
unsigned getLineNumber() const { return getUnsignedField(3); }
StringRef getObjCPropertyGetterName() const {
return getStringField(4);
}
StringRef getObjCPropertySetterName() const {
return getStringField(5);
}
StringRef getObjCPropertyGetterName() const { return getStringField(4); }
StringRef getObjCPropertySetterName() const { return getStringField(5); }
bool isReadOnlyObjCProperty() const {
return (getUnsignedField(6) & dwarf::DW_APPLE_PROPERTY_readonly) != 0;
}
@ -748,6 +705,7 @@ namespace llvm {
class DIImportedEntity : public DIDescriptor {
friend class DIDescriptor;
void printInternal(raw_ostream &OS) const;
public:
explicit DIImportedEntity(const MDNode *N) : DIDescriptor(N) {}
DIScope getContext() const { return getFieldAs<DIScope>(1); }
@ -805,6 +763,7 @@ namespace llvm {
/// Clear all lists.
void reset();
private:
/// processType - Process DIType.
void processType(DIType DT);