File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -3128,6 +3128,29 @@ bool ConstantDataSequential::isCString() const {
31283128 return !Str.drop_back ().contains (0 );
31293129}
31303130
3131+ bool ConstantDataSequential::isUnicodeString () const {
3132+ Type *CDSType = this ->getElementType ();
3133+ Type *GVType = IntegerType::getInt16Ty (this ->getContext ());
3134+ if (CDSType != GVType) {
3135+ return false ;
3136+ }
3137+
3138+ StringRef RawDataValues = this ->getRawDataValues ();
3139+ unsigned int NumElements = this ->getNumElements ();
3140+ size_t Length = NumElements * sizeof (unsigned short );
3141+
3142+ if (RawDataValues[Length - 1 ] == 0 &&
3143+ RawDataValues[Length - sizeof (unsigned short )] == 0 ) {
3144+ for (unsigned int i = 0 ; i < Length - sizeof (unsigned short ) - 1 ; ++i)
3145+ if (RawDataValues[i] == 0 && RawDataValues[i + 1 ] == 0 )
3146+ return false ;
3147+
3148+ return true ;
3149+ }
3150+
3151+ return false ;
3152+ }
3153+
31313154bool ConstantDataVector::isSplatData () const {
31323155 const char *Base = getRawDataValues ().data ();
31333156
You can’t perform that action at this time.
0 commit comments