summaryrefslogtreecommitdiff
path: root/include/llvm/Constants.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2012-02-05 02:29:43 +0000
committerChris Lattner <sabre@nondot.org>2012-02-05 02:29:43 +0000
commit18c7f80b3e83ab584bd8572695a3cde8bafd9d3c (patch)
tree93b57cd1b5fb8fa1e48c06e4bef7571f02603243 /include/llvm/Constants.h
parenteea723fe02edba0a1215fa235ba425ae93202dc9 (diff)
downloadllvm-18c7f80b3e83ab584bd8572695a3cde8bafd9d3c.tar.gz
llvm-18c7f80b3e83ab584bd8572695a3cde8bafd9d3c.tar.bz2
llvm-18c7f80b3e83ab584bd8572695a3cde8bafd9d3c.tar.xz
reapply the patches reverted in r149470 that reenable ConstantDataArray,
but with a critical fix to the SelectionDAG code that optimizes copies from strings into immediate stores: the previous code was stopping reading string data at the first nul. Address this by adding a new argument to llvm::getConstantStringInfo, preserving the behavior before the patch. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149800 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Constants.h')
-rw-r--r--include/llvm/Constants.h36
1 files changed, 0 insertions, 36 deletions
diff --git a/include/llvm/Constants.h b/include/llvm/Constants.h
index 43f625a68f..a4723d37f0 100644
--- a/include/llvm/Constants.h
+++ b/include/llvm/Constants.h
@@ -352,17 +352,6 @@ public:
// ConstantArray accessors
static Constant *get(ArrayType *T, ArrayRef<Constant*> V);
- /// This method constructs a ConstantArray and initializes it with a text
- /// string. The default behavior (AddNull==true) causes a null terminator to
- /// be placed at the end of the array. This effectively increases the length
- /// of the array by one (you've been warned). However, in some situations
- /// this is not desired so if AddNull==false then the string is copied without
- /// null termination.
-
- // FIXME Remove this.
- static Constant *get(LLVMContext &Context, StringRef Initializer,
- bool AddNull = true);
-
/// Transparently provide more efficient getOperand methods.
DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Constant);
@@ -373,31 +362,6 @@ public:
return reinterpret_cast<ArrayType*>(Value::getType());
}
- // FIXME: String methods will eventually be removed.
-
-
- /// isString - This method returns true if the array is an array of i8 and
- /// the elements of the array are all ConstantInt's.
- bool isString() const;
-
- /// isCString - This method returns true if the array is a string (see
- /// @verbatim
- /// isString) and it ends in a null byte \0 and does not contains any other
- /// @endverbatim
- /// null bytes except its terminator.
- bool isCString() const;
-
- /// getAsString - If this array is isString(), then this method converts the
- /// array to an std::string and returns it. Otherwise, it asserts out.
- ///
- std::string getAsString() const;
-
- /// getAsCString - If this array is isCString(), then this method converts the
- /// array (without the trailing null byte) to an std::string and returns it.
- /// Otherwise, it asserts out.
- ///
- std::string getAsCString() const;
-
virtual void destroyConstant();
virtual void replaceUsesOfWithOnConstant(Value *From, Value *To, Use *U);