Use StringRef in more places to match recent llvm changes.

llvm r283043 and possibly other recent changes switch to use StringRef
instead of char* pointers. Update Swift to match. In some cases, this is
a clear improvement. It would be good to assess the impact on memory use,
particularly for the Filename component of source locations.

Note that the change to SILLocation::isNull fixes an apparent bug where
the location was treated as null when the filename was *not* null.
This commit is contained in:
Bob Wilson
2016-10-13 12:56:38 -07:00
parent c08a96a880
commit 3fd92f82e8
13 changed files with 41 additions and 47 deletions

View File

@@ -3598,8 +3598,8 @@ class DeclGroupNameContext {
auto PathOp = VD->getDeclContext()->getParentSourceFile()->getBufferID();
if (!PathOp.hasValue())
return NullGroupName;
StringRef FullPath = StringRef(VD->getASTContext().SourceMgr.
getIdentifierForBuffer(PathOp.getValue()));
StringRef FullPath =
VD->getASTContext().SourceMgr.getIdentifierForBuffer(PathOp.getValue());
if (!pMap) {
YamlGroupInputParser Parser(RecordPath);
if (!Parser.parse()) {