[PGO] Fix remaining bugs in ProfData template file (when used by compiler-rt)
[oota-llvm.git] / include / llvm / PassSupport.h
index 449bc928108410e845694ce9887cb3b3d7c07674..7c3d49f02e8fb1f6a0d0f8870e536c4213702161 100644 (file)
@@ -26,7 +26,7 @@
 #include "llvm/PassInfo.h"
 #include "llvm/PassRegistry.h"
 #include "llvm/Support/Atomic.h"
-#include "llvm/Support/Valgrind.h"
+#include "llvm/Support/Compiler.h"
 #include <vector>
 
 namespace llvm {
@@ -82,6 +82,15 @@ class TargetMachine;
     CALL_ONCE_INITIALIZATION(initialize##passName##PassOnce) \
   }
 
+#define INITIALIZE_PASS_WITH_OPTIONS(PassName, Arg, Name, Cfg, Analysis) \
+  INITIALIZE_PASS_BEGIN(PassName, Arg, Name, Cfg, Analysis) \
+  PassName::registerOptions(); \
+  INITIALIZE_PASS_END(PassName, Arg, Name, Cfg, Analysis)
+
+#define INITIALIZE_PASS_WITH_OPTIONS_BEGIN(PassName, Arg, Name, Cfg, Analysis) \
+  INITIALIZE_PASS_BEGIN(PassName, Arg, Name, Cfg, Analysis) \
+  PassName::registerOptions(); \
+
 template<typename PassName>
 Pass *callDefaultCtor() { return new PassName(); }