mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 18:54:02 +01:00
Include functionality to get a string array constant as a string
llvm-svn: 1020
This commit is contained in:
parent
e9c4fcd1fb
commit
bf9a3148af
@ -1,7 +1,6 @@
|
||||
//===-- StringExtras.h - Useful string functions -----------------*- C++ -*--=//
|
||||
//
|
||||
// This file contains some functions that are useful when dealing with strings.
|
||||
// No library is required when using these functinons.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
@ -12,6 +11,8 @@
|
||||
#include <stdio.h>
|
||||
#include "llvm/Support/DataTypes.h"
|
||||
|
||||
class ConstPoolArray;
|
||||
|
||||
static inline string utostr(uint64_t X, bool isNeg = false) {
|
||||
char Buffer[40];
|
||||
char *BufPtr = Buffer+39;
|
||||
@ -73,4 +74,15 @@ printIndent(unsigned int indent, ostream& os=cout, const char* const istr=" ")
|
||||
for (unsigned i=0; i < indent; i++)
|
||||
os << istr;
|
||||
}
|
||||
|
||||
// Can we treat the specified array as a string? Only if it is an array of
|
||||
// ubytes or non-negative sbytes.
|
||||
//
|
||||
bool isStringCompatible(ConstPoolArray *CPA);
|
||||
|
||||
// getAsCString - Return the specified array as a C compatible string, only if
|
||||
// the predicate isStringCompatible is true.
|
||||
//
|
||||
string getAsCString(ConstPoolArray *CPA);
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user