- Re-apply 52748 and friends with fix. GetConstantStringInfo() returns an empty string for ConstantAggregateZero case which surprises selectiondag.

- Correctly handle memcpy from constant string which is zero-initialized.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52891 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Evan Cheng
2008-06-30 07:31:25 +00:00
parent 2ca698df93
commit 0ff39b3feb
11 changed files with 168 additions and 174 deletions

View File

@@ -72,7 +72,16 @@ namespace llvm {
Instruction *InsertBefore = 0) {
const unsigned Idxs[1] = { Idx };
return FindInsertedValue(V, &Idxs[0], &Idxs[1], InsertBefore);
}
}
/// GetConstantStringInfo - This function computes the length of a
/// null-terminated C string pointed to by V. If successful, it returns true
/// and returns the string in Str. If unsuccessful, it returns false. If
/// StopAtNul is set to true (the default), the returned string is truncated
/// by a nul character in the global. If StopAtNul is false, the nul
/// character is included in the result string.
bool GetConstantStringInfo(Value *V, std::string &Str, uint64_t Offset = 0,
bool StopAtNul = true);
} // end namespace llvm
#endif