diff options
author | George Rimar <grimar@accesssoftek.com> | 2017-11-23 06:52:44 +0000 |
---|---|---|
committer | George Rimar <grimar@accesssoftek.com> | 2017-11-23 06:52:44 +0000 |
commit | 9052cc8ec75aaeea78f9e2825deb70587f4fa420 (patch) | |
tree | 10c77d4fd6541f3c347e433d3bafa0d0ae45b725 /utils/TableGen | |
parent | 41474c8b1aac9df6d6ca0a110cc7b03c8d0bd6bf (diff) |
Revert r318822 "[llvm-tblgen] - Stop using std::string in RecordKeeper."
It reported to have problems with memory sanitizers and DBUILD_SHARED_LIBS=ON.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318899 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen')
-rw-r--r-- | utils/TableGen/CTagsEmitter.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/utils/TableGen/CTagsEmitter.cpp b/utils/TableGen/CTagsEmitter.cpp index e72430078ba..5213cd90446 100644 --- a/utils/TableGen/CTagsEmitter.cpp +++ b/utils/TableGen/CTagsEmitter.cpp @@ -28,17 +28,18 @@ namespace { class Tag { private: - StringRef Id; + const std::string *Id; SMLoc Loc; public: - Tag(StringRef Name, const SMLoc Location) : Id(Name), Loc(Location) {} - int operator<(const Tag &B) const { return Id < B.Id; } + Tag(const std::string &Name, const SMLoc Location) + : Id(&Name), Loc(Location) {} + int operator<(const Tag &B) const { return *Id < *B.Id; } void emit(raw_ostream &OS) const { const MemoryBuffer *CurMB = SrcMgr.getMemoryBuffer(SrcMgr.FindBufferContainingLoc(Loc)); auto BufferName = CurMB->getBufferIdentifier(); std::pair<unsigned, unsigned> LineAndColumn = SrcMgr.getLineAndColumn(Loc); - OS << Id << "\t" << BufferName << "\t" << LineAndColumn.first << "\n"; + OS << *Id << "\t" << BufferName << "\t" << LineAndColumn.first << "\n"; } }; |