mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-09 11:25:55 +00:00
Define addString() and lookup() out-of-line to dissuade the C++ compiler from inlining it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45068 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -178,7 +178,14 @@ public:
|
||||
|
||||
inline Node* getRoot() const { return Nodes[0]; }
|
||||
|
||||
bool addString(const std::string& s, const Payload& data) {
|
||||
bool addString(const std::string& s, const Payload& data);
|
||||
const Payload& lookup(const std::string& s) const;
|
||||
|
||||
};
|
||||
|
||||
// Define this out-of-line to dissuade the C++ compiler from inlining it.
|
||||
template<class Payload>
|
||||
bool Trie<Payload>::addString(const std::string& s, const Payload& data) {
|
||||
Node* cNode = getRoot();
|
||||
Node* tNode = NULL;
|
||||
std::string s1(s);
|
||||
@@ -214,9 +221,10 @@ public:
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
const Payload& lookup(const std::string& s) const {
|
||||
template<class Payload>
|
||||
const Payload& Trie<Payload>::lookup(const std::string& s) const {
|
||||
Node* cNode = getRoot();
|
||||
Node* tNode = NULL;
|
||||
std::string s1(s);
|
||||
@@ -247,9 +255,7 @@ public:
|
||||
}
|
||||
|
||||
return tNode->data();
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
template<class Payload>
|
||||
struct GraphTraits<Trie<Payload> > {
|
||||
|
Reference in New Issue
Block a user