//===---- MipsOs16.cpp for Mips Option -Os16 --------===// // // 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 // //===----------------------------------------------------------------------===// // // This file defines an optimization phase for the MIPS target. // //===----------------------------------------------------------------------===// #include "Mips.h" #include "llvm/IR/Instructions.h" #include "llvm/IR/Module.h" #include "llvm/Pass.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" #include "llvm/Support/raw_ostream.h" usingnamespacellvm; #define DEBUG_TYPE … static cl::opt<std::string> Mips32FunctionMask( "mips32-function-mask", cl::init(""), cl::desc("Force function to be mips32"), cl::Hidden); namespace { class MipsOs16 : public ModulePass { … }; char MipsOs16::ID = …; } // Figure out if we need float point based on the function signature. // We need to move variables in and/or out of floating point // registers because of the ABI // static bool needsFPFromSig(Function &F) { … } // Figure out if the function will need floating point operations // static bool needsFP(Function &F) { … } bool MipsOs16::runOnModule(Module &M) { … } ModulePass *llvm::createMipsOs16Pass() { … }