From 5a6074053d458159953f83dad078cbe315318314 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 16 Aug 2004 21:56:15 +0000 Subject: [PATCH] These files now live in lib/Target/SparcV9 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15831 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../llvm/CodeGen/MachineCodeForInstruction.h | 97 -------------- include/llvm/CodeGen/MachineFunctionInfo.h | 124 ------------------ 2 files changed, 221 deletions(-) delete mode 100644 include/llvm/CodeGen/MachineCodeForInstruction.h delete mode 100644 include/llvm/CodeGen/MachineFunctionInfo.h diff --git a/include/llvm/CodeGen/MachineCodeForInstruction.h b/include/llvm/CodeGen/MachineCodeForInstruction.h deleted file mode 100644 index 32935bba280..00000000000 --- a/include/llvm/CodeGen/MachineCodeForInstruction.h +++ /dev/null @@ -1,97 +0,0 @@ -//===-- llvm/CodeGen/MachineCodeForInstruction.h ----------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file was developed by the LLVM research group and is distributed under -// the University of Illinois Open Source License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// FIXME: This file is SparcV9 specific. Do not rely on this class for new -// targets, it will go away in the future. -// -// Representation of the sequence of machine instructions created for a single -// VM instruction. Additionally records information about hidden and implicit -// values used by the machine instructions: about hidden values used by the -// machine instructions: -// -// "Temporary values" are intermediate values used in the machine instruction -// sequence, but not in the VM instruction Note that such values should be -// treated as pure SSA values with no interpretation of their operands (i.e., as -// a TmpInstruction object which actually represents such a value). -// -// (2) "Implicit uses" are values used in the VM instruction but not in -// the machine instruction sequence -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_CODEGEN_MACHINECODE_FOR_INSTRUCTION_H -#define LLVM_CODEGEN_MACHINECODE_FOR_INSTRUCTION_H - -#include - -namespace llvm { - -class MachineInstr; -class Instruction; -class Value; -class CallArgsDescriptor; - - class MachineCodeForInstruction { - std::vector tempVec; // used by m/c instr but not VM instr - std::vector Contents; // the machine instr for this VM instr - CallArgsDescriptor* callArgsDesc; // only used for CALL instructions -public: - MachineCodeForInstruction() : callArgsDesc(NULL) {} - ~MachineCodeForInstruction(); - - static MachineCodeForInstruction &get(const Instruction *I); - static void destroy(const Instruction *I); - - // Access to underlying machine instructions... - typedef std::vector::iterator iterator; - typedef std::vector::const_iterator const_iterator; - - unsigned size() const { return Contents.size(); } - bool empty() const { return Contents.empty(); } - MachineInstr *front() const { return Contents.front(); } - MachineInstr *back() const { return Contents.back(); } - MachineInstr *&operator[](unsigned i) { return Contents[i]; } - MachineInstr *operator[](unsigned i) const { return Contents[i]; } - void pop_back() { Contents.pop_back(); } - - iterator begin() { return Contents.begin(); } - iterator end() { return Contents.end(); } - const_iterator begin() const { return Contents.begin(); } - const_iterator end() const { return Contents.end(); } - - template - void insert(iterator where, InIt first, InIt last) { - Contents.insert(where, first, last); - } - iterator erase(iterator where) { return Contents.erase(where); } - iterator erase(iterator s, iterator e) { return Contents.erase(s, e); } - - - // dropAllReferences() - This function drops all references within - // temporary (hidden) instructions created in implementing the original - // VM intruction. This ensures there are no remaining "uses" within - // these hidden instructions, before the values of a method are freed. - // - void dropAllReferences(); - - const std::vector &getTempValues() const { return tempVec; } - std::vector &getTempValues() { return tempVec; } - - MachineCodeForInstruction &addTemp(Value *tmp) { - tempVec.push_back(tmp); - return *this; - } - - void setCallArgsDescriptor(CallArgsDescriptor* desc) { callArgsDesc = desc; } - CallArgsDescriptor* getCallArgsDescriptor() const { return callArgsDesc; } -}; - -} // End llvm namespace - -#endif diff --git a/include/llvm/CodeGen/MachineFunctionInfo.h b/include/llvm/CodeGen/MachineFunctionInfo.h deleted file mode 100644 index 8afdc719e22..00000000000 --- a/include/llvm/CodeGen/MachineFunctionInfo.h +++ /dev/null @@ -1,124 +0,0 @@ -//===-- llvm/CodeGen/MachineFunctionInfo.h ----------------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file was developed by the LLVM research group and is distributed under -// the University of Illinois Open Source License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This class keeps track of information about the stack frame and about the -// per-function constant pool. -// -// FIXME: This class is completely SparcV9 specific. Do not use it for future -// targets. This file will be eliminated in future versions of LLVM. -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_CODEGEN_MACHINEFUNCTIONINFO_H -#define LLVM_CODEGEN_MACHINEFUNCTIONINFO_H - -#include "llvm/CodeGen/MachineCodeForInstruction.h" -#include "Support/HashExtras.h" -#include "Support/hash_set" - -namespace llvm { - -class MachineFunction; -class Constant; -class Type; - -class MachineFunctionInfo { - hash_set constantsForConstPool; - hash_map offsets; - - unsigned staticStackSize; - unsigned automaticVarsSize; - unsigned regSpillsSize; - unsigned maxOptionalArgsSize; - unsigned maxOptionalNumArgs; - unsigned currentTmpValuesSize; - unsigned maxTmpValuesSize; - bool compiledAsLeaf; - bool spillsAreaFrozen; - bool automaticVarsAreaFrozen; - - MachineFunction &MF; -public: - hash_map MCFIEntries; - - MachineFunctionInfo(MachineFunction &mf) : MF(mf) { - staticStackSize = automaticVarsSize = regSpillsSize = 0; - maxOptionalArgsSize = maxOptionalNumArgs = currentTmpValuesSize = 0; - maxTmpValuesSize = 0; - compiledAsLeaf = spillsAreaFrozen = automaticVarsAreaFrozen = false; - } - - /// CalculateArgSize - Call this method to fill in the maxOptionalArgsSize & - /// staticStackSize fields... - /// - void CalculateArgSize(); - - // - // Accessors for global information about generated code for a method. - // - bool isCompiledAsLeafMethod() const { return compiledAsLeaf; } - unsigned getStaticStackSize() const { return staticStackSize; } - unsigned getAutomaticVarsSize() const { return automaticVarsSize; } - unsigned getRegSpillsSize() const { return regSpillsSize; } - unsigned getMaxOptionalArgsSize() const { return maxOptionalArgsSize;} - unsigned getMaxOptionalNumArgs() const { return maxOptionalNumArgs;} - const hash_set &getConstantPoolValues() const { - return constantsForConstPool; - } - - // - // Modifiers used during code generation - // - void initializeFrameLayout (); - - void addToConstantPool (const Constant* constVal) { - constantsForConstPool.insert(constVal); - } - - void markAsLeafMethod() { compiledAsLeaf = true; } - - int computeOffsetforLocalVar (const Value* local, - unsigned& getPaddedSize, - unsigned sizeToUse = 0); - int allocateLocalVar (const Value* local, - unsigned sizeToUse = 0); - - int allocateSpilledValue (const Type* type); - int pushTempValue (unsigned size); - void popAllTempValues (); - - void freezeSpillsArea () { spillsAreaFrozen = true; } - void freezeAutomaticVarsArea () { automaticVarsAreaFrozen=true; } - -private: - void incrementAutomaticVarsSize(int incr) { - automaticVarsSize+= incr; - staticStackSize += incr; - } - void incrementRegSpillsSize(int incr) { - regSpillsSize+= incr; - staticStackSize += incr; - } - void incrementTmpAreaSize(int incr) { - currentTmpValuesSize += incr; - if (maxTmpValuesSize < currentTmpValuesSize) - { - staticStackSize += currentTmpValuesSize - maxTmpValuesSize; - maxTmpValuesSize = currentTmpValuesSize; - } - } - void resetTmpAreaSize() { - currentTmpValuesSize = 0; - } - int allocateOptionalArg(const Type* type); -}; - -} // End llvm namespace - -#endif -- 2.34.1