mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
Revert "IR: Simplify DIBuilder's HeaderBuilder API, NFC"
This reverts commit r226540, since I hit an unexpected bot failure [1]. I'll investigate. [1]: http://bb.pgr.jp/builders/cmake-llvm-x86_64-linux/builds/20244 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226542 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
749d6fbf7e
commit
0ab88ac2a1
@ -25,23 +25,15 @@ using namespace llvm::dwarf;
|
||||
|
||||
namespace {
|
||||
class HeaderBuilder {
|
||||
/// \brief Whether there are any fields yet.
|
||||
///
|
||||
/// Note that this is not equivalent to \c Chars.empty(), since \a concat()
|
||||
/// may have been called already with an empty string.
|
||||
bool IsEmpty;
|
||||
SmallVector<char, 256> Chars;
|
||||
|
||||
public:
|
||||
HeaderBuilder() : IsEmpty(true) {}
|
||||
explicit HeaderBuilder(Twine T) { T.toVector(Chars); }
|
||||
HeaderBuilder(const HeaderBuilder &X) : Chars(X.Chars) {}
|
||||
HeaderBuilder(HeaderBuilder &&X) : Chars(std::move(X.Chars)) {}
|
||||
|
||||
template <class Twineable> HeaderBuilder &concat(Twineable &&X) {
|
||||
if (IsEmpty)
|
||||
IsEmpty = false;
|
||||
else
|
||||
Chars.push_back(0);
|
||||
Chars.push_back(0);
|
||||
Twine(X).toVector(Chars);
|
||||
return *this;
|
||||
}
|
||||
@ -51,7 +43,7 @@ public:
|
||||
}
|
||||
|
||||
static HeaderBuilder get(unsigned Tag) {
|
||||
return HeaderBuilder().concat("0x" + Twine::utohexstr(Tag));
|
||||
return HeaderBuilder("0x" + Twine::utohexstr(Tag));
|
||||
}
|
||||
};
|
||||
}
|
||||
@ -747,10 +739,8 @@ static HeaderBuilder setTypeFlagsInHeader(StringRef Header,
|
||||
Flags = 0;
|
||||
Flags |= FlagsToSet;
|
||||
|
||||
return HeaderBuilder()
|
||||
.concat(I.getPrefix())
|
||||
.concat(Flags)
|
||||
.concat(I.getSuffix());
|
||||
return HeaderBuilder(Twine(I.getPrefix())).concat(Flags).concat(
|
||||
I.getSuffix());
|
||||
}
|
||||
|
||||
static DIType createTypeWithFlags(LLVMContext &Context, DIType Ty,
|
||||
|
Loading…
Reference in New Issue
Block a user