Diff of /cmajor++/Cm/Cm.Core/CompilationUnit.cpp [r402] .. [r403] Maximize Restore

  Switch to side-by-side view

--- a/cmajor++/Cm/Cm.Core/CompilationUnit.cpp
+++ b/cmajor++/Cm/Cm.Core/CompilationUnit.cpp
@@ -19,6 +19,7 @@
 #include <Cm.Core/Flags.hpp>
 #include <Cm.Core/Class.hpp>
 #include <Cm.Core/Concept.hpp>
+#include <Cm.Core/DebugInfo.hpp>
 #include <Soul.Util/System.hpp>
 #include <boost/filesystem.hpp>
 #include <iostream>
@@ -463,13 +464,20 @@
                 assemble = true;
             }
         }
-        generatingIntermediateCode = false;
         if (memberFunctionIrFileCreated)
         {
             std::string memberFunctions = Soul::Util::ReadFile(memberFunctionIrFilePath);
             formatter.WriteLine(memberFunctions);
             remove(memberFunctionIrFilePath);
         }
+        if ((GetGlobalFlags() & GlobalFlags::generateDebugInfo) != GlobalFlags::none)
+        {
+            ClearDebugInfo();
+            GenerateDebugInfoFor(this);
+            WriteDebugInfo(formatter);
+            ClearDebugInfo();
+        }
+        generatingIntermediateCode = false;
     }
     catch (...)
     {