diff options
author | Eric Christopher <echristo@gmail.com> | 2015-03-20 16:03:39 +0000 |
---|---|---|
committer | Eric Christopher <echristo@gmail.com> | 2015-03-20 16:03:39 +0000 |
commit | d43c5c75b63d6f6f01b3469e37a85b6d82471ca7 (patch) | |
tree | 95d9a7832e04fbd5b841714705dbc3f55c71263b /llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp | |
parent | c83fa9e9ebb80d4a848d3c9ed32f5591b07f2d1a (diff) | |
download | bcm5719-llvm-d43c5c75b63d6f6f01b3469e37a85b6d82471ca7.tar.gz bcm5719-llvm-d43c5c75b63d6f6f01b3469e37a85b6d82471ca7.zip |
At the beginning of doFinalization set the MachineFunction to
nullptr so that users get an earlier dereferencing error and
so that we can use it to conditionalize access to MachineFunction
specific data.
llvm-svn: 232820
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index 7de5e4f10f1..098e7989e94 100644 --- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -1004,6 +1004,11 @@ void AsmPrinter::emitGlobalGOTEquivs() { } bool AsmPrinter::doFinalization(Module &M) { + // Set the MachineFunction to nullptr so that we can catch attempted + // accesses to MF specific features at the module level and so that + // we can conditionalize accesses based on whether or not it is nullptr. + MF = nullptr; + // Gather all GOT equivalent globals in the module. We really need two // passes over the globals: one to compute and another to avoid its emission // in EmitGlobalVariable, otherwise we would not be able to handle cases |