clang  3.7.0
Classes | Public Member Functions | Static Public Member Functions | Friends | List of all members
clang::GCCAsmStmt Class Reference

#include <Stmt.h>

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

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. More...
 
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. More...
 
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
 
- Public Member Functions inherited from clang::AsmStmt
 AsmStmt (StmtClass SC, EmptyShell Empty)
 Build an empty inline-assembly statement. More...
 
SourceLocation getAsmLoc () const
 
void setAsmLoc (SourceLocation L)
 
bool isSimple () const
 
void setSimple (bool V)
 
bool isVolatile () const
 
void setVolatile (bool V)
 
SourceLocation getLocStart () const LLVM_READONLY
 
SourceLocation getLocEnd () const LLVM_READONLY
 
std::string generateAsmString (const ASTContext &C) const
 Assemble final IR asm string. More...
 
unsigned getNumOutputs () const
 
StringRef getOutputConstraint (unsigned i) const
 
bool isOutputPlusConstraint (unsigned i) const
 
const ExprgetOutputExpr (unsigned i) const
 
unsigned getNumPlusOperands () const
 
unsigned getNumInputs () const
 
StringRef getInputConstraint (unsigned i) const
 
const ExprgetInputExpr (unsigned i) const
 
unsigned getNumClobbers () const
 
StringRef getClobber (unsigned i) const
 
inputs_iterator begin_inputs ()
 
inputs_iterator end_inputs ()
 
inputs_range inputs ()
 
const_inputs_iterator begin_inputs () const
 
const_inputs_iterator end_inputs () const
 
inputs_const_range inputs () const
 
outputs_iterator begin_outputs ()
 
outputs_iterator end_outputs ()
 
outputs_range outputs ()
 
const_outputs_iterator begin_outputs () const
 
const_outputs_iterator end_outputs () const
 
outputs_const_range outputs () const
 
child_range children ()
 

Static Public Member Functions

static bool classof (const Stmt *T)
 
- Static Public Member Functions inherited from clang::AsmStmt
static bool classof (const Stmt *T)
 

Friends

class ASTStmtReader
 

Additional Inherited Members

- Public Types inherited from clang::AsmStmt
typedef ExprIterator inputs_iterator
 
typedef ConstExprIterator const_inputs_iterator
 
typedef llvm::iterator_range
< inputs_iterator
inputs_range
 
typedef llvm::iterator_range
< const_inputs_iterator
inputs_const_range
 
typedef ExprIterator outputs_iterator
 
typedef ConstExprIterator const_outputs_iterator
 
typedef llvm::iterator_range
< outputs_iterator
outputs_range
 
typedef llvm::iterator_range
< const_outputs_iterator
outputs_const_range
 
- Protected Member Functions inherited from clang::AsmStmt
 AsmStmt (StmtClass SC, SourceLocation asmloc, bool issimple, bool isvolatile, unsigned numoutputs, unsigned numinputs, unsigned numclobbers)
 
- Protected Attributes inherited from clang::AsmStmt
SourceLocation AsmLoc
 
bool IsSimple
 True if the assembly statement does not have any input or output operands. More...
 
bool IsVolatile
 If true, treat this inline assembly as having side effects. This assembly statement should not be optimized, deleted or moved. More...
 
unsigned NumOutputs
 
unsigned NumInputs
 
unsigned NumClobbers
 
Stmt ** Exprs
 

Detailed Description

This represents a GCC inline-assembly statement extension.

Definition at line 1550 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 688 of file Stmt.cpp.

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

clang::GCCAsmStmt::GCCAsmStmt ( EmptyShell  Empty)
inlineexplicit

Build an empty inline-assembly statement.

Definition at line 1569 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 473 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(), clang::Result, and SM.

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

static bool clang::GCCAsmStmt::classof ( const Stmt T)
inlinestatic

Definition at line 1722 of file Stmt.h.

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

Assemble final IR asm string.

Assemble final IR asm string (GCC-style).

Definition at line 641 of file Stmt.cpp.

References AnalyzeAsmString().

const StringLiteral* clang::GCCAsmStmt::getAsmString ( ) const
inline

Definition at line 1577 of file Stmt.h.

Referenced by AnalyzeAsmString().

StringLiteral* clang::GCCAsmStmt::getAsmString ( )
inline

Definition at line 1578 of file Stmt.h.

StringRef GCCAsmStmt::getClobber ( unsigned  i) const

Definition at line 391 of file Stmt.cpp.

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

StringLiteral* clang::GCCAsmStmt::getClobberStringLiteral ( unsigned  i)
inline

Definition at line 1714 of file Stmt.h.

Referenced by getClobber().

const StringLiteral* clang::GCCAsmStmt::getClobberStringLiteral ( unsigned  i) const
inline

Definition at line 1715 of file Stmt.h.

StringRef GCCAsmStmt::getInputConstraint ( unsigned  i) const

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

Definition at line 415 of file Stmt.cpp.

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

const StringLiteral* clang::GCCAsmStmt::getInputConstraintLiteral ( unsigned  i) const
inline

Definition at line 1681 of file Stmt.h.

Referenced by getInputConstraint().

StringLiteral* clang::GCCAsmStmt::getInputConstraintLiteral ( unsigned  i)
inline

Definition at line 1684 of file Stmt.h.

Expr * GCCAsmStmt::getInputExpr ( unsigned  i)

Definition at line 406 of file Stmt.cpp.

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

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

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

Definition at line 1691 of file Stmt.h.

IdentifierInfo* clang::GCCAsmStmt::getInputIdentifier ( unsigned  i) const
inline

Definition at line 1668 of file Stmt.h.

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

Definition at line 1672 of file Stmt.h.

Referenced by getNamedOperand().

SourceLocation clang::GCCAsmStmt::getLocEnd ( ) const
inline

Definition at line 1720 of file Stmt.h.

SourceLocation clang::GCCAsmStmt::getLocStart ( ) const
inline

Definition at line 1719 of file Stmt.h.

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 453 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 '+').

Definition at line 402 of file Stmt.cpp.

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

const StringLiteral* clang::GCCAsmStmt::getOutputConstraintLiteral ( unsigned  i) const
inline

Definition at line 1653 of file Stmt.h.

Referenced by getOutputConstraint().

StringLiteral* clang::GCCAsmStmt::getOutputConstraintLiteral ( unsigned  i)
inline

Definition at line 1656 of file Stmt.h.

Expr * GCCAsmStmt::getOutputExpr ( unsigned  i)

Definition at line 395 of file Stmt.cpp.

References clang::AsmStmt::Exprs.

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

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

Definition at line 1662 of file Stmt.h.

IdentifierInfo* clang::GCCAsmStmt::getOutputIdentifier ( unsigned  i) const
inline

Definition at line 1640 of file Stmt.h.

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

Definition at line 1644 of file Stmt.h.

Referenced by getNamedOperand().

SourceLocation clang::GCCAsmStmt::getRParenLoc ( ) const
inline

Definition at line 1572 of file Stmt.h.

void clang::GCCAsmStmt::setAsmString ( StringLiteral E)
inline

Definition at line 1579 of file Stmt.h.

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

Definition at line 409 of file Stmt.cpp.

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

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

void clang::GCCAsmStmt::setRParenLoc ( SourceLocation  L)
inline

Definition at line 1573 of file Stmt.h.

Friends And Related Function Documentation

friend class ASTStmtReader
friend

Definition at line 1559 of file Stmt.h.


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