aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/CodeGen
diff options
context:
space:
mode:
authorAndrew Trick <atrick@apple.com>2012-02-04 02:56:45 +0000
committerAndrew Trick <atrick@apple.com>2012-02-04 02:56:45 +0000
commit7461334084aa77286b6f9af596fb0f6ba0465685 (patch)
treea4b8dfa2062e677f30ef79d81591a892899f09fd /include/llvm/CodeGen
parent2b2c7b9c5256d7cfc7786ed8012bc90c3d50c176 (diff)
Make TargetPassConfig an ImmutablePass so CodeGenPasses can query options
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149752 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen')
-rw-r--r--include/llvm/CodeGen/Passes.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/include/llvm/CodeGen/Passes.h b/include/llvm/CodeGen/Passes.h
index 627568a4e4..308026dd86 100644
--- a/include/llvm/CodeGen/Passes.h
+++ b/include/llvm/CodeGen/Passes.h
@@ -15,6 +15,7 @@
#ifndef LLVM_CODEGEN_PASSES_H
#define LLVM_CODEGEN_PASSES_H
+#include "llvm/Pass.h"
#include "llvm/Target/TargetMachine.h"
#include <string>
@@ -32,9 +33,12 @@ namespace llvm {
/// Target-Independent Code Generator Pass Configuration Options.
///
+/// This is an ImmutablePass solely for the purpose of exposing CodeGen options
+/// to the internals of other CodeGen passes.
+///
/// FIXME: Why are we passing the DisableVerify flags around instead of setting
/// an options in the target machine, like all the other driver options?
-class TargetPassConfig {
+class TargetPassConfig : public ImmutablePass {
protected:
TargetMachine *TM;
PassManagerBase &PM;
@@ -43,8 +47,12 @@ protected:
public:
TargetPassConfig(TargetMachine *tm, PassManagerBase &pm,
bool DisableVerifyFlag);
+ // Dummy constructor.
+ TargetPassConfig();
+
+ virtual ~TargetPassConfig();
- virtual ~TargetPassConfig() {}
+ static char ID;
/// Get the right type of TargetMachine for this target.
template<typename TMC> TMC &getTM() const {