aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2009-03-13 04:39:26 +0000
committerBill Wendling <isanbard@gmail.com>2009-03-13 04:39:26 +0000
commit0582ae99ba75a556d6ff63b254da327d32ba036f (patch)
treef6acdc868987413752d785dabab58cbb8e72e6b1 /include
parentc7a09ab3110b9462ad9646cb60c22c8527491ad9 (diff)
downloadexternal_llvm-0582ae99ba75a556d6ff63b254da327d32ba036f.zip
external_llvm-0582ae99ba75a556d6ff63b254da327d32ba036f.tar.gz
external_llvm-0582ae99ba75a556d6ff63b254da327d32ba036f.tar.bz2
Oops...I committed too much.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66867 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Analysis/DebugInfo.h42
-rw-r--r--include/llvm/Analysis/ValueTracking.h14
2 files changed, 30 insertions, 26 deletions
diff --git a/include/llvm/Analysis/DebugInfo.h b/include/llvm/Analysis/DebugInfo.h
index b31896e..c6f0928 100644
--- a/include/llvm/Analysis/DebugInfo.h
+++ b/include/llvm/Analysis/DebugInfo.h
@@ -40,7 +40,7 @@ namespace llvm {
/// not, the debug info is corrupt and we ignore it.
DIDescriptor(GlobalVariable *GV, unsigned RequiredTag);
- const char *getStringField(unsigned Elt) const;
+ const std::string &getStringField(unsigned Elt, std::string &Result) const;
unsigned getUnsignedField(unsigned Elt) const {
return (unsigned)getUInt64Field(Elt);
}
@@ -106,14 +106,14 @@ namespace llvm {
explicit DICompileUnit(GlobalVariable *GV = 0);
unsigned getLanguage() const { return getUnsignedField(2); }
- const char *getFilename() const {
- return getStringField(3);
+ const std::string &getFilename(std::string &F) const {
+ return getStringField(3, F);
}
- const char *getDirectory() const {
- return getStringField(4);
+ const std::string &getDirectory(std::string &F) const {
+ return getStringField(4, F);
}
- const char *getProducer() const {
- return getStringField(5);
+ const std::string &getProducer(std::string &F) const {
+ return getStringField(5, F);
}
/// isMain - Each input file is encoded as a separate compile unit in LLVM
@@ -127,7 +127,9 @@ namespace llvm {
bool isMain() const { return getUnsignedField(6); }
bool isOptimized() const { return getUnsignedField(7); }
- const char *getFlags() const { return getStringField(8); }
+ const std::string &getFlags(std::string &F) const {
+ return getStringField(8, F);
+ }
unsigned getRunTimeVersion() const { return getUnsignedField(9); }
/// Verify - Verify that a compile unit is well formed.
@@ -144,8 +146,8 @@ namespace llvm {
public:
explicit DIEnumerator(GlobalVariable *GV = 0);
- const char *getName() const {
- return getStringField(1);
+ const std::string &getName(std::string &F) const {
+ return getStringField(1, F);
}
uint64_t getEnumValue() const { return getUInt64Field(2); }
};
@@ -190,7 +192,9 @@ namespace llvm {
virtual ~DIType() {}
DIDescriptor getContext() const { return getDescriptorField(1); }
- const char *getName() const { return getStringField(2); }
+ const std::string &getName(std::string &F) const {
+ return getStringField(2, F);
+ }
DICompileUnit getCompileUnit() const{ return getFieldAs<DICompileUnit>(3); }
unsigned getLineNumber() const { return getUnsignedField(4); }
uint64_t getSizeInBits() const { return getUInt64Field(5); }
@@ -272,14 +276,14 @@ namespace llvm {
virtual ~DIGlobal() {}
DIDescriptor getContext() const { return getDescriptorField(2); }
- const char *getName() const {
- return getStringField(3);
+ const std::string &getName(std::string &F) const {
+ return getStringField(3, F);
}
- const char *getDisplayName() const {
- return getStringField(4);
+ const std::string &getDisplayName(std::string &F) const {
+ return getStringField(4, F);
}
- const char *getLinkageName() const {
- return getStringField(5);
+ const std::string &getLinkageName(std::string &F) const {
+ return getStringField(5, F);
}
DICompileUnit getCompileUnit() const{ return getFieldAs<DICompileUnit>(6); }
unsigned getLineNumber() const { return getUnsignedField(7); }
@@ -327,8 +331,8 @@ namespace llvm {
explicit DIVariable(GlobalVariable *GV = 0);
DIDescriptor getContext() const { return getDescriptorField(1); }
- const char *getName() const {
- return getStringField(2);
+ const std::string &getName(std::string &F) const {
+ return getStringField(2, F);
}
DICompileUnit getCompileUnit() const{ return getFieldAs<DICompileUnit>(3); }
unsigned getLineNumber() const { return getUnsignedField(4); }
diff --git a/include/llvm/Analysis/ValueTracking.h b/include/llvm/Analysis/ValueTracking.h
index cefa076..5f5f77a 100644
--- a/include/llvm/Analysis/ValueTracking.h
+++ b/include/llvm/Analysis/ValueTracking.h
@@ -75,13 +75,13 @@ namespace llvm {
}
/// GetConstantStringInfo - This function computes the length of a
- /// null-terminated C string pointed to by V. If successful, it returns the
- /// string. If unsuccessful, it returns NUL. 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.
- const char *GetConstantStringInfo(Value *V, uint64_t Offset = 0,
- bool StopAtNul = true);
+ /// 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