Create a new class, MemOperand, for describing memory references
[oota-llvm.git] / include / llvm / Value.h
index 44c4453b04a045577ec5181f8f692023c406f4d0..e1cc6f269769a0b7816683f2e994a941db4ed121 100644 (file)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file was developed by the LLVM research group and is distributed under
-// the University of Illinois Open Source License. See LICENSE.TXT for details.
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 //
@@ -88,9 +88,23 @@ public:
 
   // All values can potentially be named...
   inline bool hasName() const { return Name != 0; }
+  ValueName *getValueName() const { return Name; }
+
+  /// getNameStart - Return a pointer to a null terminated string for this name.
+  /// Note that names can have null characters within the string as well as at
+  /// their end.  This always returns a non-null pointer.
+  const char *getNameStart() const;
+  
+  /// getNameLen - Return the length of the string, correctly handling nul
+  /// characters embedded into them.
+  unsigned getNameLen() const;
+
+  /// getName()/getNameStr() - Return the name of the specified value, 
+  /// *constructing a string* to hold it.  Because these are guaranteed to
+  /// construct a string, they are very expensive and should be avoided.
   std::string getName() const { return getNameStr(); }
   std::string getNameStr() const;
-  ValueName *getValueName() const { return Name; }
+
 
   void setName(const std::string &name);
   void setName(const char *Name, unsigned NameLen);
@@ -174,6 +188,7 @@ public:
     ConstantPointerNullVal,   // This is an instance of ConstantPointerNull
     InlineAsmVal,             // This is an instance of InlineAsm
     InstructionVal,           // This is an instance of Instruction
+    PseudoSourceValueVal,     // This is an instance of PseudoSourceValue
     
     // Markers:
     ConstantFirstVal = FunctionVal,