summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-07-22 04:40:02 +0000
committerChris Lattner <sabre@nondot.org>2001-07-22 04:40:02 +0000
commitaceb9132b7c0f2b22a2e51d523d0bd46f2cb3817 (patch)
treed3b24eb01110102a9649cfd973933c1b80ac27f7 /lib
parentc21d4fcb202b613e2ebe95684362b8c9b66d8034 (diff)
downloadllvm-aceb9132b7c0f2b22a2e51d523d0bd46f2cb3817.tar.gz
llvm-aceb9132b7c0f2b22a2e51d523d0bd46f2cb3817.tar.bz2
llvm-aceb9132b7c0f2b22a2e51d523d0bd46f2cb3817.tar.xz
Privatize LLCOptions. It had no business being visible to the entire
program. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/InstrSelection/InstrSelection.cpp29
-rw-r--r--lib/Target/SparcV9/InstrSelection/InstrSelection.cpp29
2 files changed, 20 insertions, 38 deletions
diff --git a/lib/CodeGen/InstrSelection/InstrSelection.cpp b/lib/CodeGen/InstrSelection/InstrSelection.cpp
index aac57575cb..4843a70dce 100644
--- a/lib/CodeGen/InstrSelection/InstrSelection.cpp
+++ b/lib/CodeGen/InstrSelection/InstrSelection.cpp
@@ -12,22 +12,20 @@
//*************************** User Include Files ***************************/
+#include "llvm/CodeGen/InstrSelection.h"
#include "llvm/Method.h"
#include "llvm/BasicBlock.h"
#include "llvm/Type.h"
#include "llvm/iMemory.h"
#include "llvm/Instruction.h"
#include "llvm/LLC/CompileContext.h"
-#include "llvm/CodeGen/InstrForest.h"
#include "llvm/CodeGen/MachineInstr.h"
-#include "llvm/CodeGen/InstrSelection.h"
//************************* Forward Declarations ***************************/
-static bool SelectInstructionsForTree (BasicTreeNode* treeRoot,
- int goalnt,
- CompileContext& ccontext);
+static bool SelectInstructionsForTree(BasicTreeNode* treeRoot, int goalnt,
+ CompileContext& ccontext);
//******************* Externally Visible Functions *************************/
@@ -38,10 +36,8 @@ static bool SelectInstructionsForTree (BasicTreeNode* treeRoot,
// Returns true if instruction selection failed, false otherwise.
//---------------------------------------------------------------------------
-bool
-SelectInstructionsForMethod(Method* method,
- CompileContext& ccontext)
-{
+bool SelectInstructionsForMethod(Method* method, CompileContext& ccontext,
+ int DebugLevel) {
bool failed = false;
InstrForest instrForest;
@@ -63,8 +59,7 @@ SelectInstructionsForMethod(Method* method,
// Invoke BURM to label each tree node with a state
(void) burm_label(basicNode);
- if (ccontext.getOptions().IntOptionValue(DEBUG_INSTR_SELECT_OPT)
- >= DEBUG_BURG_TREES)
+ if (DebugLevel >= DEBUG_BURG_TREES)
{
printcover(basicNode, 1, 0);
cerr << "\nCover cost == " << treecost(basicNode, 1, 0) << "\n\n";
@@ -81,8 +76,7 @@ SelectInstructionsForMethod(Method* method,
if (!failed)
{
- if ( ccontext.getOptions().IntOptionValue(DEBUG_INSTR_SELECT_OPT)
- >= DEBUG_INSTR_TREES)
+ if (DebugLevel >= DEBUG_INSTR_TREES)
{
cout << "\n\n*** Instruction trees for method "
<< (method->hasName()? method->getName() : "")
@@ -90,8 +84,8 @@ SelectInstructionsForMethod(Method* method,
instrForest.dump();
}
- if (ccontext.getOptions().IntOptionValue(DEBUG_INSTR_SELECT_OPT) > 0)
- PrintMachineInstructions(method, ccontext);
+ if (DebugLevel >= DEBUG_TREES_NONE)
+ PrintMachineInstructions(method);
}
return false;
@@ -139,10 +133,7 @@ FoldGetElemChain(const InstructionNode* getElemInstrNode,
}
-void
-PrintMachineInstructions(Method* method,
- CompileContext& ccontext)
-{
+void PrintMachineInstructions(Method* method) {
cout << "\n" << method->getReturnType()
<< " \"" << method->getName() << "\"" << endl;
diff --git a/lib/Target/SparcV9/InstrSelection/InstrSelection.cpp b/lib/Target/SparcV9/InstrSelection/InstrSelection.cpp
index aac57575cb..4843a70dce 100644
--- a/lib/Target/SparcV9/InstrSelection/InstrSelection.cpp
+++ b/lib/Target/SparcV9/InstrSelection/InstrSelection.cpp
@@ -12,22 +12,20 @@
//*************************** User Include Files ***************************/
+#include "llvm/CodeGen/InstrSelection.h"
#include "llvm/Method.h"
#include "llvm/BasicBlock.h"
#include "llvm/Type.h"
#include "llvm/iMemory.h"
#include "llvm/Instruction.h"
#include "llvm/LLC/CompileContext.h"
-#include "llvm/CodeGen/InstrForest.h"
#include "llvm/CodeGen/MachineInstr.h"
-#include "llvm/CodeGen/InstrSelection.h"
//************************* Forward Declarations ***************************/
-static bool SelectInstructionsForTree (BasicTreeNode* treeRoot,
- int goalnt,
- CompileContext& ccontext);
+static bool SelectInstructionsForTree(BasicTreeNode* treeRoot, int goalnt,
+ CompileContext& ccontext);
//******************* Externally Visible Functions *************************/
@@ -38,10 +36,8 @@ static bool SelectInstructionsForTree (BasicTreeNode* treeRoot,
// Returns true if instruction selection failed, false otherwise.
//---------------------------------------------------------------------------
-bool
-SelectInstructionsForMethod(Method* method,
- CompileContext& ccontext)
-{
+bool SelectInstructionsForMethod(Method* method, CompileContext& ccontext,
+ int DebugLevel) {
bool failed = false;
InstrForest instrForest;
@@ -63,8 +59,7 @@ SelectInstructionsForMethod(Method* method,
// Invoke BURM to label each tree node with a state
(void) burm_label(basicNode);
- if (ccontext.getOptions().IntOptionValue(DEBUG_INSTR_SELECT_OPT)
- >= DEBUG_BURG_TREES)
+ if (DebugLevel >= DEBUG_BURG_TREES)
{
printcover(basicNode, 1, 0);
cerr << "\nCover cost == " << treecost(basicNode, 1, 0) << "\n\n";
@@ -81,8 +76,7 @@ SelectInstructionsForMethod(Method* method,
if (!failed)
{
- if ( ccontext.getOptions().IntOptionValue(DEBUG_INSTR_SELECT_OPT)
- >= DEBUG_INSTR_TREES)
+ if (DebugLevel >= DEBUG_INSTR_TREES)
{
cout << "\n\n*** Instruction trees for method "
<< (method->hasName()? method->getName() : "")
@@ -90,8 +84,8 @@ SelectInstructionsForMethod(Method* method,
instrForest.dump();
}
- if (ccontext.getOptions().IntOptionValue(DEBUG_INSTR_SELECT_OPT) > 0)
- PrintMachineInstructions(method, ccontext);
+ if (DebugLevel >= DEBUG_TREES_NONE)
+ PrintMachineInstructions(method);
}
return false;
@@ -139,10 +133,7 @@ FoldGetElemChain(const InstructionNode* getElemInstrNode,
}
-void
-PrintMachineInstructions(Method* method,
- CompileContext& ccontext)
-{
+void PrintMachineInstructions(Method* method) {
cout << "\n" << method->getReturnType()
<< " \"" << method->getName() << "\"" << endl;