tools/llvm-dis-xml/lib/ASMXMLWriter/AsmXMLWriter.cc
void AsmXMLWriter::printLLVMName(StringRef Name, PrefixType Prefix) {
  assert(!Name.empty() && "Cannot get empty name!");
  Out << "<Name>";

  std::string name;
  switch (Prefix) {
  default: llvm_unreachable("Bad prefix!");
  case NoPrefix:     break;
  case GlobalPrefix: name += "@"; break;
  case LabelPrefix:  break;
  case LocalPrefix:  name += "%"; break;
  }
  name += Name.str();

  RawWriter::write(name, Out);
  Out << "</Name>\n";
}
/// printLLVMName - Turn the specified name into an 'LLVM name', which is either
/// prefixed with % (if the string only contains simple characters) or is
/// surrounded with ""'s (if it has special chars in it).  Print it out.
// TODO could be improved to use printNumberAsName
Turn the specified name into an 'LLVM name', which is either
prefixed with % (if the string only contains simple characters) or is
surrounded with ""'s (if it has special chars in it).  Print it out.
TODO could be improved to use printNumberAsName
Turn the specified name into an ' LLVM name ' which is either prefixed with % ( if the string only contains simple characters ) or is surrounded with " " ' s ( if it has special chars in it ) . Print it out . TODO could be improved to use printNumberAsName
void AsmXMLWriter::printLLVMName(StringRef Name, PrefixType Prefix) {
  assert(!Name.empty() && "Cannot get empty name!");
  Out << "<Name>";
  std::string name;
  switch (Prefix) {
  default: llvm_unreachable("Bad prefix!");
  case NoPrefix:     break;
  case GlobalPrefix: name += "@"; break;
  case LabelPrefix:  break;
  case LocalPrefix:  name += "%"; break;
  }
  name += Name.str();
  RawWriter::write(name, Out);
  Out << "</Name>\n";
}
void AsmXMLWriter :: printLLVMName ( StringRef Name , PrefixType Prefix ) { assert ( ! Name . empty ( ) && " " ) ; Out << " " ; std :: string name ; switch ( Prefix ) { default : llvm_unreachable ( " " ) ; case NoPrefix : break ; case GlobalPrefix : name += " " ; break ; case LabelPrefix : break ; case LocalPrefix : name += " " ; break ; } name += Name . str ( ) ; RawWriter :: write ( name , Out ) ; Out << " \n " ; }
printLLVMName - Turn the specified name into an 'LLVM name', which is either
prefixed with % (if the string only contains simple characters) or is
surrounded with ""'s (if it has special chars in it).
printLLVMName - Turn the specified name into an ' LLVM name ' which is either prefixed with % ( if the string only contains simple characters ) or is surrounded with " " ' s ( if it has special chars in it ) .