mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
StringMap<DIE*>::iterator::first() returns a pointer to the first character of
the key. This will cause it to create a new std::string, which isn't wanted. Instead, pass back the "const char*". Modify the EmitString() method to take a "const char*". git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68741 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -727,13 +727,17 @@ static void printStringChar(raw_ostream &O, unsigned char C) {
|
||||
/// Special characters are emitted properly.
|
||||
/// \literal (Eg. '\t') \endliteral
|
||||
void AsmPrinter::EmitString(const std::string &String) const {
|
||||
EmitString(String.c_str(), String.size());
|
||||
}
|
||||
|
||||
void AsmPrinter::EmitString(const char *String, unsigned Size) const {
|
||||
const char* AscizDirective = TAI->getAscizDirective();
|
||||
if (AscizDirective)
|
||||
O << AscizDirective;
|
||||
else
|
||||
O << TAI->getAsciiDirective();
|
||||
O << '\"';
|
||||
for (unsigned i = 0, N = String.size(); i < N; ++i)
|
||||
for (unsigned i = 0; i < Size; ++i)
|
||||
printStringChar(O, String[i]);
|
||||
if (AscizDirective)
|
||||
O << '\"';
|
||||
|
Reference in New Issue
Block a user