[PATCH] D40170: [llvm-tblgen] - Stop using std::string in RecordKeeper.
George Rimar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 21 23:55:47 PST 2017
This revision was automatically updated to reflect the committed changes.
Closed by commit rL318822: [llvm-tblgen] - Stop using std::string in RecordKeeper. (authored by grimar).
Changed prior to commit:
https://reviews.llvm.org/D40170?vs=123572&id=123879#toc
Repository:
rL LLVM
https://reviews.llvm.org/D40170
Files:
llvm/trunk/include/llvm/TableGen/Record.h
llvm/trunk/utils/TableGen/CTagsEmitter.cpp
Index: llvm/trunk/utils/TableGen/CTagsEmitter.cpp
===================================================================
--- llvm/trunk/utils/TableGen/CTagsEmitter.cpp
+++ llvm/trunk/utils/TableGen/CTagsEmitter.cpp
@@ -28,18 +28,17 @@
class Tag {
private:
- const std::string *Id;
+ StringRef Id;
SMLoc Loc;
public:
- Tag(const std::string &Name, const SMLoc Location)
- : Id(&Name), Loc(Location) {}
- int operator<(const Tag &B) const { return *Id < *B.Id; }
+ Tag(StringRef 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";
}
};
Index: llvm/trunk/include/llvm/TableGen/Record.h
===================================================================
--- llvm/trunk/include/llvm/TableGen/Record.h
+++ llvm/trunk/include/llvm/TableGen/Record.h
@@ -1525,7 +1525,7 @@
};
class RecordKeeper {
- using RecordMap = std::map<std::string, std::unique_ptr<Record>>;
+ using RecordMap = std::map<StringRef, std::unique_ptr<Record>>;
RecordMap Classes, Defs;
public:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D40170.123879.patch
Type: text/x-patch
Size: 1481 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171122/e1ab38a0/attachment.bin>
More information about the llvm-commits
mailing list