aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-11-07 18:53:00 +0000
committerChris Lattner <sabre@nondot.org>2009-11-07 18:53:00 +0000
commit9e496d223102cb3d5e37c513a697e30532e71bc0 (patch)
treec7a4126972d9a585bd67c1f05bccb772ea90b087
parentb8391aa969b384e33e9d3245533ff80188bfd72f (diff)
downloadexternal_llvm-9e496d223102cb3d5e37c513a697e30532e71bc0.zip
external_llvm-9e496d223102cb3d5e37c513a697e30532e71bc0.tar.gz
external_llvm-9e496d223102cb3d5e37c513a697e30532e71bc0.tar.bz2
all targets should be required to declare legal integer types. My plan to
make it optional doesn't work out. If you don't want to specify this, don't specify a TD string at all. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86394 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/Target/TargetData.h21
1 files changed, 10 insertions, 11 deletions
diff --git a/include/llvm/Target/TargetData.h b/include/llvm/Target/TargetData.h
index 9630877..b663d47 100644
--- a/include/llvm/Target/TargetData.h
+++ b/include/llvm/Target/TargetData.h
@@ -144,23 +144,22 @@ public:
/// string constructor above.
std::string getStringRepresentation() const;
-
- /// isIllegalInteger - This function returns true if the specified type is
- /// known to not be a native integer type supported by the CPU. For example,
+ /// isLegalInteger - This function returns true if the specified type is
+ /// known tobe a native integer type supported by the CPU. For example,
/// i64 is not native on most 32-bit CPUs and i37 is not native on any known
- /// one. This returns false if the integer width is legal or we don't know.
+ /// one. This returns false if the integer width is not legal.
///
/// The width is specified in bits.
///
- bool isIllegalInteger(unsigned Width) const {
- // If we don't have information about legal integer types, don't claim the
- // type is illegal.
- if (LegalIntWidths.empty()) return false;
-
+ bool isLegalInteger(unsigned Width) const {
for (unsigned i = 0, e = LegalIntWidths.size(); i != e; ++i)
if (LegalIntWidths[i] == Width)
- return false;
- return true;
+ return true;
+ return false;
+ }
+
+ bool isIllegalInteger(unsigned Width) const {
+ return !isLegalInteger(Width);
}
/// Target pointer alignment