forked from OSchip/llvm-project
Devirtualize DIScope and subclasses.
Nothing in here makes use of the virtuality. llvm-svn: 159349
This commit is contained in:
parent
6b03aa1bf7
commit
92658b8149
|
@ -157,13 +157,11 @@ namespace llvm {
|
||||||
|
|
||||||
/// DIScope - A base class for various scopes.
|
/// DIScope - A base class for various scopes.
|
||||||
class DIScope : public DIDescriptor {
|
class DIScope : public DIDescriptor {
|
||||||
virtual void anchor();
|
|
||||||
protected:
|
protected:
|
||||||
friend class DIDescriptor;
|
friend class DIDescriptor;
|
||||||
void printInternal(raw_ostream &OS) const;
|
void printInternal(raw_ostream &OS) const;
|
||||||
public:
|
public:
|
||||||
explicit DIScope(const MDNode *N = 0) : DIDescriptor (N) {}
|
explicit DIScope(const MDNode *N = 0) : DIDescriptor (N) {}
|
||||||
virtual ~DIScope() {}
|
|
||||||
|
|
||||||
StringRef getFilename() const;
|
StringRef getFilename() const;
|
||||||
StringRef getDirectory() const;
|
StringRef getDirectory() const;
|
||||||
|
@ -171,7 +169,6 @@ namespace llvm {
|
||||||
|
|
||||||
/// DICompileUnit - A wrapper for a compile unit.
|
/// DICompileUnit - A wrapper for a compile unit.
|
||||||
class DICompileUnit : public DIScope {
|
class DICompileUnit : public DIScope {
|
||||||
virtual void anchor();
|
|
||||||
friend class DIDescriptor;
|
friend class DIDescriptor;
|
||||||
void printInternal(raw_ostream &OS) const;
|
void printInternal(raw_ostream &OS) const;
|
||||||
public:
|
public:
|
||||||
|
@ -207,7 +204,6 @@ namespace llvm {
|
||||||
|
|
||||||
/// DIFile - This is a wrapper for a file.
|
/// DIFile - This is a wrapper for a file.
|
||||||
class DIFile : public DIScope {
|
class DIFile : public DIScope {
|
||||||
virtual void anchor();
|
|
||||||
friend class DIDescriptor;
|
friend class DIDescriptor;
|
||||||
void printInternal(raw_ostream &OS) const {} // FIXME: Output something?
|
void printInternal(raw_ostream &OS) const {} // FIXME: Output something?
|
||||||
public:
|
public:
|
||||||
|
@ -240,7 +236,6 @@ namespace llvm {
|
||||||
/// FIXME: Types should be factored much better so that CV qualifiers and
|
/// FIXME: Types should be factored much better so that CV qualifiers and
|
||||||
/// others do not require a huge and empty descriptor full of zeros.
|
/// others do not require a huge and empty descriptor full of zeros.
|
||||||
class DIType : public DIScope {
|
class DIType : public DIScope {
|
||||||
virtual void anchor();
|
|
||||||
protected:
|
protected:
|
||||||
friend class DIDescriptor;
|
friend class DIDescriptor;
|
||||||
void printInternal(raw_ostream &OS) const;
|
void printInternal(raw_ostream &OS) const;
|
||||||
|
@ -252,7 +247,6 @@ namespace llvm {
|
||||||
bool Verify() const;
|
bool Verify() const;
|
||||||
explicit DIType(const MDNode *N);
|
explicit DIType(const MDNode *N);
|
||||||
explicit DIType() {}
|
explicit DIType() {}
|
||||||
virtual ~DIType() {}
|
|
||||||
|
|
||||||
DIScope getContext() const { return getFieldAs<DIScope>(1); }
|
DIScope getContext() const { return getFieldAs<DIScope>(1); }
|
||||||
StringRef getName() const { return getStringField(2); }
|
StringRef getName() const { return getStringField(2); }
|
||||||
|
@ -323,7 +317,6 @@ namespace llvm {
|
||||||
|
|
||||||
/// DIBasicType - A basic type, like 'int' or 'float'.
|
/// DIBasicType - A basic type, like 'int' or 'float'.
|
||||||
class DIBasicType : public DIType {
|
class DIBasicType : public DIType {
|
||||||
virtual void anchor();
|
|
||||||
public:
|
public:
|
||||||
explicit DIBasicType(const MDNode *N = 0) : DIType(N) {}
|
explicit DIBasicType(const MDNode *N = 0) : DIType(N) {}
|
||||||
|
|
||||||
|
@ -336,7 +329,6 @@ namespace llvm {
|
||||||
/// DIDerivedType - A simple derived type, like a const qualified type,
|
/// DIDerivedType - A simple derived type, like a const qualified type,
|
||||||
/// a typedef, a pointer or reference, etc.
|
/// a typedef, a pointer or reference, etc.
|
||||||
class DIDerivedType : public DIType {
|
class DIDerivedType : public DIType {
|
||||||
virtual void anchor();
|
|
||||||
friend class DIDescriptor;
|
friend class DIDescriptor;
|
||||||
void printInternal(raw_ostream &OS) const;
|
void printInternal(raw_ostream &OS) const;
|
||||||
protected:
|
protected:
|
||||||
|
@ -402,7 +394,6 @@ namespace llvm {
|
||||||
/// other types, like a function or struct.
|
/// other types, like a function or struct.
|
||||||
/// FIXME: Why is this a DIDerivedType??
|
/// FIXME: Why is this a DIDerivedType??
|
||||||
class DICompositeType : public DIDerivedType {
|
class DICompositeType : public DIDerivedType {
|
||||||
virtual void anchor();
|
|
||||||
friend class DIDescriptor;
|
friend class DIDescriptor;
|
||||||
void printInternal(raw_ostream &OS) const;
|
void printInternal(raw_ostream &OS) const;
|
||||||
public:
|
public:
|
||||||
|
@ -462,7 +453,6 @@ namespace llvm {
|
||||||
|
|
||||||
/// DISubprogram - This is a wrapper for a subprogram (e.g. a function).
|
/// DISubprogram - This is a wrapper for a subprogram (e.g. a function).
|
||||||
class DISubprogram : public DIScope {
|
class DISubprogram : public DIScope {
|
||||||
virtual void anchor();
|
|
||||||
friend class DIDescriptor;
|
friend class DIDescriptor;
|
||||||
void printInternal(raw_ostream &OS) const;
|
void printInternal(raw_ostream &OS) const;
|
||||||
public:
|
public:
|
||||||
|
@ -690,7 +680,6 @@ namespace llvm {
|
||||||
|
|
||||||
/// DILexicalBlock - This is a wrapper for a lexical block.
|
/// DILexicalBlock - This is a wrapper for a lexical block.
|
||||||
class DILexicalBlock : public DIScope {
|
class DILexicalBlock : public DIScope {
|
||||||
virtual void anchor();
|
|
||||||
public:
|
public:
|
||||||
explicit DILexicalBlock(const MDNode *N = 0) : DIScope(N) {}
|
explicit DILexicalBlock(const MDNode *N = 0) : DIScope(N) {}
|
||||||
DIScope getContext() const { return getFieldAs<DIScope>(1); }
|
DIScope getContext() const { return getFieldAs<DIScope>(1); }
|
||||||
|
@ -709,7 +698,6 @@ namespace llvm {
|
||||||
/// DILexicalBlockFile - This is a wrapper for a lexical block with
|
/// DILexicalBlockFile - This is a wrapper for a lexical block with
|
||||||
/// a filename change.
|
/// a filename change.
|
||||||
class DILexicalBlockFile : public DIScope {
|
class DILexicalBlockFile : public DIScope {
|
||||||
virtual void anchor();
|
|
||||||
public:
|
public:
|
||||||
explicit DILexicalBlockFile(const MDNode *N = 0) : DIScope(N) {}
|
explicit DILexicalBlockFile(const MDNode *N = 0) : DIScope(N) {}
|
||||||
DIScope getContext() const { return getScope().getContext(); }
|
DIScope getContext() const { return getScope().getContext(); }
|
||||||
|
@ -729,7 +717,6 @@ namespace llvm {
|
||||||
|
|
||||||
/// DINameSpace - A wrapper for a C++ style name space.
|
/// DINameSpace - A wrapper for a C++ style name space.
|
||||||
class DINameSpace : public DIScope {
|
class DINameSpace : public DIScope {
|
||||||
virtual void anchor();
|
|
||||||
public:
|
public:
|
||||||
explicit DINameSpace(const MDNode *N = 0) : DIScope(N) {}
|
explicit DINameSpace(const MDNode *N = 0) : DIScope(N) {}
|
||||||
DIScope getContext() const { return getFieldAs<DIScope>(1); }
|
DIScope getContext() const { return getFieldAs<DIScope>(1); }
|
||||||
|
|
|
@ -1156,29 +1156,3 @@ void DIVariable::printExtendedName(raw_ostream &OS) const {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
|
||||||
// DIDescriptor: vtable anchors for all descriptors.
|
|
||||||
//===----------------------------------------------------------------------===//
|
|
||||||
|
|
||||||
void DIScope::anchor() { }
|
|
||||||
|
|
||||||
void DICompileUnit::anchor() { }
|
|
||||||
|
|
||||||
void DIFile::anchor() { }
|
|
||||||
|
|
||||||
void DIType::anchor() { }
|
|
||||||
|
|
||||||
void DIBasicType::anchor() { }
|
|
||||||
|
|
||||||
void DIDerivedType::anchor() { }
|
|
||||||
|
|
||||||
void DICompositeType::anchor() { }
|
|
||||||
|
|
||||||
void DISubprogram::anchor() { }
|
|
||||||
|
|
||||||
void DILexicalBlock::anchor() { }
|
|
||||||
|
|
||||||
void DINameSpace::anchor() { }
|
|
||||||
|
|
||||||
void DILexicalBlockFile::anchor() { }
|
|
||||||
|
|
Loading…
Reference in New Issue