[llvm-commits] [llvm] r151041 - in /llvm/trunk: include/llvm/MC/MCRegisterInfo.h utils/TableGen/RegisterInfoEmitter.cpp
Craig Topper
craig.topper at gmail.com
Mon Feb 20 22:54:41 PST 2012
Author: ctopper
Date: Tue Feb 21 00:54:41 2012
New Revision: 151041
URL: http://llvm.org/viewvc/llvm-project?rev=151041&view=rev
Log:
In generated RegisterInfo files, replace a pointer to the end of an array with just the size of the array to avoid relocations.
Modified:
llvm/trunk/include/llvm/MC/MCRegisterInfo.h
llvm/trunk/utils/TableGen/RegisterInfoEmitter.cpp
Modified: llvm/trunk/include/llvm/MC/MCRegisterInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCRegisterInfo.h?rev=151041&r1=151040&r2=151041&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCRegisterInfo.h (original)
+++ llvm/trunk/include/llvm/MC/MCRegisterInfo.h Tue Feb 21 00:54:41 2012
@@ -33,7 +33,8 @@
const unsigned RegSize, Alignment; // Size & Alignment of register in bytes
const int CopyCost;
const bool Allocatable;
- const iterator RegsBegin, RegsEnd;
+ const iterator RegsBegin;
+ unsigned RegsSize;
const unsigned char *const RegSet;
const unsigned RegSetSize;
@@ -48,11 +49,11 @@
/// begin/end - Return all of the registers in this class.
///
iterator begin() const { return RegsBegin; }
- iterator end() const { return RegsEnd; }
+ iterator end() const { return RegsBegin + RegsSize; }
/// getNumRegs - Return the number of registers in this class.
///
- unsigned getNumRegs() const { return (unsigned)(RegsEnd-RegsBegin); }
+ unsigned getNumRegs() const { return RegsSize; }
/// getRegister - Return the specified register in the class.
///
Modified: llvm/trunk/utils/TableGen/RegisterInfoEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/RegisterInfoEmitter.cpp?rev=151041&r1=151040&r2=151041&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/RegisterInfoEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/RegisterInfoEmitter.cpp Tue Feb 21 00:54:41 2012
@@ -391,10 +391,8 @@
<< RC.SpillAlignment/8 << ", "
<< RC.CopyCost << ", "
<< RC.Allocatable << ", "
- << RC.getName() << ", " << RC.getName() << " + "
- << RC.getOrder().size() << ", "
- << RC.getName() << "Bits, sizeof(" << RC.getName() << "Bits)"
- << " },\n";
+ << RC.getName() << ", " << RC.getOrder().size() << ", "
+ << RC.getName() << "Bits, sizeof(" << RC.getName() << "Bits) },\n";
}
OS << "};\n\n";
More information about the llvm-commits
mailing list