clang  8.0.0svn
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
clang::AsmStmt Class Reference

AsmStmt is the base class for GCCAsmStmt and MSAsmStmt. More...

#include "clang/AST/Stmt.h"

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

Public Types

using inputs_iterator = ExprIterator
 
using const_inputs_iterator = ConstExprIterator
 
using inputs_range = llvm::iterator_range< inputs_iterator >
 
using inputs_const_range = llvm::iterator_range< const_inputs_iterator >
 
using outputs_iterator = ExprIterator
 
using const_outputs_iterator = ConstExprIterator
 
using outputs_range = llvm::iterator_range< outputs_iterator >
 
using outputs_const_range = llvm::iterator_range< const_outputs_iterator >
 
- Public Types inherited from clang::Stmt
enum  StmtClass { NoStmtClass = 0 }
 
using child_iterator = StmtIterator
 Child Iterators: All subclasses must implement 'children' to permit easy iteration over the substatements/subexpessions of an AST node. More...
 
using const_child_iterator = ConstStmtIterator
 
using child_range = llvm::iterator_range< child_iterator >
 
using const_child_range = llvm::iterator_range< const_child_iterator >
 

Public Member Functions

 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 getBeginLoc () const LLVM_READONLY
 
SourceLocation getEndLoc () 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 ()
 
- Public Member Functions inherited from clang::Stmt
void * operator new (size_t bytes, const ASTContext &C, unsigned alignment=8)
 
void * operator new (size_t bytes, const ASTContext *C, unsigned alignment=8)
 
void * operator new (size_t bytes, void *mem) noexcept
 
void operator delete (void *, const ASTContext &, unsigned) noexcept
 
void operator delete (void *, const ASTContext *, unsigned) noexcept
 
void operator delete (void *, size_t) noexcept
 
void operator delete (void *, void *) noexcept
 
 Stmt (StmtClass SC)
 
StmtClass getStmtClass () const
 
const char * getStmtClassName () const
 
SourceRange getSourceRange () const LLVM_READONLY
 SourceLocation tokens are not useful in isolation - they are low level value objects created/interpreted by SourceManager. More...
 
SourceLocation getBeginLoc () const LLVM_READONLY
 
SourceLocation getEndLoc () const LLVM_READONLY
 
void dump () const
 Dumps the specified AST fragment and all subtrees to llvm::errs(). More...
 
void dump (SourceManager &SM) const
 
void dump (raw_ostream &OS, SourceManager &SM) const
 
void dump (raw_ostream &OS) const
 
int64_t getID (const ASTContext &Context) const
 
void dumpColor () const
 dumpColor - same as dump(), but forces color highlighting. More...
 
void dumpPretty (const ASTContext &Context) const
 dumpPretty/printPretty - These two methods do a "pretty print" of the AST back to its original source language syntax. More...
 
