aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Bitcode/Writer/ValueEnumerator.h
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2010-06-02 23:05:04 +0000
committerDevang Patel <dpatel@apple.com>2010-06-02 23:05:04 +0000
commit6209869f83979319e2e5791382f09b83e54191e0 (patch)
tree834ba2acc95eeea1ba39031a2c266569ca8ade0a /lib/Bitcode/Writer/ValueEnumerator.h
parent05c68374c1c73599a0b7044ad09fb4827d128ec5 (diff)
downloadexternal_llvm-6209869f83979319e2e5791382f09b83e54191e0.zip
external_llvm-6209869f83979319e2e5791382f09b83e54191e0.tar.gz
external_llvm-6209869f83979319e2e5791382f09b83e54191e0.tar.bz2
Speedup bitcode writer. Do not walk all values for all functions to emit function local metadata. In one testcase, probably worst case scenario, the 70x speed up is seen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105360 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bitcode/Writer/ValueEnumerator.h')
-rw-r--r--lib/Bitcode/Writer/ValueEnumerator.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Bitcode/Writer/ValueEnumerator.h b/lib/Bitcode/Writer/ValueEnumerator.h
index 4f8ebf5..2b9b15f 100644
--- a/lib/Bitcode/Writer/ValueEnumerator.h
+++ b/lib/Bitcode/Writer/ValueEnumerator.h
@@ -15,6 +15,7 @@
#define VALUE_ENUMERATOR_H
#include "llvm/ADT/DenseMap.h"
+#include "llvm/ADT/SmallVector.h"
#include "llvm/Attributes.h"
#include <vector>
@@ -26,7 +27,7 @@ class Instruction;
class BasicBlock;
class Function;
class Module;
-class MetadataBase;
+class MDNode;
class NamedMDNode;
class AttrListPtr;
class TypeSymbolTable;
@@ -49,6 +50,7 @@ private:
ValueMapType ValueMap;
ValueList Values;
ValueList MDValues;
+ SmallVector<const MDNode *, 8> FunctionLocalMDs;
ValueMapType MDValueMap;
typedef DenseMap<void*, unsigned> AttributeMapType;
@@ -105,6 +107,9 @@ public:
const ValueList &getValues() const { return Values; }
const ValueList &getMDValues() const { return MDValues; }
+ const SmallVector<const MDNode *, 8> &getFunctionLocalMDValues() const {
+ return FunctionLocalMDs;
+ }
const TypeList &getTypes() const { return Types; }
const std::vector<const BasicBlock*> &getBasicBlocks() const {
return BasicBlocks;