diff options
author | Pedro Artigas <partigas@apple.com> | 2012-12-06 22:12:44 +0000 |
---|---|---|
committer | Pedro Artigas <partigas@apple.com> | 2012-12-06 22:12:44 +0000 |
commit | 873a1dd7d679ac9a9a92a93a4d2bbb157878efb4 (patch) | |
tree | 721b9de1e14f39167f2a0793a82f18a783d79463 /include/llvm/MC/MCContext.h | |
parent | 5b4af8b52af2cb9e15c89a0e01686f2ed9127d86 (diff) | |
download | external_llvm-873a1dd7d679ac9a9a92a93a4d2bbb157878efb4.zip external_llvm-873a1dd7d679ac9a9a92a93a4d2bbb157878efb4.tar.gz external_llvm-873a1dd7d679ac9a9a92a93a4d2bbb157878efb4.tar.bz2 |
fixed valgrind issues of prior commit, this change applies r169456 changes back to the tree with fixes. on darwin no valgrind issues exist in the tests that used to fail.
original change description:
change MCContext to work on the doInitialization/doFinalization model
reviewed by Evan Cheng <evan.cheng@apple.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169553 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/MC/MCContext.h')
-rw-r--r-- | include/llvm/MC/MCContext.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/include/llvm/MC/MCContext.h b/include/llvm/MC/MCContext.h index 78870d9..111ad48 100644 --- a/include/llvm/MC/MCContext.h +++ b/include/llvm/MC/MCContext.h @@ -137,11 +137,16 @@ namespace llvm { void *MachOUniquingMap, *ELFUniquingMap, *COFFUniquingMap; + /// Do automatic initialization in constructor and finalization in + /// destructor + bool AutoInitializationFinalization; + MCSymbol *CreateSymbol(StringRef Name); public: explicit MCContext(const MCAsmInfo &MAI, const MCRegisterInfo &MRI, - const MCObjectFileInfo *MOFI, const SourceMgr *Mgr = 0); + const MCObjectFileInfo *MOFI, const SourceMgr *Mgr = 0, + bool AutoInitializationFinalization = true); ~MCContext(); const SourceMgr *getSourceManager() const { return SrcMgr; } @@ -154,6 +159,17 @@ namespace llvm { void setAllowTemporaryLabels(bool Value) { AllowTemporaryLabels = Value; } + /// @name Module Lifetime Management + /// @{ + + /// doInitialization - prepare to process a new module + void doInitialization(); + + /// doFinalization - clean up state from the current module + void doFinalization(); + + /// @} + /// @name Symbol Management /// @{ |