void printPretty (raw_ostream &OS, PrinterHelper *Helper, const PrintingPolicy &Policy, unsigned Indentation=0, StringRef NewlineSymbol="\, const ASTContext *Context=nullptr) const
 
void viewAST () const
 viewAST - Visualize an AST rooted at this Stmt* using GraphViz. More...
 
StmtIgnoreImplicit ()
 Skip past any implicit AST nodes which might surround this statement, such as ExprWithCleanups or ImplicitCastExpr nodes. More...
 
const StmtIgnoreImplicit () const
 
StmtIgnoreContainers (bool IgnoreCaptured=false)
 Skip no-op (attributed, compound) container stmts and skip captured stmt at the top, if IgnoreCaptured is true. More...
 
const StmtIgnoreContainers (bool IgnoreCaptured=false) const
 
const StmtstripLabelLikeStatements () const
 Strip off all label-like statements. More...
 
StmtstripLabelLikeStatements ()
 
child_range children ()
 
const_child_range children () const
 
child_iterator child_begin ()
 
child_iterator child_end ()
 
const_child_iterator child_begin () const
 
const_child_iterator child_end () const
 
void Profile (llvm::FoldingSetNodeID &ID, const ASTContext &Context, bool Canonical) const
 Produce a unique representation of the given statement. More...
 
void ProcessODRHash (llvm::FoldingSetNodeID &ID, ODRHash &Hash) const
 Calculate a unique representation for a statement that is stable across compiler invocations. More...
 

Static Public Member Functions

static bool classof (const Stmt *T)
 
- Static Public Member Functions inherited from clang::Stmt
static void addStmtClass (const StmtClass s)
 
static void EnableStatistics ()
 
static void PrintStats ()
 

Protected Member Functions

 AsmStmt (StmtClass SC, SourceLocation asmloc, bool issimple, bool isvolatile, unsigned numoutputs, unsigned numinputs, unsigned numclobbers)
 
- Protected Member Functions inherited from clang::Stmt
void * operator new (size_t bytes) noexcept
 
void operator delete (void *data) noexcept
 
 Stmt (StmtClass SC, EmptyShell)
 Construct an empty statement. More...
 

Protected Attributes

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 = nullptr
 
- Protected Attributes inherited from clang::Stmt
union {
   StmtBitfields   StmtBits
 
   NullStmtBitfields   NullStmtBits
 
   CompoundStmtBitfields   CompoundStmtBits
 
   LabelStmtBitfields   LabelStmtBits
 
   AttributedStmtBitfields   AttributedStmtBits
 
   IfStmtBitfields   IfStmtBits
 
   SwitchStmtBitfields   SwitchStmtBits
 
   WhileStmtBitfields   WhileStmtBits
 
   DoStmtBitfields   DoStmtBits
 
   ForStmtBitfields   ForStmtBits
 
   GotoStmtBitfields   GotoStmtBits
 
   ContinueStmtBitfields   ContinueStmtBits
 
   BreakStmtBitfields   BreakStmtBits
 
   ReturnStmtBitfields   ReturnStmtBits
 
   SwitchCaseBitfields   SwitchCaseBits
 
   ExprBitfields   ExprBits
 
   PredefinedExprBitfields   PredefinedExprBits
 
   DeclRefExprBitfields   DeclRefExprBits
 
   FloatingLiteralBitfields   FloatingLiteralBits
 
   StringLiteralBitfields   StringLiteralBits
 
   CharacterLiteralBitfields   CharacterLiteralBits
 
   UnaryOperatorBitfields   UnaryOperatorBits
 
   UnaryExprOrTypeTraitExprBitfields   UnaryExprOrTypeTraitExprBits
 
   CallExprBitfields   CallExprBits
 
   MemberExprBitfields   MemberExprBits
 
   CastExprBitfields   CastExprBits
 
   BinaryOperatorBitfields   BinaryOperatorBits
 
   InitListExprBitfields   InitListExprBits
 
   PseudoObjectExprBitfields   PseudoObjectExprBits
 
   CXXBoolLiteralExprBitfields   CXXBoolLiteralExprBits
 
   CXXNullPtrLiteralExprBitfields   CXXNullPtrLiteralExprBits
 
   CXXThisExprBitfields   CXXThisExprBits
 
   CXXThrowExprBitfields   CXXThrowExprBits
 
   CXXDefaultArgExprBitfields   CXXDefaultArgExprBits
 
   CXXDefaultInitExprBitfields   CXXDefaultInitExprBits
 
   TypeTraitExprBitfields   TypeTraitExprBits
 
   ExprWithCleanupsBitfields   ExprWithCleanupsBits
 
   CoawaitExprBitfields   CoawaitBits
 
   ObjCIndirectCopyRestoreExprBitfields   ObjCIndirectCopyRestoreExprBits
 
   OpaqueValueExprBitfields   OpaqueValueExprBits
 
}; 
 

Friends

class ASTStmtReader
 

Additional Inherited Members

- Protected Types inherited from clang::Stmt
enum  { NumStmtBits = 8 }
 
enum  { NumExprBits = NumStmtBits + 9 }
 
enum  APFloatSemantics {
  IEEEhalf, IEEEsingle, IEEEdouble, x87DoubleExtended,
  IEEEquad, PPCDoubleDouble
}
 

Detailed Description

AsmStmt is the base class for GCCAsmStmt and MSAsmStmt.

Definition at line 2254 of file Stmt.h.

Member Typedef Documentation

◆ const_inputs_iterator

Definition at line 2346 of file Stmt.h.

◆ const_outputs_iterator

Definition at line 2375 of file Stmt.h.

◆ inputs_const_range

Definition at line 2348 of file Stmt.h.

◆ inputs_iterator

Definition at line 2345 of file Stmt.h.

◆ inputs_range

using clang::AsmStmt::inputs_range = llvm::iterator_range<inputs_iterator>

Definition at line 2347 of file Stmt.h.

◆ outputs_const_range

Definition at line 2377 of file Stmt.h.

◆ outputs_iterator

Definition at line 2374 of file Stmt.h.

◆ outputs_range

using clang::AsmStmt::outputs_range = llvm::iterator_range<outputs_iterator>

Definition at line 2376 of file Stmt.h.

Constructor & Destructor Documentation

◆ AsmStmt() [1/2]

clang::AsmStmt::AsmStmt ( StmtClass  SC,
SourceLocation  asmloc,
bool  issimple,
bool  isvolatile,
unsigned  numoutputs,
unsigned  numinputs,
unsigned  numclobbers 
)
inlineprotected

Definition at line 2274 of file Stmt.h.

◆ AsmStmt() [2/2]

clang::AsmStmt::AsmStmt ( StmtClass  SC,
EmptyShell  Empty 
)
inlineexplicit

Build an empty inline-assembly statement.

Definition at line 2282 of file Stmt.h.

Member Function Documentation

◆ begin_inputs() [1/2]

inputs_iterator clang::AsmStmt::begin_inputs ( )
inline

Definition at line 2350 of file Stmt.h.

◆ begin_inputs() [2/2]

const_inputs_iterator clang::AsmStmt::begin_inputs ( ) const
inline

Definition at line 2360 of file Stmt.h.

◆ begin_outputs() [1/2]

outputs_iterator clang::AsmStmt::begin_outputs ( )
inline

Definition at line 2379 of file Stmt.h.

◆ begin_outputs() [2/2]

const_outputs_iterator clang::AsmStmt::begin_outputs ( ) const
inline

Definition at line 2391 of file Stmt.h.

◆ children()

child_range clang::AsmStmt::children ( )
inline

Definition at line 2403 of file Stmt.h.

◆ classof()

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

Definition at line 2338 of file Stmt.h.

References clang::Stmt::getStmtClass().

◆ end_inputs() [1/2]

inputs_iterator clang::AsmStmt::end_inputs ( )
inline

Definition at line 2354 of file Stmt.h.

◆ end_inputs() [2/2]

const_inputs_iterator clang::AsmStmt::end_inputs ( ) const
inline

Definition at line 2364 of file Stmt.h.

◆ end_outputs() [1/2]

outputs_iterator clang::AsmStmt::end_outputs ( )
inline

Definition at line 2383 of file Stmt.h.

◆ end_outputs() [2/2]

const_outputs_iterator clang::AsmStmt::end_outputs ( ) const
inline

Definition at line 2395 of file Stmt.h.

◆ generateAsmString()

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

Assemble final IR asm string.

Definition at line 364 of file Stmt.cpp.

◆ getAsmLoc()

SourceLocation clang::AsmStmt::getAsmLoc ( ) const
inline

Definition at line 2284 of file Stmt.h.

◆ getBeginLoc()

SourceLocation clang::AsmStmt::getBeginLoc ( ) const
inline

Definition at line 2293 of file Stmt.h.

◆ getClobber()

StringRef AsmStmt::getClobber ( unsigned  i) const

Definition at line 404 of file Stmt.cpp.

◆ getEndLoc()

SourceLocation clang::AsmStmt::getEndLoc ( ) const
inline

Definition at line 2294 of file Stmt.h.

References AttributeLangSupport::C.

◆ getInputConstraint()

StringRef AsmStmt::getInputConstraint ( unsigned  i) const

getInputConstraint - Return the specified input constraint.

Unlike output constraints, these can be empty.

Definition at line 388 of file Stmt.cpp.

◆ getInputExpr()

const Expr * AsmStmt::getInputExpr ( unsigned  i) const

Definition at line 396 of file Stmt.cpp.

◆ getNumClobbers()

unsigned clang::AsmStmt::getNumClobbers ( ) const
inline

Definition at line 2335 of file Stmt.h.

◆ getNumInputs()

unsigned clang::AsmStmt::getNumInputs ( ) const
inline

Definition at line 2325 of file Stmt.h.

◆ getNumOutputs()

unsigned clang::AsmStmt::getNumOutputs ( ) const
inline

Definition at line 2303 of file Stmt.h.

◆ getNumPlusOperands()

unsigned AsmStmt::getNumPlusOperands ( ) const

getNumPlusOperands - Return the number of output operands that have a "+" constraint.

Definition at line 414 of file Stmt.cpp.

◆ getOutputConstraint()

StringRef AsmStmt::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 372 of file Stmt.cpp.

◆ getOutputExpr()

const Expr * AsmStmt::getOutputExpr ( unsigned  i) const

Definition at line 380 of file Stmt.cpp.

◆ inputs() [1/2]

inputs_range clang::AsmStmt::inputs ( )
inline

Definition at line 2358 of file Stmt.h.

◆ inputs() [2/2]

inputs_const_range clang::AsmStmt::inputs ( ) const
inline

Definition at line 2368 of file Stmt.h.

◆ isOutputPlusConstraint()

bool clang::AsmStmt::isOutputPlusConstraint ( unsigned  i) const
inline

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).

