diff options
author | Anton Korobeynikov <asl@math.spbu.ru> | 2008-06-29 17:57:03 +0000 |
---|---|---|
committer | Anton Korobeynikov <asl@math.spbu.ru> | 2008-06-29 17:57:03 +0000 |
commit | 6d116bc7ced56a820d33b0dd35ee36af8a810eab (patch) | |
tree | b9d056c655001ef42c66a3395d01233d2a499537 /include/llvm | |
parent | 28a2b54580b28be10c536def7f49b5599adf3631 (diff) | |
download | llvm-6d116bc7ced56a820d33b0dd35ee36af8a810eab.tar.gz llvm-6d116bc7ced56a820d33b0dd35ee36af8a810eab.tar.bz2 llvm-6d116bc7ced56a820d33b0dd35ee36af8a810eab.tar.xz |
Revert (52748 and friends):
Move GetConstantStringInfo to lib/Analysis. Remove
string output routine from Constant. Update all
callers. Change debug intrinsic api slightly to
accomodate move of routine, these now return values
instead of strings.
This unbreaks llvm-gcc bootstrap.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52884 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
-rw-r--r-- | include/llvm/Analysis/ValueTracking.h | 11 | ||||
-rw-r--r-- | include/llvm/Constant.h | 7 | ||||
-rw-r--r-- | include/llvm/IntrinsicInst.h | 4 |
3 files changed, 10 insertions, 12 deletions
diff --git a/include/llvm/Analysis/ValueTracking.h b/include/llvm/Analysis/ValueTracking.h index 1003269e28..80d598dffe 100644 --- a/include/llvm/Analysis/ValueTracking.h +++ b/include/llvm/Analysis/ValueTracking.h @@ -72,16 +72,7 @@ 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 diff --git a/include/llvm/Constant.h b/include/llvm/Constant.h index c45ec2e77e..d85771a09a 100644 --- a/include/llvm/Constant.h +++ b/include/llvm/Constant.h @@ -115,6 +115,13 @@ public: "implemented for all constants that have operands!"); assert(0 && "Constants that do not have operands cannot be using 'From'!"); } + + /// getStringValue - Turn an LLVM constant pointer that eventually points to a + /// global into a string value. Return an empty string if we can't do it. + /// Parameter Chop determines if the result is chopped at the first null + /// terminator. + /// + std::string getStringValue(bool Chop = true, unsigned Offset = 0); }; } // End llvm namespace diff --git a/include/llvm/IntrinsicInst.h b/include/llvm/IntrinsicInst.h index 16a43d4197..c674e47b3a 100644 --- a/include/llvm/IntrinsicInst.h +++ b/include/llvm/IntrinsicInst.h @@ -96,8 +96,8 @@ namespace llvm { return unsigned(cast<ConstantInt>(getOperand(2))->getZExtValue()); } - Value* getFileName() const; - Value* getDirectory() const; + std::string getFileName() const; + std::string getDirectory() const; // Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const DbgStopPointInst *) { return true; } |