Code cleanup associated with jump tables, thanks to Chris for noticing
authorNate Begeman <natebegeman@mac.com>
Sat, 22 Apr 2006 23:52:35 +0000 (23:52 +0000)
committerNate Begeman <natebegeman@mac.com>
Sat, 22 Apr 2006 23:52:35 +0000 (23:52 +0000)
these.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27950 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/MachineCodeEmitter.h
include/llvm/CodeGen/MachineJumpTableInfo.h
lib/CodeGen/MachineFunction.cpp

index f4b7c2290d89bfedbd3beda52f0fbf194c8ebd52..eba7bae8acc55c4100334b1f5c1e2c0a548ca74f 100644 (file)
@@ -102,14 +102,14 @@ public:
   /// noted with this interface.
   virtual void addRelocation(const MachineRelocation &MR) = 0;
 
-  // getConstantPoolEntryAddress - Return the address of the 'Index' entry in
-  // the constant pool that was last emitted with the 'emitConstantPool' method.
-  //
+  /// getConstantPoolEntryAddress - Return the address of the 'Index' entry in
+  /// the constant pool that was last emitted with the emitConstantPool method.
+  ///
   virtual uint64_t getConstantPoolEntryAddress(unsigned Index) = 0;
 
-  // getJumpTablelEntryAddress - Return the address of the jump table with index
-  // 'Index' in the function that last called initJumpTableInfo.
-  //
+  /// getJumpTableEntryAddress - Return the address of the jump table with index
+  /// 'Index' in the function that last called initJumpTableInfo.
+  ///
   virtual uint64_t getJumpTableEntryAddress(unsigned Index) = 0;
   
   // allocateGlobal - Allocate some space for a global variable.
index 192fb655429492d33ae4deef80747d8879c4becb..2cb268ad539921460e8a672671e2a3a214cd7deb 100644 (file)
@@ -20,7 +20,6 @@
 #ifndef LLVM_CODEGEN_MACHINEJUMPTABLEINFO_H
 #define LLVM_CODEGEN_MACHINEJUMPTABLEINFO_H
 
-#include "llvm/Target/TargetData.h"
 #include <vector>
 #include <iosfwd>
 
@@ -55,8 +54,11 @@ public:
     return JumpTables;
   }
   
-  unsigned getEntrySize() const { return TD.getPointerSize(); }
-  unsigned getAlignment() const { return TD.getPointerAlignment(); }
+  /// getEntrySize - returns the size of an individual field in a jump table 
+  unsigned getEntrySize() const;
+  
+  /// getAlignment - returns the target's preferred alignment for jump tables
+  unsigned getAlignment() const;
   
   /// print - Used by the MachineFunction printer to print information about
   /// jump tables.  Implemented in MachineFunction.cpp
index da89ea1821fcb6ae6edd53094644d944618e1bd5..6d66839e2fb86420c5e65f054875909c1796a4f8 100644 (file)
@@ -366,6 +366,14 @@ void MachineJumpTableInfo::print(std::ostream &OS) const {
   }
 }
 
+unsigned MachineJumpTableInfo::getEntrySize() const { 
+  return TD.getPointerSize(); 
+}
+
+unsigned MachineJumpTableInfo::getAlignment() const { 
+  return TD.getPointerAlignment(); 
+}
+
 void MachineJumpTableInfo::dump() const { print(std::cerr); }