clang API Documentation

Classes | Public Member Functions | Static Public Member Functions | Friends
clang::GCCAsmStmt Class Reference

#include <Stmt.h>

Inheritance diagram for clang::GCCAsmStmt:
Inheritance graph
[legend]
Collaboration diagram for clang::GCCAsmStmt:
Collaboration graph
[legend]

List of all members.

Classes

class  AsmStringPiece

Public Member Functions

 GCCAsmStmt (const ASTContext &C, SourceLocation asmloc, bool issimple, bool isvolatile, unsigned numoutputs, unsigned numinputs, IdentifierInfo **names, StringLiteral **constraints, Expr **exprs, StringLiteral *asmstr, unsigned numclobbers, StringLiteral **clobbers, SourceLocation rparenloc)
 GCCAsmStmt (EmptyShell Empty)
 Build an empty inline-assembly statement.
SourceLocation getRParenLoc () const
void setRParenLoc (SourceLocation L)
const StringLiteralgetAsmString () const
StringLiteralgetAsmString ()
void setAsmString (StringLiteral *E)
unsigned AnalyzeAsmString (SmallVectorImpl< AsmStringPiece > &Pieces, const ASTContext &C, unsigned &DiagOffs) const
std::string generateAsmString (const ASTContext &C) const
 Assemble final IR asm string.
IdentifierInfogetOutputIdentifier (unsigned i) const
StringRef getOutputName (unsigned i) const
StringRef getOutputConstraint (unsigned i) const
const StringLiteralgetOutputConstraintLiteral (unsigned i) const
StringLiteralgetOutputConstraintLiteral (unsigned i)
ExprgetOutputExpr (unsigned i)
const ExprgetOutputExpr (unsigned i) const
IdentifierInfogetInputIdentifier (unsigned i) const
StringRef getInputName (unsigned i) const
StringRef getInputConstraint (unsigned i) const
const StringLiteralgetInputConstraintLiteral (unsigned i) const
StringLiteralgetInputConstraintLiteral (unsigned i)
ExprgetInputExpr (unsigned i)
void setInputExpr (unsigned i, Expr *E)
const ExprgetInputExpr (unsigned i) const
int getNamedOperand (StringRef SymbolicName) const
StringRef getClobber (unsigned i) const
StringLiteralgetClobberStringLiteral (unsigned i)
const StringLiteralgetClobberStringLiteral (unsigned i) const
SourceLocation getLocStart () const LLVM_READONLY
SourceLocation getLocEnd () const LLVM_READONLY

Static Public Member Functions

static bool classof (const Stmt *T)

Friends

class ASTStmtReader

Detailed Description

This represents a GCC inline-assembly statement extension.

Definition at line 1544 of file Stmt.h.


Constructor & Destructor Documentation

GCCAsmStmt::GCCAsmStmt ( const ASTContext C,
SourceLocation  asmloc,
bool  issimple,
bool  isvolatile,
unsigned  numoutputs,
unsigned  numinputs,
IdentifierInfo **  names,
StringLiteral **  constraints,
Expr **  exprs,
StringLiteral asmstr,
unsigned  numclobbers,
StringLiteral **  clobbers,
SourceLocation  rparenloc 
)

Definition at line 682 of file Stmt.cpp.

References AttributeLangSupport::C, and clang::AsmStmt::NumInputs.

clang::GCCAsmStmt::GCCAsmStmt ( EmptyShell  Empty) [inline, explicit]

Build an empty inline-assembly statement.

Definition at line 1563 of file Stmt.h.


Member Function Documentation

unsigned GCCAsmStmt::AnalyzeAsmString ( SmallVectorImpl< AsmStringPiece > &  Pieces,
const ASTContext C,
unsigned DiagOffs 
) const

AnalyzeAsmString - Analyze the asm string of the current asm, decomposing it into pieces. If the asm string is erroneous, emit errors and return true, otherwise return false. This handles canonicalization and translation of strings from GCC syntax to LLVM IR syntax, and handles

AnalyzeAsmString - Analyze the asm string of the current asm, decomposing it into pieces. If the asm string is erroneous, emit errors and return true, otherwise return false.

Definition at line 467 of file Stmt.cpp.

References getAsmString(), clang::ASTContext::getLangOpts(), clang::StringLiteral::getLocationOfByte(), getNamedOperand(), clang::AsmStmt::getNumInputs(), clang::AsmStmt::getNumOutputs(), clang::AsmStmt::getNumPlusOperands(), clang::ASTContext::getSourceManager(), clang::StringLiteral::getString(), clang::ASTContext::getTargetInfo(), clang::TargetInfo::hasNoAsmVariants(), clang::isDigit(), clang::isLetter(), clang::AsmStmt::isSimple(), and SM.

