aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/CodeGen/MachineFunction.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-01-26 04:35:26 +0000
committerChris Lattner <sabre@nondot.org>2010-01-26 04:35:26 +0000
commitb84822fb7b64977c16e97b870891da1d6c9736fe (patch)
treefb43db9cabf515f2751c5c0aeb5e362a63fbc017 /include/llvm/CodeGen/MachineFunction.h
parentb8da4ac698dbb219e093b3159e2b5519063b011c (diff)
make MachineFunction keep track of its ID and make
MachineFunctionAnalysis dole them out, instead of having AsmPrinter do both. Have the AsmPrinter::SetupMachineFunction method set the 'AsmPrinter::MF' variable. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94509 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/MachineFunction.h')
-rw-r--r--include/llvm/CodeGen/MachineFunction.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/include/llvm/CodeGen/MachineFunction.h b/include/llvm/CodeGen/MachineFunction.h
index d2e89acc7c..85e4fb4e11 100644
--- a/include/llvm/CodeGen/MachineFunction.h
+++ b/include/llvm/CodeGen/MachineFunction.h
@@ -112,6 +112,11 @@ class MachineFunction {
// Tracks debug locations.
DebugLocTracker DebugLocInfo;
+ /// FunctionNumber - This provides a unique ID for each function emitted in
+ /// this translation unit.
+ ///
+ unsigned FunctionNumber;
+
// The alignment of the function.
unsigned Alignment;
@@ -119,13 +124,17 @@ class MachineFunction {
void operator=(const MachineFunction&); // intentionally unimplemented
public:
- MachineFunction(Function *Fn, const TargetMachine &TM);
+ MachineFunction(Function *Fn, const TargetMachine &TM, unsigned FunctionNum);
~MachineFunction();
/// getFunction - Return the LLVM function that this machine code represents
///
Function *getFunction() const { return Fn; }
+ /// getFunctionNumber - Return a unique ID for the current function.
+ ///
+ unsigned getFunctionNumber() const { return FunctionNumber; }
+
/// getTarget - Return the target machine this machine code is compiled with
///
const TargetMachine &getTarget() const { return Target; }