X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FExecutionEngine%2FEventListenerCommon.h;h=6453099b73d7a17c2bb484e6cb65c4ec188ec069;hb=ca6245c5541321f08974b4908617e3e8aebbab1a;hp=66645d7297e9593b4763887d0e4e0523ac618966;hpb=f4ec8bfaecef4e38f713b9e05d89869b023e1ce8;p=oota-llvm.git diff --git a/lib/ExecutionEngine/EventListenerCommon.h b/lib/ExecutionEngine/EventListenerCommon.h index 66645d7297e..6453099b73d 100644 --- a/lib/ExecutionEngine/EventListenerCommon.h +++ b/lib/ExecutionEngine/EventListenerCommon.h @@ -26,13 +26,13 @@ namespace jitprofiling { class FilenameCache { // Holds the filename of each Scope, so that we can pass a null-terminated - // string into oprofile. Use an AssertingVH rather than a ValueMap because we - // shouldn't be modifying any MDNodes while this map is alive. - DenseMap, std::string> Filenames; - DenseMap, std::string> Paths; + // string into oprofile. + DenseMap Filenames; + DenseMap Paths; public: const char *getFilename(MDNode *Scope) { + assert(Scope->isResolved() && "Expected Scope to be resolved"); std::string &Filename = Filenames[Scope]; if (Filename.empty()) { DIScope DIScope(Scope); @@ -42,6 +42,7 @@ class FilenameCache { } const char *getFullPath(MDNode *Scope) { + assert(Scope->isResolved() && "Expected Scope to be resolved"); std::string &P = Paths[Scope]; if (P.empty()) { DIScope DIScope(Scope);