mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-02 08:46:37 +00:00
Remove Value::setName(const char*, unsigned).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77100 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
d1319ef308
commit
3f53fa9a51
@ -128,8 +128,11 @@ public:
|
||||
StringRef getName() const { return StringRef(getNameStart(), getNameLen()); }
|
||||
std::string getNameStr() const;
|
||||
|
||||
/// setName() - Change the name of the value, choosing a new unique name if
|
||||
/// the provided name is taken.
|
||||
///
|
||||
/// \arg Name - The new name; or "" if the value's name should be removed.
|
||||
void setName(const Twine &Name);
|
||||
void setName(const char *Name, unsigned NameLen);
|
||||
|
||||
|
||||
/// takeName - transfer the name from V to this value, setting V's name to
|
||||
|
@ -680,7 +680,7 @@ bool BitcodeReader::ParseValueSymbolTable() {
|
||||
return Error("Invalid Value ID in VST_ENTRY record");
|
||||
Value *V = ValueList[ValueID];
|
||||
|
||||
V->setName(&ValueName[0], ValueName.size());
|
||||
V->setName(StringRef(ValueName.data(), ValueName.size()));
|
||||
ValueName.clear();
|
||||
break;
|
||||
}
|
||||
@ -691,7 +691,7 @@ bool BitcodeReader::ParseValueSymbolTable() {
|
||||
if (BB == 0)
|
||||
return Error("Invalid BB ID in VST_BBENTRY record");
|
||||
|
||||
BB->setName(&ValueName[0], ValueName.size());
|
||||
BB->setName(StringRef(ValueName.data(), ValueName.size()));
|
||||
ValueName.clear();
|
||||
break;
|
||||
}
|
||||
|
@ -170,13 +170,13 @@ std::string Value::getNameStr() const {
|
||||
return getName().str();
|
||||
}
|
||||
|
||||
void Value::setName(const Twine &Name) {
|
||||
void Value::setName(const Twine &NewName) {
|
||||
SmallString<32> NameData;
|
||||
Name.toVector(NameData);
|
||||
setName(NameData.begin(), NameData.size());
|
||||
}
|
||||
NewName.toVector(NameData);
|
||||
|
||||
const char *NameStr = NameData.data();
|
||||
unsigned NameLen = NameData.size();
|
||||
|
||||
void Value::setName(const char *NameStr, unsigned NameLen) {
|
||||
if (NameLen == 0 && !hasName()) return;
|
||||
assert(getType() != Type::VoidTy && "Cannot assign a name to void values!");
|
||||
|
||||
@ -242,7 +242,7 @@ void Value::takeName(Value *V) {
|
||||
if (getSymTab(this, ST)) {
|
||||
// We can't set a name on this value, but we need to clear V's name if
|
||||
// it has one.
|
||||
if (V->hasName()) V->setName(0, 0);
|
||||
if (V->hasName()) V->setName("");
|
||||
return; // Cannot set a name on this value (e.g. constant).
|
||||
}
|
||||
|
||||
@ -262,7 +262,7 @@ void Value::takeName(Value *V) {
|
||||
if (!ST) {
|
||||
if (getSymTab(this, ST)) {
|
||||
// Clear V's name.
|
||||
V->setName(0, 0);
|
||||
V->setName("");
|
||||
return; // Cannot set a name on this value (e.g. constant).
|
||||
}
|
||||
}
|
||||
|
@ -269,8 +269,8 @@ llvm::SplitFunctionsOutOfModule(Module *M,
|
||||
I->setLinkage(GlobalValue::ExternalLinkage);
|
||||
for (Module::global_iterator I = M->global_begin(), E = M->global_end();
|
||||
I != E; ++I) {
|
||||
if (I->hasName() && *I->getNameStart() == '\01')
|
||||
I->setName(I->getNameStart()+1, I->getNameLen()-1);
|
||||
if (I->hasName() && I->getName()[0] == '\01')
|
||||
I->setName(I->getName().substr(1));
|
||||
I->setLinkage(GlobalValue::ExternalLinkage);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user