diff options
author | Vikram S. Adve <vadve@cs.uiuc.edu> | 2001-09-18 12:58:33 +0000 |
---|---|---|
committer | Vikram S. Adve <vadve@cs.uiuc.edu> | 2001-09-18 12:58:33 +0000 |
commit | 0799fc479ab1eb7261f125e2312c5e192cacdb98 (patch) | |
tree | 2e9d96339b78e2eee3c8971367a1785eda67c18f /lib/Target/TargetMachine.cpp | |
parent | 137f7202c75d44903d0df89971396684bcc66212 (diff) |
Renamed files to match the main classes they provide.
Some other minor changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@615 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/TargetMachine.cpp')
-rw-r--r-- | lib/Target/TargetMachine.cpp | 44 |
1 files changed, 25 insertions, 19 deletions
diff --git a/lib/Target/TargetMachine.cpp b/lib/Target/TargetMachine.cpp index aecc885567..d508b32a39 100644 --- a/lib/Target/TargetMachine.cpp +++ b/lib/Target/TargetMachine.cpp @@ -5,7 +5,7 @@ // //===----------------------------------------------------------------------===// -#include "llvm/Target/InstInfo.h" +#include "llvm/Target/MachineInstrInfo.h" #include "llvm/DerivedTypes.h" //--------------------------------------------------------------------------- @@ -16,6 +16,7 @@ // //--------------------------------------------------------------------------- + // function TargetMachine::findOptimalStorageSize // // Purpose: @@ -23,18 +24,21 @@ // space equal to optSizeForSubWordData, and all other primitive data // items use space according to the type. // -unsigned int TargetMachine::findOptimalStorageSize(const Type* ty) const { - switch(ty->getPrimitiveID()) { - case Type::BoolTyID: - case Type::UByteTyID: - case Type::SByteTyID: - case Type::UShortTyID: - case Type::ShortTyID: - return optSizeForSubWordData; +unsigned int +TargetMachine::findOptimalStorageSize(const Type* ty) const +{ + switch(ty->getPrimitiveID()) + { + case Type::BoolTyID: + case Type::UByteTyID: + case Type::SByteTyID: + case Type::UShortTyID: + case Type::ShortTyID: + return optSizeForSubWordData; - default: - return DataLayout.getTypeSize(ty); - } + default: + return DataLayout.getTypeSize(ty); + } } @@ -56,7 +60,8 @@ MachineInstrInfo::MachineInstrInfo(const MachineInstrDescriptor* _desc, } -MachineInstrInfo::~MachineInstrInfo() { +MachineInstrInfo::~MachineInstrInfo() +{ TargetInstrDescriptors = NULL; // reset global variable } @@ -68,12 +73,13 @@ MachineInstrInfo::constantFitsInImmedField(MachineOpCode opCode, // First, check if opCode has an immed field. bool isSignExtended; uint64_t maxImmedValue = maxImmedConstant(opCode, isSignExtended); - if (maxImmedValue != 0) { - // Now check if the constant fits - if (intValue <= (int64_t) maxImmedValue && - intValue >= -((int64_t) maxImmedValue+1)) - return true; - } + if (maxImmedValue != 0) + { + // Now check if the constant fits + if (intValue <= (int64_t) maxImmedValue && + intValue >= -((int64_t) maxImmedValue+1)) + return true; + } return false; } |