Rewrite all Property related functions in terms of StringRef.

This was a bit tricky, especially for things like
OptionValueArray and OptionValueDictionary since they do some
funky string parsing.  Rather than try to re-write line-by-line
I tried to make the StringRef usage idiomatic, even though
it meant often re-writing from scratch large blocks of code
in a different way while keeping true to the original intent.

The finished code is a big improvement though, and often much
shorter than the original code.  All tests and unit tests
pass on Windows and Linux.

llvm-svn: 287242
This commit is contained in:
Zachary Turner
2016-11-17 18:08:12 +00:00
parent ff0382c161
commit 31d97a5c8a
24 changed files with 271 additions and 347 deletions

View File

@@ -1321,9 +1321,8 @@ void PseudoInstruction::SetOpcode(size_t opcode_size, void *opcode_data) {
}
}
void PseudoInstruction::SetDescription(const char *description) {
if (description && strlen(description) > 0)
m_description = description;
void PseudoInstruction::SetDescription(llvm::StringRef description) {
m_description = description;
}
Instruction::Operand Instruction::Operand::BuildRegister(ConstString &r) {