summaryrefslogtreecommitdiffstats
path: root/lib/Target/ARM/ARMConstantPoolValue.h
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2012-12-24 19:23:30 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2012-12-24 19:23:30 +0000
commit791dbb3e5fbe5910b84e3f2bd26cf272e2bde128 (patch)
treefa4196a1a5a3de3f79c47b2825601fc97581e4bb /lib/Target/ARM/ARMConstantPoolValue.h
parenta0be09f511c68a88ee95b73c8f0ebd78156a559e (diff)
downloadexternal_llvm-791dbb3e5fbe5910b84e3f2bd26cf272e2bde128.zip
external_llvm-791dbb3e5fbe5910b84e3f2bd26cf272e2bde128.tar.gz
external_llvm-791dbb3e5fbe5910b84e3f2bd26cf272e2bde128.tar.bz2
Use a std::string rather than a dynamically allocated char* buffer.
This affords us to use std::string's allocation routines and use the destructor for the memory management. Switching to that also means that we can use operator==(const std::string&, const char *) to perform the string comparison rather than resorting to libc functionality (i.e. strcmp). Patch by Saleem Abdulrasool! Differential Revision: http://llvm-reviews.chandlerc.com/D230 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171042 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM/ARMConstantPoolValue.h')
-rw-r--r--lib/Target/ARM/ARMConstantPoolValue.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/Target/ARM/ARMConstantPoolValue.h b/lib/Target/ARM/ARMConstantPoolValue.h
index ae531c4..93812fe 100644
--- a/lib/Target/ARM/ARMConstantPoolValue.h
+++ b/lib/Target/ARM/ARMConstantPoolValue.h
@@ -161,19 +161,17 @@ public:
/// ARMConstantPoolSymbol - ARM-specific constantpool values for external
/// symbols.
class ARMConstantPoolSymbol : public ARMConstantPoolValue {
- const char *S; // ExtSymbol being loaded.
+ const std::string S; // ExtSymbol being loaded.
ARMConstantPoolSymbol(LLVMContext &C, const char *s, unsigned id,
unsigned char PCAdj, ARMCP::ARMCPModifier Modifier,
bool AddCurrentAddress);
public:
- ~ARMConstantPoolSymbol();
-
static ARMConstantPoolSymbol *Create(LLVMContext &C, const char *s,
unsigned ID, unsigned char PCAdj);
- const char *getSymbol() const { return S; }
+ const char *getSymbol() const { return S.c_str(); }
virtual int getExistingMachineCPValue(MachineConstantPool *CP,
unsigned Alignment);