#include <string>
namespace llvm {
-class StringRef;
+class Twine;
class Type;
class Module;
class Value;
/// does this for you, so there's no point calling it on the result
/// from getValueName.
///
- std::string makeNameProper(StringRef x,
+ std::string makeNameProper(const Twine &Name,
ManglerPrefixTy PrefixTy = Mangler::Default);
/// getNameWithPrefix - Fill OutName with the name of the appropriate prefix
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringMap.h"
-#include "llvm/ADT/SmallVector.h"
+#include "llvm/ADT/SmallString.h"
#include "llvm/Support/raw_ostream.h"
using namespace llvm;
/// makeNameProper - We don't want identifier names non-C-identifier characters
/// in them, so mangle them as appropriate.
///
-std::string Mangler::makeNameProper(StringRef X,
+std::string Mangler::makeNameProper(const Twine &TheName,
ManglerPrefixTy PrefixTy) {
+ SmallString<256> TmpData;
+ TheName.toVector(TmpData);
+ StringRef X = TmpData.str();
assert(!X.empty() && "Cannot mangle empty strings");
if (!UseQuotes) {