When creating MCAsmBackend pass the CPU string as well. In X86AsmBackend
[oota-llvm.git] / include / llvm / Support / LeakDetector.h
index b39e0b591106adf9311669413ae4a5bfb5cee15a..501a9db72c154b437c5d776f2777b7d218f4f502 100644 (file)
@@ -1,10 +1,10 @@
-//===-- Support/LeakDetector.h - Provide simple leak detection --*- C++ -*-===//
-// 
+//===-- llvm/Support/LeakDetector.h - Provide leak detection ----*- C++ -*-===//
+//
 //                     The LLVM Compiler Infrastructure
 //
-// This file was developed by the LLVM research group and is distributed under
-// the University of Illinois Open Source License. See LICENSE.TXT for details.
-// 
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
 //===----------------------------------------------------------------------===//
 //
 // This file defines a class that can be used to provide very simple memory leak
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef SUPPORT_LEAKDETECTOR_H
-#define SUPPORT_LEAKDETECTOR_H
+#ifndef LLVM_SUPPORT_LEAKDETECTOR_H
+#define LLVM_SUPPORT_LEAKDETECTOR_H
 
 #include <string>
+
+namespace llvm {
+
+class LLVMContext;
 class Value;
 
 struct LeakDetector {
@@ -45,7 +49,7 @@ struct LeakDetector {
     removeGarbageObjectImpl(Object);
 #endif
   }
-  
+
   /// checkForGarbage - Traverse the internal representation of garbage
   /// pointers.  If there are any pointers that have been add'ed, but not
   /// remove'd, big obnoxious warnings about memory leaks are issued.
@@ -53,9 +57,9 @@ struct LeakDetector {
   /// The specified message will be printed indicating when the check was
   /// performed.
   ///
-  static void checkForGarbage(const std::string &Message) {
+  static void checkForGarbage(LLVMContext &C, const std::string &Message) {
 #ifndef NDEBUG
-    checkForGarbageImpl(Message);
+    checkForGarbageImpl(C, Message);
 #endif
   }
 
@@ -80,7 +84,9 @@ private:
   static void removeGarbageObjectImpl(const Value *Object);
   static void addGarbageObjectImpl(void *Object);
   static void removeGarbageObjectImpl(void *Object);
-  static void checkForGarbageImpl(const std::string &Message);
+  static void checkForGarbageImpl(LLVMContext &C, const std::string &Message);
 };
 
+} // End llvm namespace
+
 #endif