mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
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:
@@ -150,8 +150,8 @@ FileUnit *SerializedModuleLoader::loadAST(
|
||||
bool isFramework) {
|
||||
assert(moduleInputBuffer);
|
||||
|
||||
const char *moduleBufferID = moduleInputBuffer->getBufferIdentifier();
|
||||
const char *moduleDocBufferID = nullptr;
|
||||
StringRef moduleBufferID = moduleInputBuffer->getBufferIdentifier();
|
||||
StringRef moduleDocBufferID;
|
||||
if (moduleDocInputBuffer)
|
||||
moduleDocBufferID = moduleDocInputBuffer->getBufferIdentifier();
|
||||
|
||||
@@ -236,9 +236,9 @@ FileUnit *SerializedModuleLoader::loadAST(
|
||||
break;
|
||||
|
||||
case serialization::Status::MalformedDocumentation:
|
||||
assert(moduleDocBufferID);
|
||||
assert(!moduleDocBufferID.empty());
|
||||
Ctx.Diags.diagnose(*diagLoc, diag::serialization_malformed_module,
|
||||
moduleDocBufferID ? moduleDocBufferID : "");
|
||||
moduleDocBufferID);
|
||||
break;
|
||||
|
||||
case serialization::Status::MissingDependency: {
|
||||
|
||||
Reference in New Issue
Block a user