StringRef-ize the TargetInfo::ConstraintInfo constructor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94916 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Anders Carlsson 2010-01-30 18:33:31 +00:00
Родитель c076c450e4
Коммит f959fb5fb8
3 изменённых файлов: 7 добавлений и 11 удалений

Просмотреть файл

@ -246,10 +246,9 @@ public:
std::string ConstraintStr; // constraint: "=rm"
std::string Name; // Operand name: [foo] with no []'s.
public:
ConstraintInfo(const char *str, unsigned strlen, const std::string &name)
: Flags(0), TiedOperand(-1), ConstraintStr(str, str+strlen), Name(name) {}
explicit ConstraintInfo(const std::string &Str, const std::string &name)
: Flags(0), TiedOperand(-1), ConstraintStr(Str), Name(name) {}
ConstraintInfo(llvm::StringRef ConstraintStr, llvm::StringRef Name)
: Flags(0), TiedOperand(-1), ConstraintStr(ConstraintStr.str()),
Name(Name.str()) {}
const std::string &getConstraintStr() const { return ConstraintStr; }
const std::string &getName() const { return Name; }
@ -343,7 +342,7 @@ public:
/// and give good diagnostics in cases when the assembler or code generator
/// would otherwise reject the section specifier.
///
virtual std::string isValidSectionSpecifier(const llvm::StringRef &SR) const {
virtual std::string isValidSectionSpecifier(llvm::StringRef SR) const {
return "";
}

Просмотреть файл

@ -157,7 +157,7 @@ public:
return "__TEXT,__ustring";
}
virtual std::string isValidSectionSpecifier(const llvm::StringRef &SR) const {
virtual std::string isValidSectionSpecifier(llvm::StringRef SR) const {
// Let MCSectionMachO validate this.
llvm::StringRef Segment, Section;
unsigned TAA, StubSize;

Просмотреть файл

@ -1197,8 +1197,7 @@ Sema::OwningStmtResult Sema::ActOnAsmStmt(SourceLocation AsmLoc,
return StmtError(Diag(Literal->getLocStart(),diag::err_asm_wide_character)
<< Literal->getSourceRange());
TargetInfo::ConstraintInfo Info(Literal->getStrData(),
Literal->getByteLength(),
TargetInfo::ConstraintInfo Info(Literal->getString(),
Names[i]);
if (!Context.Target.validateOutputConstraint(Info))
return StmtError(Diag(Literal->getLocStart(),
@ -1224,9 +1223,7 @@ Sema::OwningStmtResult Sema::ActOnAsmStmt(SourceLocation AsmLoc,
return StmtError(Diag(Literal->getLocStart(),diag::err_asm_wide_character)
<< Literal->getSourceRange());
TargetInfo::ConstraintInfo Info(Literal->getStrData(),
Literal->getByteLength(),
Names[i]);
TargetInfo::ConstraintInfo Info(Literal->getString(), Names[i]);
if (!Context.Target.validateInputConstraint(OutputConstraintInfos.data(),
NumOutputs, Info)) {
return StmtError(Diag(Literal->getLocStart(),