Fixed hasLinkerPrivateGlobalPrefix treating StringRef as C String.
Reviewers: jgravelle-google, sbc100
Subscribers: aheejin, llvm-commits
Differential Revision: https://reviews.llvm.org/D57545
llvm-svn: 352810
GitOrigin-RevId: 5f563f06d1420fc09023c55858d14c3bf1576537
diff --git a/include/llvm/MC/MCAsmInfo.h b/include/llvm/MC/MCAsmInfo.h
index c7e5c9f..e861df5b 100644
--- a/include/llvm/MC/MCAsmInfo.h
+++ b/include/llvm/MC/MCAsmInfo.h
@@ -491,7 +491,7 @@
StringRef getPrivateLabelPrefix() const { return PrivateLabelPrefix; }
bool hasLinkerPrivateGlobalPrefix() const {
- return LinkerPrivateGlobalPrefix[0] != '\0';
+ return !LinkerPrivateGlobalPrefix.empty();
}
StringRef getLinkerPrivateGlobalPrefix() const {