From b398ca69f46f781260e369cbd6511d469e88bdbd Mon Sep 17 00:00:00 2001 From: Mehdi Amini Date: Sat, 1 Oct 2016 04:17:59 +0000 Subject: [PATCH] Use StringRef in Datalayout API (NFC) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283009 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/IR/DataLayout.h | 4 ++-- lib/CodeGen/MachineFunction.cpp | 2 +- lib/Target/ARM/ARMAsmPrinter.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/llvm/IR/DataLayout.h b/include/llvm/IR/DataLayout.h index e309e93a14e..abcb19bc7c2 100644 --- a/include/llvm/IR/DataLayout.h +++ b/include/llvm/IR/DataLayout.h @@ -261,7 +261,7 @@ public: bool hasLinkerPrivateGlobalPrefix() const { return ManglingMode == MM_MachO; } - const char *getLinkerPrivateGlobalPrefix() const { + StringRef getLinkerPrivateGlobalPrefix() const { if (ManglingMode == MM_MachO) return "l"; return ""; @@ -281,7 +281,7 @@ public: llvm_unreachable("invalid mangling mode"); } - const char *getPrivateGlobalPrefix() const { + StringRef getPrivateGlobalPrefix() const { switch (ManglingMode) { case MM_None: return ""; diff --git a/lib/CodeGen/MachineFunction.cpp b/lib/CodeGen/MachineFunction.cpp index dd306b8af78..7190fbd5642 100644 --- a/lib/CodeGen/MachineFunction.cpp +++ b/lib/CodeGen/MachineFunction.cpp @@ -544,7 +544,7 @@ MCSymbol *MachineFunction::getJTISymbol(unsigned JTI, MCContext &Ctx, assert(JumpTableInfo && "No jump tables"); assert(JTI < JumpTableInfo->getJumpTables().size() && "Invalid JTI!"); - const char *Prefix = isLinkerPrivate ? DL.getLinkerPrivateGlobalPrefix() + StringRef Prefix = isLinkerPrivate ? DL.getLinkerPrivateGlobalPrefix() : DL.getPrivateGlobalPrefix(); SmallString<60> Name; raw_svector_ostream(Name) diff --git a/lib/Target/ARM/ARMAsmPrinter.cpp b/lib/Target/ARM/ARMAsmPrinter.cpp index 27d2c4b356d..b73225ef1e8 100644 --- a/lib/Target/ARM/ARMAsmPrinter.cpp +++ b/lib/Target/ARM/ARMAsmPrinter.cpp @@ -939,7 +939,7 @@ void ARMAsmPrinter::emitAttributes() { //===----------------------------------------------------------------------===// -static MCSymbol *getPICLabel(const char *Prefix, unsigned FunctionNumber, +static MCSymbol *getPICLabel(StringRef Prefix, unsigned FunctionNumber, unsigned LabelId, MCContext &Ctx) { MCSymbol *Label = Ctx.getOrCreateSymbol(Twine(Prefix) -- 2.11.0