aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/CodeGen/MachineFunction.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-03-13 20:55:24 +0000
committerChris Lattner <sabre@nondot.org>2010-03-13 20:55:24 +0000
commit11d53c129fc9c2a4510605ec0a1696f58750af52 (patch)
treeaad97e04fdcaa0f1ea6cc6cbacdd11994c8c746b /include/llvm/CodeGen/MachineFunction.h
parent355471741b00fbdb0085c6a24b1fdce0c78e84f3 (diff)
downloadexternal_llvm-11d53c129fc9c2a4510605ec0a1696f58750af52.tar.gz
external_llvm-11d53c129fc9c2a4510605ec0a1696f58750af52.tar.bz2
external_llvm-11d53c129fc9c2a4510605ec0a1696f58750af52.zip
rearrange MCContext ownership. Before LLVMTargetMachine created it
and passing off ownership to AsmPrinter. Now MachineModuleInfo creates it and owns it by value. This allows us to use MCSymbols more consistently throughout the rest of the code generator, and simplifies a bit of code. This also allows MachineFunction to keep an MCContext reference handy, and cleans up the TargetRegistry interfaces for AsmPrinters. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98450 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/MachineFunction.h')
-rw-r--r--include/llvm/CodeGen/MachineFunction.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/include/llvm/CodeGen/MachineFunction.h b/include/llvm/CodeGen/MachineFunction.h
index 3c5b466da7..f6129fb69a 100644
--- a/include/llvm/CodeGen/MachineFunction.h
+++ b/include/llvm/CodeGen/MachineFunction.h
@@ -71,6 +71,7 @@ struct MachineFunctionInfo {
class MachineFunction {
Function *Fn;
const TargetMachine &Target;
+ MCContext &Ctx;
// RegInfo - Information about each register in use in the function.
MachineRegisterInfo *RegInfo;
@@ -121,13 +122,16 @@ class MachineFunction {
// The alignment of the function.
unsigned Alignment;
- MachineFunction(const MachineFunction &); // intentionally unimplemented
- void operator=(const MachineFunction&); // intentionally unimplemented
+ MachineFunction(const MachineFunction &); // DO NOT IMPLEMENT
+ void operator=(const MachineFunction&); // DO NOT IMPLEMENT
public:
- MachineFunction(Function *Fn, const TargetMachine &TM, unsigned FunctionNum);
+ MachineFunction(Function *Fn, const TargetMachine &TM, unsigned FunctionNum,
+ MCContext &Ctx);
~MachineFunction();
+ MCContext &getContext() const { return Ctx; }
+
/// getFunction - Return the LLVM function that this machine code represents
///
Function *getFunction() const { return Fn; }