aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/Stmt.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2010-01-30 20:38:10 +0000
committerAnders Carlsson <andersca@mac.com>2010-01-30 20:38:10 +0000
commitacb6bcb442936f3c14126fdd473307c17647cb84 (patch)
tree75a46322032afb2fafd1419eb07ff8660093865d /lib/AST/Stmt.cpp
parenta5a79f7d16b48d3be8bcc8c7650e31aefd92b657 (diff)
Even more AsmStmt cleanup.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94921 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Stmt.cpp')
-rw-r--r--lib/AST/Stmt.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/lib/AST/Stmt.cpp b/lib/AST/Stmt.cpp
index 577b0ac560..5e4de1a178 100644
--- a/lib/AST/Stmt.cpp
+++ b/lib/AST/Stmt.cpp
@@ -132,9 +132,8 @@ Expr *AsmStmt::getOutputExpr(unsigned i) {
/// getOutputConstraint - Return the constraint string for the specified
/// output operand. All output constraints are known to be non-empty (either
/// '=' or '+').
-std::string AsmStmt::getOutputConstraint(unsigned i) const {
- return std::string(Constraints[i]->getStrData(),
- Constraints[i]->getByteLength());
+llvm::StringRef AsmStmt::getOutputConstraint(unsigned i) const {
+ return getOutputConstraintLiteral(i)->getString();
}
/// getNumPlusOperands - Return the number of output operands that have a "+"
@@ -153,13 +152,13 @@ Expr *AsmStmt::getInputExpr(unsigned i) {
/// getInputConstraint - Return the specified input constraint. Unlike output
/// constraints, these can be empty.
-std::string AsmStmt::getInputConstraint(unsigned i) const {
- return std::string(Constraints[i + NumOutputs]->getStrData(),
- Constraints[i + NumOutputs]->getByteLength());
+llvm::StringRef AsmStmt::getInputConstraint(unsigned i) const {
+ return getInputConstraintLiteral(i)->getString();
}
-void AsmStmt::setOutputsAndInputsAndClobbers(const std::string *Names,
+void AsmStmt::setOutputsAndInputsAndClobbers(ASTContext &C,
+ const std::string *Names,
StringLiteral **Constraints,
Stmt **Exprs,
unsigned NumOutputs,
@@ -183,7 +182,7 @@ void AsmStmt::setOutputsAndInputsAndClobbers(const std::string *Names,
/// getNamedOperand - Given a symbolic operand reference like %[foo],
/// translate this into a numeric value needed to reference the same operand.
/// This returns -1 if the operand name is invalid.
-int AsmStmt::getNamedOperand(const std::string &SymbolicName) const {
+int AsmStmt::getNamedOperand(llvm::StringRef SymbolicName) const {
unsigned NumPlusOperands = 0;
// Check if this is an output operand.
@@ -311,7 +310,7 @@ unsigned AsmStmt::AnalyzeAsmString(llvm::SmallVectorImpl<AsmStringPiece>&Pieces,
if (NameEnd == CurPtr)
return diag::err_asm_empty_symbolic_operand_name;
- std::string SymbolicName(CurPtr, NameEnd);
+ llvm::StringRef SymbolicName(CurPtr, NameEnd - CurPtr - 1);
int N = getNamedOperand(SymbolicName);
if (N == -1) {