diff options
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Support/TargetRegistry.cpp | 12 | ||||
| -rw-r--r-- | llvm/lib/Target/TargetMachineC.cpp | 4 |
2 files changed, 8 insertions, 8 deletions
diff --git a/llvm/lib/Support/TargetRegistry.cpp b/llvm/lib/Support/TargetRegistry.cpp index bed9ed64f80..1b8ad3a0103 100644 --- a/llvm/lib/Support/TargetRegistry.cpp +++ b/llvm/lib/Support/TargetRegistry.cpp @@ -78,8 +78,8 @@ const Target *TargetRegistry::lookupTarget(const std::string &TT, auto J = std::find_if(std::next(I), targets().end(), ArchMatch); if (J != targets().end()) { - Error = std::string("Cannot choose between targets \"") + I->Name + - "\" and \"" + J->Name + "\""; + Error = ("Cannot choose between targets \"" + I->Name + + "\" a nd \"" + J->Name + "\"").str(); return nullptr; } @@ -87,16 +87,16 @@ const Target *TargetRegistry::lookupTarget(const std::string &TT, } void TargetRegistry::RegisterTarget(Target &T, - const char *Name, - const char *ShortDesc, + StringRef Name, + StringRef ShortDesc, Target::ArchMatchFnTy ArchMatchFn, bool HasJIT) { - assert(Name && ShortDesc && ArchMatchFn && + assert(!Name.empty() && !ShortDesc.empty() && ArchMatchFn && "Missing required target information!"); // Check if this target has already been initialized, we allow this as a // convenience to some clients. - if (T.Name) + if (!T.Name.empty()) return; // Add to the list of targets. diff --git a/llvm/lib/Target/TargetMachineC.cpp b/llvm/lib/Target/TargetMachineC.cpp index 5fb5b022780..b20012fba32 100644 --- a/llvm/lib/Target/TargetMachineC.cpp +++ b/llvm/lib/Target/TargetMachineC.cpp @@ -81,11 +81,11 @@ LLVMBool LLVMGetTargetFromTriple(const char* TripleStr, LLVMTargetRef *T, } const char * LLVMGetTargetName(LLVMTargetRef T) { - return unwrap(T)->getName(); + return unwrap(T)->getName().data(); } const char * LLVMGetTargetDescription(LLVMTargetRef T) { - return unwrap(T)->getShortDescription(); + return unwrap(T)->getShortDescription().data(); } LLVMBool LLVMTargetHasJIT(LLVMTargetRef T) { |

