MCTargetAsmParser.cpp 1007 B

1234567891011121314151617181920212223242526272829
  1. //===-- MCTargetAsmParser.cpp - Target Assembly Parser --------------------===//
  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. #include "llvm/MC/MCParser/MCTargetAsmParser.h"
  9. #include "llvm/MC/MCContext.h"
  10. using namespace llvm;
  11. MCTargetAsmParser::MCTargetAsmParser(MCTargetOptions const &MCOptions,
  12. const MCSubtargetInfo &STI,
  13. const MCInstrInfo &MII)
  14. : MCOptions(MCOptions), STI(&STI), MII(MII) {}
  15. MCTargetAsmParser::~MCTargetAsmParser() = default;
  16. MCSubtargetInfo &MCTargetAsmParser::copySTI() {
  17. MCSubtargetInfo &STICopy = getContext().getSubtargetCopy(getSTI());
  18. STI = &STICopy;
  19. return STICopy;
  20. }
  21. const MCSubtargetInfo &MCTargetAsmParser::getSTI() const {
  22. return *STI;
  23. }