summaryrefslogtreecommitdiffstats
path: root/include/llvm/CodeGen/AsmPrinter.h
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2007-10-14 05:57:21 +0000
committerEvan Cheng <evan.cheng@apple.com>2007-10-14 05:57:21 +0000
commit347d39f1fd8ad825a7ec5b8a3dce816723a56d42 (patch)
treeb53cc576e0aba064bc5630eb5a5eddb28ee58fd1 /include/llvm/CodeGen/AsmPrinter.h
parent296c1761416df3eb706dbcf5319f1f2267e1b4f7 (diff)
downloadexternal_llvm-347d39f1fd8ad825a7ec5b8a3dce816723a56d42.zip
external_llvm-347d39f1fd8ad825a7ec5b8a3dce816723a56d42.tar.gz
external_llvm-347d39f1fd8ad825a7ec5b8a3dce816723a56d42.tar.bz2
Revert 42908 for now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42960 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/AsmPrinter.h')
-rw-r--r--include/llvm/CodeGen/AsmPrinter.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/AsmPrinter.h b/include/llvm/CodeGen/AsmPrinter.h
index 70953be..0ca7cfc 100644
--- a/include/llvm/CodeGen/AsmPrinter.h
+++ b/include/llvm/CodeGen/AsmPrinter.h
@@ -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