Referenced by clang::Sema::ActOnGCCAsmStmt(), and generateAsmString().

static bool clang::GCCAsmStmt::classof ( const Stmt T) [inline, static]

Reimplemented from clang::AsmStmt.

Definition at line 1716 of file Stmt.h.

References clang::Stmt::getStmtClass().

std::string GCCAsmStmt::generateAsmString ( const ASTContext C) const

Assemble final IR asm string.

Assemble final IR asm string (GCC-style).

Reimplemented from clang::AsmStmt.

Definition at line 635 of file Stmt.cpp.

References AnalyzeAsmString().

Definition at line 1571 of file Stmt.h.

Referenced by AnalyzeAsmString().

Definition at line 1572 of file Stmt.h.

StringRef GCCAsmStmt::getClobber ( unsigned  i) const

Reimplemented from clang::AsmStmt.

Definition at line 385 of file Stmt.cpp.

References getClobberStringLiteral(), and clang::StringLiteral::getString().

Definition at line 1708 of file Stmt.h.

Referenced by getClobber().

Definition at line 1709 of file Stmt.h.

StringRef GCCAsmStmt::getInputConstraint ( unsigned  i) const

getInputConstraint - Return the specified input constraint. Unlike output constraints, these can be empty.

Reimplemented from clang::AsmStmt.

Definition at line 409 of file Stmt.cpp.

References getInputConstraintLiteral(), and clang::StringLiteral::getString().

Definition at line 1675 of file Stmt.h.

References clang::AsmStmt::NumOutputs.

Referenced by getInputConstraint().

Definition at line 1678 of file Stmt.h.

References clang::AsmStmt::NumOutputs.

Definition at line 400 of file Stmt.cpp.

References clang::AsmStmt::Exprs, and clang::AsmStmt::NumOutputs.

Referenced by getInputExpr().

const Expr* clang::GCCAsmStmt::getInputExpr ( unsigned  i) const [inline]

Reimplemented from clang::AsmStmt.

Definition at line 1685 of file Stmt.h.

References getInputExpr().

Definition at line 1662 of file Stmt.h.

References clang::AsmStmt::NumOutputs.

Referenced by getInputName().

StringRef clang::GCCAsmStmt::getInputName ( unsigned  i) const [inline]

Definition at line 1666 of file Stmt.h.

References getInputIdentifier().

Referenced by getNamedOperand().

Reimplemented from clang::AsmStmt.

Definition at line 1714 of file Stmt.h.

Reimplemented from clang::AsmStmt.

Definition at line 1713 of file Stmt.h.

References clang::AsmStmt::AsmLoc.

int GCCAsmStmt::getNamedOperand ( StringRef  SymbolicName) const

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.

Definition at line 447 of file Stmt.cpp.

References getInputName(), clang::AsmStmt::getNumInputs(), clang::AsmStmt::getNumOutputs(), and getOutputName().

Referenced by AnalyzeAsmString().

StringRef GCCAsmStmt::getOutputConstraint ( unsigned  i) const

getOutputConstraint - Return the constraint string for the specified output operand. All output constraints are known to be non-empty (either '=' or '+').

Reimplemented from clang::AsmStmt.

Definition at line 396 of file Stmt.cpp.

References getOutputConstraintLiteral(), and clang::StringLiteral::getString().

Definition at line 1647 of file Stmt.h.

Referenced by getOutputConstraint().

Definition at line 1650 of file Stmt.h.

Definition at line 389 of file Stmt.cpp.

References clang::AsmStmt::Exprs.

Referenced by getOutputExpr().

const Expr* clang::GCCAsmStmt::getOutputExpr ( unsigned  i) const [inline]

Reimplemented from clang::AsmStmt.

Definition at line 1656 of file Stmt.h.

References getOutputExpr().

Definition at line 1634 of file Stmt.h.

Referenced by getOutputName().

StringRef clang::GCCAsmStmt::getOutputName ( unsigned  i) const [inline]

Definition at line 1638 of file Stmt.h.

References getOutputIdentifier().

Referenced by getNamedOperand().

Definition at line 1566 of file Stmt.h.

Definition at line 1573 of file Stmt.h.

void GCCAsmStmt::setInputExpr ( unsigned  i,
Expr E 
)

Definition at line 403 of file Stmt.cpp.

References clang::AsmStmt::Exprs, and clang::AsmStmt::NumOutputs.

Referenced by clang::Sema::ActOnGCCAsmStmt().

Definition at line 1567 of file Stmt.h.


Friends And Related Function Documentation

friend class ASTStmtReader [friend]

Reimplemented from clang::AsmStmt.

Definition at line 1553 of file Stmt.h.


The documentation for this class was generated from the following files: