diff options
author | Patrik Hägglund <patrik.h.hagglund@ericsson.com> | 2012-11-14 09:04:56 +0000 |
---|---|---|
committer | Patrik Hägglund <patrik.h.hagglund@ericsson.com> | 2012-11-14 09:04:56 +0000 |
commit | 1e65676a12c61815acb65990d9269611ad544c78 (patch) | |
tree | dd558a7e20c9399d19cb67a6278b88dadb941193 /include/llvm/DataLayout.h | |
parent | 1ab489a42d013151b21655a4c011dc15d6d75eab (diff) | |
download | llvm-1e65676a12c61815acb65990d9269611ad544c78.tar.gz llvm-1e65676a12c61815acb65990d9269611ad544c78.tar.bz2 llvm-1e65676a12c61815acb65990d9269611ad544c78.tar.xz |
Revert some redundant parts of r142605.
This seems like redundant leftovers from r142288 - exposing
TargetData::parseSpecifier to LLParser - which got reverted. Removes
redunant td != NULL checks in parseSpecifier, and simplifies the
interface to parseSpecifier and init.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167924 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/DataLayout.h')
-rw-r--r-- | include/llvm/DataLayout.h | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/include/llvm/DataLayout.h b/include/llvm/DataLayout.h index 24ad05f17f..7d8eace1b6 100644 --- a/include/llvm/DataLayout.h +++ b/include/llvm/DataLayout.h @@ -148,9 +148,9 @@ private: return &align != &InvalidPointerElem; } - /// Initialise a DataLayout object with default values, ensure that the - /// target data pass is registered. - void init(); + /// Parses a target data specification string. Returns an error message + /// if the string is malformed, or the empty string on success. + std::string parseSpecifier(StringRef LayoutDescription); public: /// Default ctor. @@ -162,17 +162,9 @@ public: /// Constructs a DataLayout from a specification string. See init(). explicit DataLayout(StringRef LayoutDescription) : ImmutablePass(ID) { - std::string errMsg = parseSpecifier(LayoutDescription, this); - assert(errMsg == "" && "Invalid target data layout string."); - (void)errMsg; + init(LayoutDescription); } - /// Parses a target data specification string. Returns an error message - /// if the string is malformed, or the empty string on success. Optionally - /// initialises a DataLayout object if passed a non-null pointer. - static std::string parseSpecifier(StringRef LayoutDescription, - DataLayout* td = 0); - /// Initialize target data from properties stored in the module. explicit DataLayout(const Module *M); @@ -187,6 +179,10 @@ public: ~DataLayout(); // Not virtual, do not subclass this class + /// Parse a data layout string (with fallback to default values). Ensure that + /// the data layout pass is registered. + void init(StringRef LayoutDescription); + /// Layout endianness... bool isLittleEndian() const { return LittleEndian; } bool isBigEndian() const { return !LittleEndian; } |