LLVM  13.0.0git
InlineAsm.h
Go to the documentation of this file.
1 //===- llvm/InlineAsm.h - Class to represent inline asm strings -*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This class represents the inline asm strings, which are Value*'s that are
10 // used as the callee operand of call instructions. InlineAsm's are uniqued
11 // like constants, and created via InlineAsm::get(...).
12 //
13 //===----------------------------------------------------------------------===//
14 
15 #ifndef LLVM_IR_INLINEASM_H
16 #define LLVM_IR_INLINEASM_H
17 
18 #include "llvm/ADT/StringRef.h"
19 #include "llvm/IR/Value.h"
21 #include <cassert>
22 #include <string>
23 #include <vector>
24 
25 namespace llvm {
26 
27 class FunctionType;
28 class PointerType;
29 template <class ConstantClass> class ConstantUniqueMap;
30 
31 class InlineAsm final : public Value {
32 public:
33  enum AsmDialect {
36  };
37 
38 private:
39  friend struct InlineAsmKeyType;
41 
42  std::string AsmString, Constraints;
43  FunctionType *FTy;
44  bool HasSideEffects;
45  bool IsAlignStack;
46  AsmDialect Dialect;
47 
48  InlineAsm(FunctionType *Ty, const std::string &AsmString,
49  const std::string &Constraints, bool hasSideEffects,
50  bool isAlignStack, AsmDialect asmDialect);
51 
52  /// When the ConstantUniqueMap merges two types and makes two InlineAsms
53  /// identical, it destroys one of them with this method.
54  void destroyConstant();
55 
56 public:
57  InlineAsm(const InlineAsm &) = delete;
58  InlineAsm &operator=(const InlineAsm &) = delete;
59 
60  /// InlineAsm::get - Return the specified uniqued inline asm string.
61  ///
62  static InlineAsm *get(FunctionType *Ty, StringRef AsmString,
63  StringRef Constraints, bool hasSideEffects,
64  bool isAlignStack = false,
65  AsmDialect asmDialect = AD_ATT);
66 
67  bool hasSideEffects() const { return HasSideEffects; }
68  bool isAlignStack() const { return IsAlignStack; }
69  AsmDialect getDialect() const { return Dialect; }
70 
71  /// getType - InlineAsm's are always pointers.
72  ///
73  PointerType *getType() const {
74  return reinterpret_cast<PointerType*>(Value::getType());
75  }
76 
77  /// getFunctionType - InlineAsm's are always pointers to functions.
78  ///
80 
81  const std::string &getAsmString() const { return AsmString; }
82  const std::string &getConstraintString() const { return Constraints; }
83 
84  /// Verify - This static method can be used by the parser to check to see if
85  /// the specified constraint string is legal for the type. This returns true
86  /// if legal, false if not.
87  ///
88  static bool Verify(FunctionType *Ty, StringRef Constraints);
89 
90  // Constraint String Parsing
92  isInput, // 'x'
93  isOutput, // '=x'
94  isClobber // '~x'
95  };
96 
97  using ConstraintCodeVector = std::vector<std::string>;
98 
100  /// MatchingInput - If this is not -1, this is an output constraint where an
101  /// input constraint is required to match it (e.g. "0"). The value is the
102  /// constraint number that matches this one (for example, if this is
103  /// constraint #0 and constraint #4 has the value "0", this will be 4).
104  int MatchingInput = -1;
105 
106  /// Code - The constraint code, either the register name (in braces) or the
107  /// constraint letter/number.
109 
110  /// Default constructor.
111  SubConstraintInfo() = default;
112  };
113 
114  using SubConstraintInfoVector = std::vector<SubConstraintInfo>;
115  struct ConstraintInfo;
116  using ConstraintInfoVector = std::vector<ConstraintInfo>;
117 
118  struct ConstraintInfo {
119  /// Type - The basic type of the constraint: input/output/clobber
120  ///
122 
123  /// isEarlyClobber - "&": output operand writes result before inputs are all
124  /// read. This is only ever set for an output operand.
125  bool isEarlyClobber = false;
126 
127  /// MatchingInput - If this is not -1, this is an output constraint where an
128  /// input constraint is required to match it (e.g. "0"). The value is the
129  /// constraint number that matches this one (for example, if this is
130  /// constraint #0 and constraint #4 has the value "0", this will be 4).
131  int MatchingInput = -1;
132 
133  /// hasMatchingInput - Return true if this is an output constraint that has
134  /// a matching input constraint.
135  bool hasMatchingInput() const { return MatchingInput != -1; }
136 
137  /// isCommutative - This is set to true for a constraint that is commutative
138  /// with the next operand.
139  bool isCommutative = false;
140 
141  /// isIndirect - True if this operand is an indirect operand. This means
142  /// that the address of the source or destination is present in the call
143  /// instruction, instead of it being returned or passed in explicitly. This
144  /// is represented with a '*' in the asm string.
145  bool isIndirect = false;
146 
147  /// Code - The constraint code, either the register name (in braces) or the
148  /// constraint letter/number.
150 
151  /// isMultipleAlternative - '|': has multiple-alternative constraints.
152  bool isMultipleAlternative = false;
153 
154  /// multipleAlternatives - If there are multiple alternative constraints,
155  /// this array will contain them. Otherwise it will be empty.
157 
158  /// The currently selected alternative constraint index.
160 
161  /// Default constructor.
162  ConstraintInfo() = default;
163 
164  /// Parse - Analyze the specified string (e.g. "=*&{eax}") and fill in the
165  /// fields in this structure. If the constraint string is not understood,
166  /// return true, otherwise return false.
167  bool Parse(StringRef Str, ConstraintInfoVector &ConstraintsSoFar);
168 
169  /// selectAlternative - Point this constraint to the alternative constraint
170  /// indicated by the index.
171  void selectAlternative(unsigned index);
172  };
173 
174  /// ParseConstraints - Split up the constraint string into the specific
175  /// constraints and their prefixes. If this returns an empty vector, and if
176  /// the constraint string itself isn't empty, there was an error parsing.
177  static ConstraintInfoVector ParseConstraints(StringRef ConstraintString);
178 
179  /// ParseConstraints - Parse the constraints of this inlineasm object,
180  /// returning them the same way that ParseConstraints(str) does.
182  return ParseConstraints(Constraints);
183  }
184 
185  // Methods for support type inquiry through isa, cast, and dyn_cast:
186  static bool classof(const Value *V) {
187  return V->getValueID() == Value::InlineAsmVal;
188  }
189 
190  // These are helper methods for dealing with flags in the INLINEASM SDNode
191  // in the backend.
192  //
193  // The encoding of the flag word is currently:
194  // Bits 2-0 - A Kind_* value indicating the kind of the operand.
195  // Bits 15-3 - The number of SDNode operands associated with this inline
196  // assembly operand.
197  // If bit 31 is set:
198  // Bit 30-16 - The operand number that this operand must match.
199  // When bits 2-0 are Kind_Mem, the Constraint_* value must be
200  // obtained from the flags for this operand number.
201  // Else if bits 2-0 are Kind_Mem:
202  // Bit 30-16 - A Constraint_* value indicating the original constraint
203  // code.
204  // Else:
205  // Bit 30-16 - The register class ID to use for the operand.
206 
207  enum : uint32_t {
208  // Fixed operands on an INLINEASM SDNode.
212  Op_ExtraInfo = 3, // HasSideEffects, IsAlignStack, AsmDialect.
214 
215  // Fixed operands on an INLINEASM MachineInstr.
217  MIOp_ExtraInfo = 1, // HasSideEffects, IsAlignStack, AsmDialect.
219 
220  // Interpretation of the MIOp_ExtraInfo bit field.
227 
228  // Inline asm operands map to multiple SDNode / MachineInstr operands.
229  // The first operand is an immediate describing the asm operand, the low
230  // bits is the kind:
231  Kind_RegUse = 1, // Input register, "r".
232  Kind_RegDef = 2, // Output register, "=r".
233  Kind_RegDefEarlyClobber = 3, // Early-clobber output register, "=&r".
234  Kind_Clobber = 4, // Clobbered register, "~r".
235  Kind_Imm = 5, // Immediate.
236  Kind_Mem = 6, // Memory operand, "m".
237 
238  // Memory constraint codes.
239  // These could be tablegenerated but there's little need to do that since
240  // there's plenty of space in the encoding to support the union of all
241  // constraint codes for all targets.
266 
267  Flag_MatchingOperand = 0x80000000
268  };
269 
270  static unsigned getFlagWord(unsigned Kind, unsigned NumOps) {
271  assert(((NumOps << 3) & ~0xffff) == 0 && "Too many inline asm operands!");
272  assert(Kind >= Kind_RegUse && Kind <= Kind_Mem && "Invalid Kind");
273  return Kind | (NumOps << 3);
274  }
275 
276  static bool isRegDefKind(unsigned Flag){ return getKind(Flag) == Kind_RegDef;}
277  static bool isImmKind(unsigned Flag) { return getKind(Flag) == Kind_Imm; }
278  static bool isMemKind(unsigned Flag) { return getKind(Flag) == Kind_Mem; }
279  static bool isRegDefEarlyClobberKind(unsigned Flag) {
281  }
282  static bool isClobberKind(unsigned Flag) {
283  return getKind(Flag) == Kind_Clobber;
284  }
285 
286  /// getFlagWordForMatchingOp - Augment an existing flag word returned by
287  /// getFlagWord with information indicating that this input operand is tied
288  /// to a previous output operand.
289  static unsigned getFlagWordForMatchingOp(unsigned InputFlag,
290  unsigned MatchedOperandNo) {
291  assert(MatchedOperandNo <= 0x7fff && "Too big matched operand");
292  assert((InputFlag & ~0xffff) == 0 && "High bits already contain data");
293  return InputFlag | Flag_MatchingOperand | (MatchedOperandNo << 16);
294  }
295 
296  /// getFlagWordForRegClass - Augment an existing flag word returned by
297  /// getFlagWord with the required register class for the following register
298  /// operands.
299  /// A tied use operand cannot have a register class, use the register class
300  /// from the def operand instead.
301  static unsigned getFlagWordForRegClass(unsigned InputFlag, unsigned RC) {
302  // Store RC + 1, reserve the value 0 to mean 'no register class'.
303  ++RC;
304  assert(!isImmKind(InputFlag) && "Immediates cannot have a register class");
305  assert(!isMemKind(InputFlag) && "Memory operand cannot have a register class");
306  assert(RC <= 0x7fff && "Too large register class ID");
307  assert((InputFlag & ~0xffff) == 0 && "High bits already contain data");
308  return InputFlag | (RC << 16);
309  }
310 
311  /// Augment an existing flag word returned by getFlagWord with the constraint
312  /// code for a memory constraint.
313  static unsigned getFlagWordForMem(unsigned InputFlag, unsigned Constraint) {
314  assert(isMemKind(InputFlag) && "InputFlag is not a memory constraint!");
315  assert(Constraint <= 0x7fff && "Too large a memory constraint ID");
316  assert(Constraint <= Constraints_Max && "Unknown constraint ID");
317  assert((InputFlag & ~0xffff) == 0 && "High bits already contain data");
318  return InputFlag | (Constraint << Constraints_ShiftAmount);
319  }
320 
321  static unsigned convertMemFlagWordToMatchingFlagWord(unsigned InputFlag) {
322  assert(isMemKind(InputFlag));
323  return InputFlag & ~(0x7fff << Constraints_ShiftAmount);
324  }
325 
326  static unsigned getKind(unsigned Flags) {
327  return Flags & 7;
328  }
329 
330  static unsigned getMemoryConstraintID(unsigned Flag) {
332  return (Flag >> Constraints_ShiftAmount) & 0x7fff;
333  }
334 
335  /// getNumOperandRegisters - Extract the number of registers field from the
336  /// inline asm operand flag.
337  static unsigned getNumOperandRegisters(unsigned Flag) {
338  return (Flag & 0xffff) >> 3;
339  }
340 
341  /// isUseOperandTiedToDef - Return true if the flag of the inline asm
342  /// operand indicates it is an use operand that's matched to a def operand.
343  static bool isUseOperandTiedToDef(unsigned Flag, unsigned &Idx) {
344  if ((Flag & Flag_MatchingOperand) == 0)
345  return false;
346  Idx = (Flag & ~Flag_MatchingOperand) >> 16;
347  return true;
348  }
349 
350  /// hasRegClassConstraint - Returns true if the flag contains a register
351  /// class constraint. Sets RC to the register class ID.
352  static bool hasRegClassConstraint(unsigned Flag, unsigned &RC) {
354  return false;
355  unsigned High = Flag >> 16;
356  // getFlagWordForRegClass() uses 0 to mean no register class, and otherwise
357  // stores RC + 1.
358  if (!High)
359  return false;
360  RC = High - 1;
361  return true;
362  }
363 
364  static std::vector<StringRef> getExtraInfoNames(unsigned ExtraInfo) {
365  std::vector<StringRef> Result;
366  if (ExtraInfo & InlineAsm::Extra_HasSideEffects)
367  Result.push_back("sideeffect");
368  if (ExtraInfo & InlineAsm::Extra_MayLoad)
369  Result.push_back("mayload");
370  if (ExtraInfo & InlineAsm::Extra_MayStore)
371  Result.push_back("maystore");
372  if (ExtraInfo & InlineAsm::Extra_IsConvergent)
373  Result.push_back("isconvergent");
374  if (ExtraInfo & InlineAsm::Extra_IsAlignStack)
375  Result.push_back("alignstack");
376 
377  AsmDialect Dialect =
379 
380  if (Dialect == InlineAsm::AD_ATT)
381  Result.push_back("attdialect");
382  if (Dialect == InlineAsm::AD_Intel)
383  Result.push_back("inteldialect");
384 
385  return Result;
386  }
387 
388  static StringRef getKindName(unsigned Kind) {
389  switch (Kind) {
391  return "reguse";
393  return "regdef";
395  return "regdef-ec";
397  return "clobber";
398  case InlineAsm::Kind_Imm:
399  return "imm";
400  case InlineAsm::Kind_Mem:
401  return "mem";
402  default:
403  llvm_unreachable("Unknown operand kind");
404  }
405  }
406 
407  static StringRef getMemConstraintName(unsigned Constraint) {
408  switch (Constraint) {
410  return "es";
412  return "i";
414  return "m";
416  return "o";
418  return "v";
420  return "Q";
422  return "R";
424  return "S";
426  return "T";
428  return "Um";
430  return "Un";
432  return "Uq";
434  return "Us";
436  return "Ut";
438  return "Uv";
440  return "Uy";
442  return "X";
444  return "Z";
446  return "ZC";
448  return "Zy";
449  default:
450  llvm_unreachable("Unknown memory constraint");
451  }
452  }
453 };
454 
455 } // end namespace llvm
456 
457 #endif // LLVM_IR_INLINEASM_H
llvm::InlineAsm::Extra_AsmDialect
@ Extra_AsmDialect
Definition: InlineAsm.h:223
llvm::EngineKind::Kind
Kind
Definition: ExecutionEngine.h:524
llvm::InlineAsm::ConstraintInfo::MatchingInput
int MatchingInput
MatchingInput - If this is not -1, this is an output constraint where an input constraint is required...
Definition: InlineAsm.h:131
PointerType
Definition: ItaniumDemangle.h:477
llvm::InlineAsm::Op_FirstOperand
@ Op_FirstOperand
Definition: InlineAsm.h:213
llvm
Definition: AllocatorList.h:23
llvm::InlineAsm::AsmDialect
AsmDialect
Definition: InlineAsm.h:33
llvm::InlineAsm::ConstraintInfo::isCommutative
bool isCommutative
isCommutative - This is set to true for a constraint that is commutative with the next operand.
Definition: InlineAsm.h:139
llvm::InlineAsm::Constraint_o
@ Constraint_o
Definition: InlineAsm.h:246
FunctionType
Definition: ItaniumDemangle.h:643
llvm::InlineAsm::ConstraintInfoVector
std::vector< ConstraintInfo > ConstraintInfoVector
Definition: InlineAsm.h:116
llvm::InlineAsm::getAsmString
const std::string & getAsmString() const
Definition: InlineAsm.h:81
llvm::InlineAsm::Constraint_S
@ Constraint_S
Definition: InlineAsm.h:251
StringRef.h
llvm::InlineAsm::getKindName
static StringRef getKindName(unsigned Kind)
Definition: InlineAsm.h:388
llvm::InlineAsm::isAlignStack
bool isAlignStack() const
Definition: InlineAsm.h:68
llvm::InlineAsm::ConstraintInfo::isIndirect
bool isIndirect
isIndirect - True if this operand is an indirect operand.
Definition: InlineAsm.h:145
llvm::InlineAsm::AD_ATT
@ AD_ATT
Definition: InlineAsm.h:34
llvm::InlineAsm::Constraint_A
@ Constraint_A
Definition: InlineAsm.h:248
High
uint64_t High
Definition: NVVMIntrRange.cpp:61
llvm::InlineAsm::convertMemFlagWordToMatchingFlagWord
static unsigned convertMemFlagWordToMatchingFlagWord(unsigned InputFlag)
Definition: InlineAsm.h:321
ErrorHandling.h
llvm::InlineAsm::Kind_RegDefEarlyClobber
@ Kind_RegDefEarlyClobber
Definition: InlineAsm.h:233
llvm::InlineAsm::Constraint_Us
@ Constraint_Us
Definition: InlineAsm.h:256
llvm::InlineAsm::Constraint_Uv
@ Constraint_Uv
Definition: InlineAsm.h:258
llvm::InlineAsm::isUseOperandTiedToDef
static bool isUseOperandTiedToDef(unsigned Flag, unsigned &Idx)
isUseOperandTiedToDef - Return true if the flag of the inline asm operand indicates it is an use oper...
Definition: InlineAsm.h:343
llvm::Type
The instances of the Type class are immutable: once they are created, they are never changed.
Definition: Type.h:46
llvm::InlineAsm::Kind_Clobber
@ Kind_Clobber
Definition: InlineAsm.h:234
llvm::InlineAsm::Flag_MatchingOperand
@ Flag_MatchingOperand
Definition: InlineAsm.h:267
llvm::InlineAsm::ConstraintInfo::Parse
bool Parse(StringRef Str, ConstraintInfoVector &ConstraintsSoFar)
Parse - Analyze the specified string (e.g.
Definition: InlineAsm.cpp:63
llvm::InlineAsm::getFunctionType
FunctionType * getFunctionType() const
getFunctionType - InlineAsm's are always pointers to functions.
Definition: InlineAsm.cpp:56
llvm::InlineAsm::Constraint_es
@ Constraint_es
Definition: InlineAsm.h:243
llvm::InlineAsm::Constraint_X
@ Constraint_X
Definition: InlineAsm.h:260
llvm::InlineAsm::getType
PointerType * getType() const
getType - InlineAsm's are always pointers.
Definition: InlineAsm.h:73
llvm::InlineAsm::Constraint_Z
@ Constraint_Z
Definition: InlineAsm.h:261
llvm::InlineAsm::Op_AsmString
@ Op_AsmString
Definition: InlineAsm.h:210
llvm::InlineAsm::classof
static bool classof(const Value *V)
Definition: InlineAsm.h:186
llvm::InlineAsm::ConstraintInfo::currentAlternativeIndex
unsigned currentAlternativeIndex
The currently selected alternative constraint index.
Definition: InlineAsm.h:159
llvm::InlineAsm::Constraint_Zy
@ Constraint_Zy
Definition: InlineAsm.h:263
llvm::InlineAsmKeyType
Definition: ConstantsContext.h:459
llvm::InlineAsm::Extra_HasSideEffects
@ Extra_HasSideEffects
Definition: InlineAsm.h:221
llvm::InlineAsm::hasSideEffects
bool hasSideEffects() const
Definition: InlineAsm.h:67
llvm::InlineAsm::Constraints_Max
@ Constraints_Max
Definition: InlineAsm.h:264
llvm::InlineAsm::Op_MDNode
@ Op_MDNode
Definition: InlineAsm.h:211
llvm::InlineAsm::isInput
@ isInput
Definition: InlineAsm.h:92
llvm::InlineAsm::Kind_RegUse
@ Kind_RegUse
Definition: InlineAsm.h:231
llvm::InlineAsm::Constraint_R
@ Constraint_R
Definition: InlineAsm.h:250
llvm::Value::getValueID
unsigned getValueID() const
Return an ID for the concrete type of this object.
Definition: Value.h:541
llvm::InlineAsm::isRegDefKind
static bool isRegDefKind(unsigned Flag)
Definition: InlineAsm.h:276
llvm::MCID::Flag
Flag
These should be considered private to the implementation of the MCInstrDesc class.
Definition: MCInstrDesc.h:147
llvm::ConstantUniqueMap
Definition: InlineAsm.h:29
llvm::InlineAsm::Constraint_Uy
@ Constraint_Uy
Definition: InlineAsm.h:259
llvm::InlineAsm::Extra_MayStore
@ Extra_MayStore
Definition: InlineAsm.h:225
llvm::InlineAsm::getDialect
AsmDialect getDialect() const
Definition: InlineAsm.h:69
llvm::InlineAsm::getKind
static unsigned getKind(unsigned Flags)
Definition: InlineAsm.h:326
llvm::InlineAsm::isMemKind
static bool isMemKind(unsigned Flag)
Definition: InlineAsm.h:278
llvm::InlineAsm::get
static InlineAsm * get(FunctionType *Ty, StringRef AsmString, StringRef Constraints, bool hasSideEffects, bool isAlignStack=false, AsmDialect asmDialect=AD_ATT)
InlineAsm::get - Return the specified uniqued inline asm string.
Definition: InlineAsm.cpp:42
llvm::InlineAsm
Definition: InlineAsm.h:31
llvm::InlineAsm::isRegDefEarlyClobberKind
static bool isRegDefEarlyClobberKind(unsigned Flag)
Definition: InlineAsm.h:279
llvm::InlineAsm::Constraint_Uq
@ Constraint_Uq
Definition: InlineAsm.h:255
llvm::InlineAsm::MIOp_FirstOperand
@ MIOp_FirstOperand
Definition: InlineAsm.h:218
index
splat index
Definition: README_ALTIVEC.txt:181
llvm::InlineAsm::Constraint_Unknown
@ Constraint_Unknown
Definition: InlineAsm.h:242
llvm::InlineAsm::SubConstraintInfo::SubConstraintInfo
SubConstraintInfo()=default
Default constructor.
llvm::InlineAsm::Constraint_m
@ Constraint_m
Definition: InlineAsm.h:245
llvm::InlineAsm::Extra_IsConvergent
@ Extra_IsConvergent
Definition: InlineAsm.h:226
llvm::InlineAsm::isImmKind
static bool isImmKind(unsigned Flag)
Definition: InlineAsm.h:277
llvm::InlineAsm::ConstraintInfo::isEarlyClobber
bool isEarlyClobber
isEarlyClobber - "&": output operand writes result before inputs are all read.
Definition: InlineAsm.h:125
llvm::PointerType
Class to represent pointers.
Definition: DerivedTypes.h:634
llvm::InlineAsm::ConstraintInfo::ConstraintInfo
ConstraintInfo()=default
Default constructor.
llvm::InlineAsm::ConstraintInfo
Definition: InlineAsm.h:118
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::InlineAsm::ConstraintInfo::Codes
ConstraintCodeVector Codes
Code - The constraint code, either the register name (in braces) or the constraint letter/number.
Definition: InlineAsm.h:149
llvm::InlineAsm::getMemoryConstraintID
static unsigned getMemoryConstraintID(unsigned Flag)
Definition: InlineAsm.h:330
llvm::InlineAsm::Constraints_ShiftAmount
@ Constraints_ShiftAmount
Definition: InlineAsm.h:265
llvm::InlineAsm::Constraint_Ut
@ Constraint_Ut
Definition: InlineAsm.h:257
llvm::InlineAsm::SubConstraintInfo::MatchingInput
int MatchingInput
MatchingInput - If this is not -1, this is an output constraint where an input constraint is required...
Definition: InlineAsm.h:104
llvm::InlineAsm::getFlagWordForRegClass
static unsigned getFlagWordForRegClass(unsigned InputFlag, unsigned RC)
getFlagWordForRegClass - Augment an existing flag word returned by getFlagWord with the required regi...
Definition: InlineAsm.h:301
llvm::InlineAsm::SubConstraintInfo::Codes
ConstraintCodeVector Codes
Code - The constraint code, either the register name (in braces) or the constraint letter/number.
Definition: InlineAsm.h:108
llvm::InlineAsm::getConstraintString
const std::string & getConstraintString() const
Definition: InlineAsm.h:82
llvm::InlineAsm::AD_Intel
@ AD_Intel
Definition: InlineAsm.h:35
llvm::InlineAsm::Extra_MayLoad
@ Extra_MayLoad
Definition: InlineAsm.h:224
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:57
llvm::InlineAsm::getFlagWord
static unsigned getFlagWord(unsigned Kind, unsigned NumOps)
Definition: InlineAsm.h:270
llvm_unreachable
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Definition: ErrorHandling.h:136
llvm::Value::getType
Type * getType() const
All values are typed, get the type of this value.
Definition: Value.h:256
uint32_t
llvm::InlineAsm::isClobberKind
static bool isClobberKind(unsigned Flag)
Definition: InlineAsm.h:282
llvm::InlineAsm::getMemConstraintName
static StringRef getMemConstraintName(unsigned Constraint)
Definition: InlineAsm.h:407
llvm::InlineAsm::getFlagWordForMem
static unsigned getFlagWordForMem(unsigned InputFlag, unsigned Constraint)
Augment an existing flag word returned by getFlagWord with the constraint code for a memory constrain...
Definition: InlineAsm.h:313
llvm::InlineAsm::getFlagWordForMatchingOp
static unsigned getFlagWordForMatchingOp(unsigned InputFlag, unsigned MatchedOperandNo)
getFlagWordForMatchingOp - Augment an existing flag word returned by getFlagWord with information ind...
Definition: InlineAsm.h:289
llvm::InlineAsm::ConstraintInfo::multipleAlternatives
SubConstraintInfoVector multipleAlternatives
multipleAlternatives - If there are multiple alternative constraints, this array will contain them.
Definition: InlineAsm.h:156
llvm::InlineAsm::MIOp_ExtraInfo
@ MIOp_ExtraInfo
Definition: InlineAsm.h:217
llvm::InlineAsm::ConstraintInfo::selectAlternative
void selectAlternative(unsigned index)
selectAlternative - Point this constraint to the alternative constraint indicated by the index.
Definition: InlineAsm.cpp:206
llvm::InlineAsm::Op_InputChain
@ Op_InputChain
Definition: InlineAsm.h:209
llvm::InlineAsm::Constraint_i
@ Constraint_i
Definition: InlineAsm.h:244
llvm::InlineAsm::ConstraintInfo::isMultipleAlternative
bool isMultipleAlternative
isMultipleAlternative - '|': has multiple-alternative constraints.
Definition: InlineAsm.h:152
llvm::InlineAsm::hasRegClassConstraint
static bool hasRegClassConstraint(unsigned Flag, unsigned &RC)
hasRegClassConstraint - Returns true if the flag contains a register class constraint.
Definition: InlineAsm.h:352
llvm::InlineAsm::isClobber
@ isClobber
Definition: InlineAsm.h:94
llvm::InlineAsm::getExtraInfoNames
static std::vector< StringRef > getExtraInfoNames(unsigned ExtraInfo)
Definition: InlineAsm.h:364
llvm::InlineAsm::Constraint_v
@ Constraint_v
Definition: InlineAsm.h:247
llvm::InlineAsm::Kind_Imm
@ Kind_Imm
Definition: InlineAsm.h:235
llvm::InlineAsm::isOutput
@ isOutput
Definition: InlineAsm.h:93
llvm::InlineAsm::Kind_RegDef
@ Kind_RegDef
Definition: InlineAsm.h:232
llvm::InlineAsm::ParseConstraints
ConstraintInfoVector ParseConstraints() const
ParseConstraints - Parse the constraints of this inlineasm object, returning them the same way that P...
Definition: InlineAsm.h:181
llvm::InlineAsm::Constraint_Um
@ Constraint_Um
Definition: InlineAsm.h:253
llvm::InlineAsm::MIOp_AsmString
@ MIOp_AsmString
Definition: InlineAsm.h:216
llvm::InlineAsm::ConstraintPrefix
ConstraintPrefix
Definition: InlineAsm.h:91
llvm::InlineAsm::getNumOperandRegisters
static unsigned getNumOperandRegisters(unsigned Flag)
getNumOperandRegisters - Extract the number of registers field from the inline asm operand flag.
Definition: InlineAsm.h:337
llvm::InlineAsm::Extra_IsAlignStack
@ Extra_IsAlignStack
Definition: InlineAsm.h:222
llvm::InlineAsm::operator=
InlineAsm & operator=(const InlineAsm &)=delete
llvm::InlineAsm::ConstraintCodeVector
std::vector< std::string > ConstraintCodeVector
Definition: InlineAsm.h:97
llvm::InlineAsm::Op_ExtraInfo
@ Op_ExtraInfo
Definition: InlineAsm.h:212
llvm::InlineAsm::Constraint_Un
@ Constraint_Un
Definition: InlineAsm.h:254
llvm::InlineAsm::Constraint_ZC
@ Constraint_ZC
Definition: InlineAsm.h:262
llvm::InlineAsm::SubConstraintInfoVector
std::vector< SubConstraintInfo > SubConstraintInfoVector
Definition: InlineAsm.h:114
llvm::InlineAsm::SubConstraintInfo
Definition: InlineAsm.h:99
Value.h
llvm::InlineAsm::Constraint_Q
@ Constraint_Q
Definition: InlineAsm.h:249
llvm::InlineAsm::Constraint_T
@ Constraint_T
Definition: InlineAsm.h:252
llvm::Value
LLVM Value Representation.
Definition: Value.h:75
llvm::InlineAsm::Verify
static bool Verify(FunctionType *Ty, StringRef Constraints)
Verify - This static method can be used by the parser to check to see if the specified constraint str...
Definition: InlineAsm.cpp:253
llvm::InlineAsm::ConstraintInfo::hasMatchingInput
bool hasMatchingInput() const
hasMatchingInput - Return true if this is an output constraint that has a matching input constraint.
Definition: InlineAsm.h:135
llvm::InlineAsm::Kind_Mem
@ Kind_Mem
Definition: InlineAsm.h:236
llvm::FunctionType
Class to represent function types.
Definition: DerivedTypes.h:102