summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorNate Begeman <natebegeman@mac.com>2006-04-22 23:52:35 +0000
committerNate Begeman <natebegeman@mac.com>2006-04-22 23:52:35 +0000
commit3e04bb482bd6b7817bb8dea9061e1d9f2cc1ac79 (patch)
tree0e4173992c8d881fa0a6d9164ebe82000cddaff2 /llvm
parentecb1dafd3d252399f29e8326753be48be95335a0 (diff)
downloadbcm5719-llvm-3e04bb482bd6b7817bb8dea9061e1d9f2cc1ac79.tar.gz
bcm5719-llvm-3e04bb482bd6b7817bb8dea9061e1d9f2cc1ac79.zip
Code cleanup associated with jump tables, thanks to Chris for noticing
these. llvm-svn: 27950
Diffstat (limited to 'llvm')
-rw-r--r--llvm/include/llvm/CodeGen/MachineCodeEmitter.h12
-rw-r--r--llvm/include/llvm/CodeGen/MachineJumpTableInfo.h8
-rw-r--r--llvm/lib/CodeGen/MachineFunction.cpp8
3 files changed, 19 insertions, 9 deletions
diff --git a/llvm/include/llvm/CodeGen/MachineCodeEmitter.h b/llvm/include/llvm/CodeGen/MachineCodeEmitter.h
index f4b7c2290d8..eba7bae8acc 100644
--- a/llvm/include/llvm/CodeGen/MachineCodeEmitter.h
+++ b/llvm/include/llvm/CodeGen/MachineCodeEmitter.h
@@ -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.
diff --git a/llvm/include/llvm/CodeGen/MachineJumpTableInfo.h b/llvm/include/llvm/CodeGen/MachineJumpTableInfo.h
index 192fb655429..2cb268ad539 100644
--- a/llvm/include/llvm/CodeGen/MachineJumpTableInfo.h
+++ b/llvm/include/llvm/CodeGen/MachineJumpTableInfo.h
@@ -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
diff --git a/llvm/lib/CodeGen/MachineFunction.cpp b/llvm/lib/CodeGen/MachineFunction.cpp
index da89ea1821f..6d66839e2fb 100644
--- a/llvm/lib/CodeGen/MachineFunction.cpp
+++ b/llvm/lib/CodeGen/MachineFunction.cpp
@@ -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); }
OpenPOWER on IntegriCloud