1 //===-- llvm/InlineAsm.h - Class to represent inline asm strings-*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file was developed by Chris Lattner and is distributed under
6 // the University of Illinois Open Source License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This class represents the inline asm strings, which are Value*'s that are
11 // used as the callee operand of call instructions. InlineAsm's are uniqued
12 // like constants, and created via InlineAsm::get(...).
14 //===----------------------------------------------------------------------===//
16 #ifndef LLVM_INLINEASM_H
17 #define LLVM_INLINEASM_H
19 #include "llvm/Value.h"
23 struct AssemblyAnnotationWriter;
28 class InlineAsm : public Value {
29 InlineAsm(const InlineAsm &); // do not implement
30 void operator=(const InlineAsm&); // do not implement
32 std::string AsmString, Constraints;
35 InlineAsm(const FunctionType *Ty, const std::string &AsmString,
36 const std::string &Constraints, bool hasSideEffects);
39 /// InlineAsm::get - Return the the specified uniqued inline asm string.
41 static InlineAsm *get(const FunctionType *Ty, const std::string &AsmString,
42 const std::string &Constraints, bool hasSideEffects);
44 bool hasSideEffects() const { return HasSideEffects; }
46 /// getType - InlineAsm's are always pointers.
48 const PointerType *getType() const {
49 return reinterpret_cast<const PointerType*>(Value::getType());
52 /// getFunctionType - InlineAsm's are always pointers to functions.
54 const FunctionType *getFunctionType() const;
56 virtual void print(std::ostream &O) const { print(O, 0); }
57 void print(std::ostream &OS, AssemblyAnnotationWriter *AAW) const;
59 // Methods for support type inquiry through isa, cast, and dyn_cast:
60 static inline bool classof(const InlineAsm *) { return true; }
61 static inline bool classof(const Value *V) {
62 return V->getValueType() == Value::InlineAsmVal;
66 } // End llvm namespace