diff options
| author | Mehdi Amini <mehdi.amini@apple.com> | 2016-10-01 07:08:23 +0000 |
|---|---|---|
| committer | Mehdi Amini <mehdi.amini@apple.com> | 2016-10-01 07:08:23 +0000 |
| commit | 9af9a9d5f93b617a8d3c7ce75812acf6386d6051 (patch) | |
| tree | 321e657b44742b8cb9e057372764184379288a35 /llvm/lib/Support | |
| parent | 36d33fc1098a2377bf6b5a20e98351c06db0cfe1 (diff) | |
| download | bcm5719-llvm-9af9a9d5f93b617a8d3c7ce75812acf6386d6051.tar.gz bcm5719-llvm-9af9a9d5f93b617a8d3c7ce75812acf6386d6051.zip | |
Revert "Use StringRef instead of raw pointer in TargetRegistry API (NFC)"
This reverts commit r283017. Creates an infinite loop somehow.
llvm-svn: 283019
Diffstat (limited to 'llvm/lib/Support')
| -rw-r--r-- | llvm/lib/Support/TargetRegistry.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/lib/Support/TargetRegistry.cpp b/llvm/lib/Support/TargetRegistry.cpp index 1b8ad3a0103..bed9ed64f80 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 = ("Cannot choose between targets \"" + I->Name + - "\" a nd \"" + J->Name + "\"").str(); + Error = std::string("Cannot choose between targets \"") + I->Name + + "\" and \"" + J->Name + "\""; return nullptr; } @@ -87,16 +87,16 @@ const Target *TargetRegistry::lookupTarget(const std::string &TT, } void TargetRegistry::RegisterTarget(Target &T, - StringRef Name, - StringRef ShortDesc, + const char *Name, + const char *ShortDesc, Target::ArchMatchFnTy ArchMatchFn, bool HasJIT) { - assert(!Name.empty() && !ShortDesc.empty() && ArchMatchFn && + assert(Name && ShortDesc && 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.empty()) + if (T.Name) return; // Add to the list of targets. |