Definition at line 2313 of file Stmt.h.

◆ isSimple()

bool clang::AsmStmt::isSimple ( ) const
inline

Definition at line 2287 of file Stmt.h.

◆ isVolatile()

bool clang::AsmStmt::isVolatile ( ) const
inline

Definition at line 2290 of file Stmt.h.

◆ outputs() [1/2]

outputs_range clang::AsmStmt::outputs ( )
inline

Definition at line 2387 of file Stmt.h.

Referenced by clang::ento::ExprEngine::VisitGCCAsmStmt().

◆ outputs() [2/2]

outputs_const_range clang::AsmStmt::outputs ( ) const
inline

Definition at line 2399 of file Stmt.h.

◆ setAsmLoc()

void clang::AsmStmt::setAsmLoc ( SourceLocation  L)
inline

Definition at line 2285 of file Stmt.h.

◆ setSimple()

void clang::AsmStmt::setSimple ( bool  V)
inline

Definition at line 2288 of file Stmt.h.

◆ setVolatile()

void clang::AsmStmt::setVolatile ( bool  V)
inline

Definition at line 2291 of file Stmt.h.

Friends And Related Function Documentation

◆ ASTStmtReader

friend class ASTStmtReader
friend

Definition at line 2256 of file Stmt.h.

Member Data Documentation

