[llvm-commits] [llvm] r159349 - in /llvm/trunk: include/llvm/DebugInfo.h lib/VMCore/DebugInfo.cpp
Benjamin Kramer
benny.kra at googlemail.com
Thu Jun 28 07:25:45 PDT 2012
Author: d0k
Date: Thu Jun 28 09:25:45 2012
New Revision: 159349
URL: http://llvm.org/viewvc/llvm-project?rev=159349&view=rev
Log:
Devirtualize DIScope and subclasses.
Nothing in here makes use of the virtuality.
Modified:
llvm/trunk/include/llvm/DebugInfo.h
llvm/trunk/lib/VMCore/DebugInfo.cpp
Modified: llvm/trunk/include/llvm/DebugInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo.h?rev=159349&r1=159348&r2=159349&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo.h (original)
+++ llvm/trunk/include/llvm/DebugInfo.h Thu Jun 28 09:25:45 2012
@@ -157,13 +157,11 @@
/// DIScope - A base class for various scopes.
class DIScope : public DIDescriptor {
- virtual void anchor();
protected:
friend class DIDescriptor;
void printInternal(raw_ostream &OS) const;
public:
explicit DIScope(const MDNode *N = 0) : DIDescriptor (N) {}
- virtual ~DIScope() {}
StringRef getFilename() const;
StringRef getDirectory() const;
@@ -171,7 +169,6 @@
/// DICompileUnit - A wrapper for a compile unit.
class DICompileUnit : public DIScope {
- virtual void anchor();
friend class DIDescriptor;
void printInternal(raw_ostream &OS) const;
public:
@@ -207,7 +204,6 @@
/// DIFile - This is a wrapper for a file.
class DIFile : public DIScope {
- virtual void anchor();
friend class DIDescriptor;
void printInternal(raw_ostream &OS) const {} // FIXME: Output something?
public:
@@ -240,7 +236,6 @@
/// FIXME: Types should be factored much better so that CV qualifiers and
/// others do not require a huge and empty descriptor full of zeros.
class DIType : public DIScope {
- virtual void anchor();
protected:
friend class DIDescriptor;
void printInternal(raw_ostream &OS) const;
@@ -252,7 +247,6 @@
bool Verify() const;
explicit DIType(const MDNode *N);
explicit DIType() {}
- virtual ~DIType() {}
DIScope getContext() const { return getFieldAs<DIScope>(1); }
StringRef getName() const { return getStringField(2); }
@@ -323,7 +317,6 @@
/// DIBasicType - A basic type, like 'int' or 'float'.
class DIBasicType : public DIType {
- virtual void anchor();
public:
explicit DIBasicType(const MDNode *N = 0) : DIType(N) {}
@@ -336,7 +329,6 @@
/// DIDerivedType - A simple derived type, like a const qualified type,
/// a typedef, a pointer or reference, etc.
class DIDerivedType : public DIType {
- virtual void anchor();
friend class DIDescriptor;
void printInternal(raw_ostream &OS) const;
protected:
@@ -402,7 +394,6 @@
/// other types, like a function or struct.
/// FIXME: Why is this a DIDerivedType??
class DICompositeType : public DIDerivedType {
- virtual void anchor();
friend class DIDescriptor;
void printInternal(raw_ostream &OS) const;
public:
@@ -462,7 +453,6 @@
/// DISubprogram - This is a wrapper for a subprogram (e.g. a function).
class DISubprogram : public DIScope {
- virtual void anchor();
friend class DIDescriptor;
void printInternal(raw_ostream &OS) const;
public:
@@ -690,7 +680,6 @@
/// DILexicalBlock - This is a wrapper for a lexical block.
class DILexicalBlock : public DIScope {
- virtual void anchor();
public:
explicit DILexicalBlock(const MDNode *N = 0) : DIScope(N) {}
DIScope getContext() const { return getFieldAs<DIScope>(1); }
@@ -709,7 +698,6 @@
/// DILexicalBlockFile - This is a wrapper for a lexical block with
/// a filename change.
class DILexicalBlockFile : public DIScope {
- virtual void anchor();
public:
explicit DILexicalBlockFile(const MDNode *N = 0) : DIScope(N) {}
DIScope getContext() const { return getScope().getContext(); }
@@ -729,7 +717,6 @@
/// DINameSpace - A wrapper for a C++ style name space.
class DINameSpace : public DIScope {
- virtual void anchor();
public:
explicit DINameSpace(const MDNode *N = 0) : DIScope(N) {}
DIScope getContext() const { return getFieldAs<DIScope>(1); }
Modified: llvm/trunk/lib/VMCore/DebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/DebugInfo.cpp?rev=159349&r1=159348&r2=159349&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/DebugInfo.cpp (original)
+++ llvm/trunk/lib/VMCore/DebugInfo.cpp Thu Jun 28 09:25:45 2012
@@ -1156,29 +1156,3 @@
}
}
}
-
-//===----------------------------------------------------------------------===//
-// 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() { }
More information about the llvm-commits
mailing list