Don't attribute in file headers anymore. See llvmdev for the
[oota-llvm.git] / include / llvm / CodeGen / AsmPrinter.h
index 70953bea675334f3309f23013f87f12f3b3995b1..419f1703a4ba7eb2cdff522516bd36fae97234df 100644 (file)
@@ -2,8 +2,8 @@
 //
 //                     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 file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 //
@@ -36,6 +36,13 @@ namespace llvm {
   class AsmPrinter : public MachineFunctionPass {
     static char ID;
 
+    /// FunctionNumber - This provides a unique ID for each function emitted in
+    /// this translation unit.  It is autoincremented by SetupMachineFunction,
+    /// and can be accessed with getFunctionNumber() and 
+    /// IncrementFunctionNumber().
+    ///
+    unsigned FunctionNumber;
+
   protected:
     // Necessary for external weak linkage support
     std::set<const GlobalValue*> ExtWeakSymbols;
@@ -153,6 +160,15 @@ namespace llvm {
     /// is being processed from runOnMachineFunction.
     void SetupMachineFunction(MachineFunction &MF);
     
+    /// getFunctionNumber - Return a unique ID for the current function.
+    ///
+    unsigned getFunctionNumber() const { return FunctionNumber; }
+    
+    /// IncrementFunctionNumber - Increase Function Number.  AsmPrinters should
+    /// not normally call this, as the counter is automatically bumped by
+    /// SetupMachineFunction.
+    void IncrementFunctionNumber() { FunctionNumber++; }
+    
     /// EmitConstantPool - Print to the current output stream assembly
     /// representations of the constants in the constant pool MCP. This is
     /// used to print out constants which have been "spilled to memory" by
@@ -270,8 +286,8 @@ namespace llvm {
     void EmitConstantValueOnly(const Constant *CV);
 
     /// EmitGlobalConstant - Print a general LLVM constant to the .s file.
-    ///
-    void EmitGlobalConstant(const Constant* CV);
+    /// If Packed is false, pad to the ABI size.
+    void EmitGlobalConstant(const Constant* CV, bool Packed = false);
 
     virtual void EmitMachineConstantPoolValue(MachineConstantPoolValue *MCPV);
     
@@ -289,12 +305,16 @@ namespace llvm {
                                       bool printColon = false,
                                       bool printComment = true) const;
                                       
-    /// printSetLabel - This method prints a set label for the specified
-    /// MachineBasicBlock
-    void printSetLabel(unsigned uid, const MachineBasicBlock *MBB) const;
-    void printSetLabel(unsigned uid, unsigned uid2,
-                       const MachineBasicBlock *MBB) const;
-
+    /// printPICJumpTableSetLabel - This method prints a set label for the
+    /// specified MachineBasicBlock for a jumptable entry.
+    virtual void printPICJumpTableSetLabel(unsigned uid,
+                                           const MachineBasicBlock *MBB) const;
+    virtual void printPICJumpTableSetLabel(unsigned uid, unsigned uid2,
+                                           const MachineBasicBlock *MBB) const;
+    virtual void printPICJumpTableEntry(const MachineJumpTableInfo *MJTI,
+                                        const MachineBasicBlock *MBB,
+                                        unsigned uid) const;
+    
     /// printDataDirective - This method prints the asm directive for the
     /// specified type.
     void printDataDirective(const Type *type);