From 7414f541ca5aae6f2eb2ac685e3175ded00d7d8c Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 6 Jan 2008 01:52:22 +0000 Subject: [PATCH] improve const correctness. llvm-svn: 45646 --- utils/TableGen/CodeGenDAGPatterns.cpp | 2 +- utils/TableGen/CodeGenDAGPatterns.h | 2 +- utils/TableGen/DAGISelEmitter.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/utils/TableGen/CodeGenDAGPatterns.cpp b/utils/TableGen/CodeGenDAGPatterns.cpp index 670a138cb54..7e2830782f1 100644 --- a/utils/TableGen/CodeGenDAGPatterns.cpp +++ b/utils/TableGen/CodeGenDAGPatterns.cpp @@ -1661,7 +1661,7 @@ void CodeGenDAGPatterns::ParseInstructions() { for (std::map::iterator II = Instructions.begin(), E = Instructions.end(); II != E; ++II) { DAGInstruction &TheInst = II->second; - TreePattern *I = TheInst.getPattern(); + const TreePattern *I = TheInst.getPattern(); if (I == 0) continue; // No pattern. // FIXME: Assume only the first tree is the pattern. The others are clobber diff --git a/utils/TableGen/CodeGenDAGPatterns.h b/utils/TableGen/CodeGenDAGPatterns.h index 4097079c4cf..c40f46f4596 100644 --- a/utils/TableGen/CodeGenDAGPatterns.h +++ b/utils/TableGen/CodeGenDAGPatterns.h @@ -374,7 +374,7 @@ public: ImpResults(impresults), ImpOperands(impoperands), ResultPattern(0) {} - TreePattern *getPattern() const { return Pattern; } + const TreePattern *getPattern() const { return Pattern; } unsigned getNumResults() const { return Results.size(); } unsigned getNumOperands() const { return Operands.size(); } unsigned getNumImpResults() const { return ImpResults.size(); } diff --git a/utils/TableGen/DAGISelEmitter.cpp b/utils/TableGen/DAGISelEmitter.cpp index b0eada86b5b..bd8d21058de 100644 --- a/utils/TableGen/DAGISelEmitter.cpp +++ b/utils/TableGen/DAGISelEmitter.cpp @@ -827,7 +827,7 @@ public: const CodeGenTarget &CGT = CGP.getTargetInfo(); CodeGenInstruction &II = CGT.getInstruction(Op->getName()); const DAGInstruction &Inst = CGP.getInstruction(Op); - TreePattern *InstPat = Inst.getPattern(); + const TreePattern *InstPat = Inst.getPattern(); // FIXME: Assume actual pattern comes before "implicit". TreePatternNode *InstPatNode = isRoot ? (InstPat ? InstPat->getTree(0) : Pattern)