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

This represents a GCC inline-assembly statement extension. More...

#include <Stmt.h>

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

Classes

class  AsmStringPiece
 AsmStringPiece - this is part of a decomposed asm string specification (for use with the AnalyzeAsmString function below). More...
 

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
 AnalyzeAsmString - Analyze the asm string of the current asm, decomposing it into pieces. More...
 
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
 getOutputConstraint - Return the constraint string for the specified output operand. More...
 
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
 getInputConstraint - Return the specified input constraint. More...
 
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
 getNamedOperand - Given a symbolic operand reference like %[foo], translate this into a numeric value needed to reference the same operand. More...
 
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
 getOutputConstraint - Return the constraint string for the specified output operand. More...
 
bool isOutputPlusConstraint (unsigned i) const
 isOutputPlusConstraint - Return true if the specified output constraint is a "+" constraint (which is both an input and an output) or false if it is an "=" constraint (just an output). More...
 
const ExprgetOutputExpr (unsigned i) const
 
unsigned getNumPlusOperands () const
 getNumPlusOperands - Return the number of output operands that have a "+" constraint. More...
 
unsigned getNumInputs () const
 
StringRef getInputConstraint (unsigned i) const
 getInputConstraint - Return the specified input constraint. More...
 
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. More...
 
unsigned NumOutputs
 
unsigned NumInputs
 
unsigned NumClobbers
 
Stmt ** Exprs
 

Detailed Description

This represents a GCC inline-assembly statement extension.

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

References clang::AsmStmt::NumInputs.

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

Build an empty inline-assembly statement.

Definition at line 1584 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

If the asm string is erroneous, emit errors and return true, otherwise return false.

Definition at line 475 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 1737 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 650 of file Stmt.cpp.

References AnalyzeAsmString(), and clang::getModifier().

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

Definition at line 1592 of file Stmt.h.

Referenced by AnalyzeAsmString(), and clang::ASTNodeImporter::VisitGCCAsmStmt().

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

Definition at line 1593 of file Stmt.h.

StringRef GCCAsmStmt::getClobber ( unsigned  i) const

Definition at line 393 of file Stmt.cpp.

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

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

Definition at line 1729 of file Stmt.h.

Referenced by getClobber(), and clang::ASTNodeImporter::VisitGCCAsmStmt().

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

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

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

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

Definition at line 1696 of file Stmt.h.

Referenced by getInputConstraint(), and clang::ASTNodeImporter::VisitGCCAsmStmt().

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

Definition at line 1699 of file Stmt.h.

Expr * GCCAsmStmt::getInputExpr ( unsigned  i)

Definition at line 408 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 1706 of file Stmt.h.

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

Definition at line 1683 of file Stmt.h.

References clang::ast_matchers::internal::Names().

Referenced by clang::ASTNodeImporter::VisitGCCAsmStmt().

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

Definition at line 1687 of file Stmt.h.

Referenced by getNamedOperand().

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

Definition at line 1735 of file Stmt.h.

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

Definition at line 1734 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 455 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 404 of file Stmt.cpp.

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

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

Definition at line 1668 of file Stmt.h.

Referenced by getOutputConstraint(), and clang::ASTNodeImporter::VisitGCCAsmStmt().

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

Definition at line 1671 of file Stmt.h.

Expr * GCCAsmStmt::getOutputExpr ( unsigned  i)

Definition at line 397 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 1677 of file Stmt.h.

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

Definition at line 1655 of file Stmt.h.

References clang::ast_matchers::internal::Names().

Referenced by clang::ASTNodeImporter::VisitGCCAsmStmt().

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

Definition at line 1659 of file Stmt.h.

Referenced by getNamedOperand().

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

Definition at line 1587 of file Stmt.h.

Referenced by clang::ASTNodeImporter::VisitGCCAsmStmt().

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

Definition at line 1594 of file Stmt.h.

References E.

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

Definition at line 411 of file Stmt.cpp.

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

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

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

Definition at line 1588 of file Stmt.h.

Friends And Related Function Documentation

friend class ASTStmtReader
friend

Definition at line 1574 of file Stmt.h.


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