◆ AsmLoc

SourceLocation clang::AsmStmt::AsmLoc
protected

Definition at line 2258 of file Stmt.h.

◆ Exprs

Stmt** clang::AsmStmt::Exprs = nullptr
protected

Definition at line 2272 of file Stmt.h.

Referenced by copyIntoContext().

◆ IsSimple

bool clang::AsmStmt::IsSimple
protected

True if the assembly statement does not have any input or output operands.

Definition at line 2262 of file Stmt.h.

◆ IsVolatile

bool clang::AsmStmt::IsVolatile
protected

If true, treat this inline assembly as having side effects.

This assembly statement should not be optimized, deleted or moved.

Definition at line 2266 of file Stmt.h.

◆ NumClobbers

unsigned clang::AsmStmt::NumClobbers
protected

Definition at line 2270 of file Stmt.h.

Referenced by copyIntoContext(), and clang::GCCAsmStmt::GCCAsmStmt().

◆ NumInputs

unsigned clang::AsmStmt::NumInputs
protected

Definition at line 2269 of file Stmt.h.

Referenced by copyIntoContext(), and clang::GCCAsmStmt::GCCAsmStmt().

◆ NumOutputs

unsigned clang::AsmStmt::NumOutputs
protected

Definition at line 2268 of file Stmt.h.

Referenced by copyIntoContext(), and clang::GCCAsmStmt::GCCAsmStmt().


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