003 File Manager
Current Path:
/usr/src/contrib/llvm-project/llvm/include/llvm/MC
usr
/
src
/
contrib
/
llvm-project
/
llvm
/
include
/
llvm
/
MC
/
📁
..
📄
ConstantPools.h
(3.35 KB)
📄
LaneBitmask.h
(3.24 KB)
📄
MCAsmBackend.h
(8.09 KB)
📄
MCAsmInfo.h
(25.48 KB)
📄
MCAsmInfoCOFF.h
(900 B)
📄
MCAsmInfoDarwin.h
(927 B)
📄
MCAsmInfoELF.h
(711 B)
📄
MCAsmInfoWasm.h
(612 B)
📄
MCAsmInfoXCOFF.h
(792 B)
📄
MCAsmLayout.h
(3.75 KB)
📄
MCAsmMacro.h
(4.54 KB)
📄
MCAssembler.h
(16.1 KB)
📄
MCCodeEmitter.h
(1.53 KB)
📄
MCCodeView.h
(9.03 KB)
📄
MCContext.h
(31.99 KB)
📄
MCDirectives.h
(3.12 KB)
📁
MCDisassembler
📄
MCDwarf.h
(21.46 KB)
📄
MCELFObjectWriter.h
(5.27 KB)
📄
MCELFStreamer.h
(3.97 KB)
📄
MCExpr.h
(21.55 KB)
📄
MCFixedLenDisassembler.h
(1.39 KB)
📄
MCFixup.h
(7.4 KB)
📄
MCFixupKindInfo.h
(1.6 KB)
📄
MCFragment.h
(17.72 KB)
📄
MCInst.h
(6.06 KB)
📄
MCInstBuilder.h
(1.76 KB)
📄
MCInstPrinter.h
(5.88 KB)
📄
MCInstrAnalysis.h
(6.8 KB)
📄
MCInstrDesc.h
(25.13 KB)
📄
MCInstrInfo.h
(2.93 KB)
📄
MCInstrItineraries.h
(9.02 KB)
📄
MCLabel.h
(1.63 KB)
📄
MCLinkerOptimizationHint.h
(5.73 KB)
📄
MCMachObjectWriter.h
(9.77 KB)
📄
MCObjectFileInfo.h
(16.57 KB)
📄
MCObjectStreamer.h
(8.78 KB)
📄
MCObjectWriter.h
(4.44 KB)
📁
MCParser
📄
MCRegister.h
(4.16 KB)
📄
MCRegisterInfo.h
(28.96 KB)
📄
MCSchedule.h
(16.25 KB)
📄
MCSection.h
(6.52 KB)
📄
MCSectionCOFF.h
(3.37 KB)
📄
MCSectionELF.h
(3.3 KB)
📄
MCSectionMachO.h
(3.15 KB)
📄
MCSectionWasm.h
(2.78 KB)
📄
MCSectionXCOFF.h
(3.22 KB)
📄
MCStreamer.h
(43.55 KB)
📄
MCSubtargetInfo.h
(10.04 KB)
📄
MCSymbol.h
(13.8 KB)
📄
MCSymbolCOFF.h
(1.62 KB)
📄
MCSymbolELF.h
(1.45 KB)
📄
MCSymbolMachO.h
(4.18 KB)
📄
MCSymbolWasm.h
(4.28 KB)
📄
MCSymbolXCOFF.h
(2.39 KB)
📄
MCTargetOptions.h
(2.29 KB)
📄
MCTargetOptionsCommandFlags.h
(1.26 KB)
📄
MCValue.h
(2.42 KB)
📄
MCWasmObjectWriter.h
(1.61 KB)
📄
MCWasmStreamer.h
(2.83 KB)
📄
MCWin64EH.h
(2.41 KB)
📄
MCWinCOFFObjectWriter.h
(1.81 KB)
📄
MCWinCOFFStreamer.h
(3.05 KB)
📄
MCWinEH.h
(1.97 KB)
📄
MCXCOFFObjectWriter.h
(1.45 KB)
📄
MCXCOFFStreamer.h
(1.86 KB)
📄
MachineLocation.h
(2.04 KB)
📄
SectionKind.h
(7.53 KB)
📄
StringTableBuilder.h
(2.47 KB)
📄
SubtargetFeature.h
(7.12 KB)
Editing: MCAsmMacro.h
//===- MCAsmMacro.h - Assembly Macros ---------------------------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #ifndef LLVM_MC_MCASMMACRO_H #define LLVM_MC_MCASMMACRO_H #include "llvm/ADT/APInt.h" #include "llvm/ADT/StringRef.h" #include "llvm/Support/Debug.h" #include "llvm/Support/SMLoc.h" #include <vector> namespace llvm { /// Target independent representation for an assembler token. class AsmToken { public: enum TokenKind { // Markers Eof, Error, // String values. Identifier, String, // Integer values. Integer, BigNum, // larger than 64 bits // Real values. Real, // Comments Comment, HashDirective, // No-value. EndOfStatement, Colon, Space, Plus, Minus, Tilde, Slash, // '/' BackSlash, // '\' LParen, RParen, LBrac, RBrac, LCurly, RCurly, Star, Dot, Comma, Dollar, Equal, EqualEqual, Pipe, PipePipe, Caret, Amp, AmpAmp, Exclaim, ExclaimEqual, Percent, Hash, Less, LessEqual, LessLess, LessGreater, Greater, GreaterEqual, GreaterGreater, At, MinusGreater, // MIPS unary expression operators such as %neg. PercentCall16, PercentCall_Hi, PercentCall_Lo, PercentDtprel_Hi, PercentDtprel_Lo, PercentGot, PercentGot_Disp, PercentGot_Hi, PercentGot_Lo, PercentGot_Ofst, PercentGot_Page, PercentGottprel, PercentGp_Rel, PercentHi, PercentHigher, PercentHighest, PercentLo, PercentNeg, PercentPcrel_Hi, PercentPcrel_Lo, PercentTlsgd, PercentTlsldm, PercentTprel_Hi, PercentTprel_Lo }; private: TokenKind Kind; /// A reference to the entire token contents; this is always a pointer into /// a memory buffer owned by the source manager. StringRef Str; APInt IntVal; public: AsmToken() = default; AsmToken(TokenKind Kind, StringRef Str, APInt IntVal) : Kind(Kind), Str(Str), IntVal(std::move(IntVal)) {} AsmToken(TokenKind Kind, StringRef Str, int64_t IntVal = 0) : Kind(Kind), Str(Str), IntVal(64, IntVal, true) {} TokenKind getKind() const { return Kind; } bool is(TokenKind K) const { return Kind == K; } bool isNot(TokenKind K) const { return Kind != K; } SMLoc getLoc() const; SMLoc getEndLoc() const; SMRange getLocRange() const; /// Get the contents of a string token (without quotes). StringRef getStringContents() const { assert(Kind == String && "This token isn't a string!"); return Str.slice(1, Str.size() - 1); } /// Get the identifier string for the current token, which should be an /// identifier or a string. This gets the portion of the string which should /// be used as the identifier, e.g., it does not include the quotes on /// strings. StringRef getIdentifier() const { if (Kind == Identifier) return getString(); return getStringContents(); } /// Get the string for the current token, this includes all characters (for /// example, the quotes on strings) in the token. /// /// The returned StringRef points into the source manager's memory buffer, and /// is safe to store across calls to Lex(). StringRef getString() const { return Str; } // FIXME: Don't compute this in advance, it makes every token larger, and is // also not generally what we want (it is nicer for recovery etc. to lex 123br // as a single token, then diagnose as an invalid number). int64_t getIntVal() const { assert(Kind == Integer && "This token isn't an integer!"); return IntVal.getZExtValue(); } APInt getAPIntVal() const { assert((Kind == Integer || Kind == BigNum) && "This token isn't an integer!"); return IntVal; } void dump(raw_ostream &OS) const; }; struct MCAsmMacroParameter { StringRef Name; std::vector<AsmToken> Value; bool Required = false; bool Vararg = false; #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) void dump() const { dump(dbgs()); } LLVM_DUMP_METHOD void dump(raw_ostream &OS) const; #endif }; typedef std::vector<MCAsmMacroParameter> MCAsmMacroParameters; struct MCAsmMacro { StringRef Name; StringRef Body; MCAsmMacroParameters Parameters; public: MCAsmMacro(StringRef N, StringRef B, MCAsmMacroParameters P) : Name(N), Body(B), Parameters(std::move(P)) {} #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) void dump() const { dump(dbgs()); } LLVM_DUMP_METHOD void dump(raw_ostream &OS) const; #endif }; } // namespace llvm #endif
Upload File
Create Folder