Commit b6945555 authored by Kevin Modzelewski's avatar Kevin Modzelewski

Move boxString to a header file

Not sure how much it helps, but it's mostly just a wrapper around
new boxedstring.

Also, I don't think it needs to be in inline/ any more since we
will always box strings during codegen rather than emit calls
to boxString.
parent 267a5116
......@@ -30,15 +30,6 @@ extern "C" Box* createList() {
return new BoxedList();
}
BoxedString* boxString(llvm::StringRef s) {
if (s.size() <= 1) {
if (s.size() == 0)
return EmptyString;
return characters[s.data()[0] & UCHAR_MAX];
}
return new (s.size()) BoxedString(s);
}
BoxedString* boxStringTwine(const llvm::Twine& t) {
llvm::SmallString<256> Vec;
return boxString(t.toStringRef(Vec));
......
......@@ -915,6 +915,15 @@ Box* codeForCLFunction(CLFunction*);
CLFunction* clfunctionFromCode(Box* code);
Box* getFrame(int depth);
inline BoxedString* boxString(llvm::StringRef s) {
if (s.size() <= 1) {
if (s.size() == 0)
return EmptyString;
return characters[s.data()[0] & UCHAR_MAX];
}
return new (s.size()) BoxedString(s);
}
}
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment