X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FCodeGen%2FMachineFunction.h;h=09cc1e5dfb897f7bd70d51a206a26cb1bdd22777;hb=d8324e6983d06c3d56debcbfdc9ead0e0d4a817d;hp=cd704c1c53b4480392979e88bf1934cc32e9fad8;hpb=f1d015f3429f611c423f943c75f86e6823810dc3;p=oota-llvm.git diff --git a/include/llvm/CodeGen/MachineFunction.h b/include/llvm/CodeGen/MachineFunction.h index cd704c1c53b..09cc1e5dfb8 100644 --- a/include/llvm/CodeGen/MachineFunction.h +++ b/include/llvm/CodeGen/MachineFunction.h @@ -131,6 +131,9 @@ class MachineFunction { /// about the control flow of such functions. bool ExposesReturnsTwice; + /// True if the function includes any inline assembly. + bool HasInlineAsm; + MachineFunction(const MachineFunction &) LLVM_DELETED_FUNCTION; void operator=(const MachineFunction&) LLVM_DELETED_FUNCTION; public: @@ -214,6 +217,16 @@ public: void setExposesReturnsTwice(bool B) { ExposesReturnsTwice = B; } + + /// Returns true if the function contains any inline assembly. + bool hasInlineAsm() const { + return HasInlineAsm; + } + + /// Set a flag that indicates that the function contains inline assembly. + void setHasInlineAsm(bool B) { + HasInlineAsm = B; + } /// getInfo - Keep track of various per-function pieces of information for /// backends that would like to do so. @@ -338,8 +351,8 @@ public: // Internal functions used to automatically number MachineBasicBlocks // - /// getNextMBBNumber - Returns the next unique number to be assigned - /// to a MachineBasicBlock in this MachineFunction. + /// \brief Adds the MBB to the internal numbering. Returns the unique number + /// assigned to the MBB. /// unsigned addToMBBNumbering(MachineBasicBlock *MBB) { MBBNumbering.push_back(MBB); @@ -413,6 +426,15 @@ public: OperandRecycler.deallocate(Cap, Array); } + /// \brief Allocate and initialize a register mask with @p NumRegister bits. + uint32_t *allocateRegisterMask(unsigned NumRegister) { + unsigned Size = (NumRegister + 31) / 32; + uint32_t *Mask = Allocator.Allocate(Size); + for (unsigned i = 0; i != Size; ++i) + Mask[i] = 0; + return Mask; + } + /// allocateMemRefsArray - Allocate an array to hold MachineMemOperand /// pointers. This array is owned by the MachineFunction. MachineInstr::mmo_iterator allocateMemRefsArray(unsigned long Num);