diff options
author | Jay Foad <jay.foad@gmail.com> | 2010-12-07 08:25:19 +0000 |
---|---|---|
committer | Jay Foad <jay.foad@gmail.com> | 2010-12-07 08:25:19 +0000 |
commit | 583abbc4df3d9b9e5a86a56ae581970b98dc5249 (patch) | |
tree | 62e559937dd04e2a764f7423e50f94a5641022f9 /llvm/lib/Support/StringRef.cpp | |
parent | 10e1b56e2c9b920d5f3509abb8a6df3815200839 (diff) | |
download | bcm5719-llvm-583abbc4df3d9b9e5a86a56ae581970b98dc5249.tar.gz bcm5719-llvm-583abbc4df3d9b9e5a86a56ae581970b98dc5249.zip |
PR5207: Change APInt methods trunc(), sext(), zext(), sextOrTrunc() and
zextOrTrunc(), and APSInt methods extend(), extOrTrunc() and new method
trunc(), to be const and to return a new value instead of modifying the
object in place.
llvm-svn: 121120
Diffstat (limited to 'llvm/lib/Support/StringRef.cpp')
-rw-r--r-- | llvm/lib/Support/StringRef.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Support/StringRef.cpp b/llvm/lib/Support/StringRef.cpp index 8e636c3317f..53980519645 100644 --- a/llvm/lib/Support/StringRef.cpp +++ b/llvm/lib/Support/StringRef.cpp @@ -371,7 +371,7 @@ bool StringRef::getAsInteger(unsigned Radix, APInt &Result) const { if (BitWidth < Result.getBitWidth()) BitWidth = Result.getBitWidth(); // don't shrink the result else - Result.zext(BitWidth); + Result = Result.zext(BitWidth); APInt RadixAP, CharAP; // unused unless !IsPowerOf2Radix if (!IsPowerOf2Radix) { |