[llvm] r232820 - At the beginning of doFinalization set the MachineFunction to

Eric Christopher echristo at gmail.com
Fri Mar 20 09:03:39 PDT 2015


Author: echristo
Date: Fri Mar 20 11:03:39 2015
New Revision: 232820

URL: http://llvm.org/viewvc/llvm-project?rev=232820&view=rev
Log:
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.

Modified:
    llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=232820&r1=232819&r2=232820&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Fri Mar 20 11:03:39 2015
@@ -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





More information about the llvm-commits mailing list