if (SectionTypeDescriptors[SectionType].AssemblerName) {
OS << ',';
OS << SectionTypeDescriptors[SectionType].AssemblerName;
- } else
+ } else {
// If we have no name for the attribute, stop here.
+ OS << '\n';
return;
+ }
// If we don't have any attributes, we're done.
unsigned SectionAttrs = TAA & MCSectionMachO::SECTION_ATTRIBUTES;
/// StripSpaces - This removes leading and trailing spaces from the StringRef.
static void StripSpaces(StringRef &Str) {
- while (!Str.empty() && isspace(Str[0]))
+ while (!Str.empty() && isspace(static_cast<unsigned char>(Str[0])))
Str = Str.substr(1);
- while (!Str.empty() && isspace(Str.back()))
+ while (!Str.empty() && isspace(static_cast<unsigned char>(Str.back())))
Str = Str.substr(0, Str.size()-1);
}
StringRef &Segment, // Out.
StringRef &Section, // Out.
unsigned &TAA, // Out.
+ bool &TAAParsed, // Out.
unsigned &StubSize) { // Out.
+ TAAParsed = false;
// Find the first comma.
std::pair<StringRef, StringRef> Comma = Spec.split(',');
"between 1 and 16 characters";
// If there is no comma after the section, we're done.
+ TAA = 0;
StubSize = 0;
if (Comma.second.empty())
return "";
// Remember the TypeID.
TAA = TypeID;
+ TAAParsed = true;
// If we have no comma after the section type, there are no attributes.
if (Comma.second.empty()) {