X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FConstants.h;h=cce4d49d1fbaf7fea9c330d1a7fb456c9fc2395e;hb=a51139f446bc9083096885f5f8956db6c8c77981;hp=ef2c839adc22cd6eb264e8eb730e3f6c1b0e683d;hpb=9fc18d24ae525a0047718d28e7a8735e8582ddb2;p=oota-llvm.git diff --git a/include/llvm/Constants.h b/include/llvm/Constants.h index ef2c839adc2..cce4d49d1fb 100644 --- a/include/llvm/Constants.h +++ b/include/llvm/Constants.h @@ -58,7 +58,7 @@ public: /// type. inline uint64_t getZExtValue() const { unsigned Size = getType()->getPrimitiveSizeInBits(); - return Val.Unsigned & (~0ULL >> (64-Size)); + return Val.Unsigned & (~uint64_t(0UL) >> (64-Size)); } /// getSExtValue - Return the constant sign extended as appropriate for this @@ -345,7 +345,14 @@ protected: public: /// get() - Static factory methods - Return objects of the specified value static Constant *get(const ArrayType *T, const std::vector &); - static Constant *get(const std::string &Initializer); + + /// This method constructs a ConstantArray and initializes it with a text + /// string. The default behavior (AddNull==true) causes a null terminator to + /// be placed at the end of the array. This effectively increases the length + /// of the array by one (you've been warned). However, in some situations + /// this is not desired so if AddNull==false then the string is copied without + /// null termination. + static Constant *get(const std::string &Initializer, bool AddNull = true); /// getType - Specialize the getType() method to always return an ArrayType, /// which reduces the amount of casting needed in parts of the compiler.