git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147501
91177308-0d34-0410-b5e6-
96231b3b80d8
class LLVMContextImpl;
class StringRef;
class LLVMContextImpl;
class StringRef;
class Instruction;
class Module;
class SMDiagnostic;
class Instruction;
class Module;
class SMDiagnostic;
/// be prepared to drop the erroneous construct on the floor and "not crash".
/// The generated code need not be correct. The error message will be
/// implicitly prefixed with "error: " and should not end with a ".".
/// be prepared to drop the erroneous construct on the floor and "not crash".
/// The generated code need not be correct. The error message will be
/// implicitly prefixed with "error: " and should not end with a ".".
- void emitError(unsigned LocCookie, StringRef ErrorStr);
- void emitError(const Instruction *I, StringRef ErrorStr);
- void emitError(StringRef ErrorStr);
+ void emitError(unsigned LocCookie, const Twine &ErrorStr);
+ void emitError(const Instruction *I, const Twine &ErrorStr);
+ void emitError(const Twine &ErrorStr);
private:
// DO NOT IMPLEMENT
private:
// DO NOT IMPLEMENT
return pImpl->InlineAsmDiagContext;
}
return pImpl->InlineAsmDiagContext;
}
-void LLVMContext::emitError(StringRef ErrorStr) {
+void LLVMContext::emitError(const Twine &ErrorStr) {
emitError(0U, ErrorStr);
}
emitError(0U, ErrorStr);
}
-void LLVMContext::emitError(const Instruction *I, StringRef ErrorStr) {
+void LLVMContext::emitError(const Instruction *I, const Twine &ErrorStr) {
unsigned LocCookie = 0;
if (const MDNode *SrcLoc = I->getMetadata("srcloc")) {
if (SrcLoc->getNumOperands() != 0)
unsigned LocCookie = 0;
if (const MDNode *SrcLoc = I->getMetadata("srcloc")) {
if (SrcLoc->getNumOperands() != 0)
return emitError(LocCookie, ErrorStr);
}
return emitError(LocCookie, ErrorStr);
}
-void LLVMContext::emitError(unsigned LocCookie, StringRef ErrorStr) {
+void LLVMContext::emitError(unsigned LocCookie, const Twine &ErrorStr) {
// If there is no error handler installed, just print the error and exit.
if (pImpl->InlineAsmDiagHandler == 0) {
errs() << "error: " << ErrorStr << "\n";
// If there is no error handler installed, just print the error and exit.
if (pImpl->InlineAsmDiagHandler == 0) {
errs() << "error: " << ErrorStr << "\n";