return getElement(Elements[0]);
}
- SmallVector<Init*, 8> Vals;
+ SmallVector<Init *, 8> Vals;
Vals.reserve(Elements.size());
for (unsigned Element : Elements) {
if (Element >= size())
Init *TypedInit::convertInitListSlice(ArrayRef<unsigned> Elements) const {
ListRecTy *T = dyn_cast<ListRecTy>(getType());
- if (!T) return nullptr; // Cannot subscript a non-list variable.
+ if (!T)
+ return nullptr; // Cannot subscript a non-list variable.
if (Elements.size() == 1)
return VarListElementInit::get(const_cast<TypedInit *>(this), Elements[0]);
- SmallVector<Init*, 8> ListInits;
+ SmallVector<Init *, 8> ListInits;
ListInits.reserve(Elements.size());
for (unsigned Element : Elements)
- ListInits.push_back(VarListElementInit::get(const_cast<TypedInit *>(this),
- Element));
+ ListInits.push_back(
+ VarListElementInit::get(const_cast<TypedInit *>(this), Element));
return ListInit::get(ListInits, T->getElementType());
}
-
VarInit *VarInit::get(StringRef VN, RecTy *T) {
Init *Value = StringInit::get(T->getRecordKeeper(), VN);
return VarInit::get(Value, T);
Init *VarListElementInit::getBit(unsigned Bit) const {
if (getType() == BitRecTy::get(getRecordKeeper()))
- return const_cast<VarListElementInit*>(this);
- return VarBitInit::get(const_cast<VarListElementInit*>(this), Bit);
+ return const_cast<VarListElementInit *>(this);
+ return VarBitInit::get(const_cast<VarListElementInit *>(this), Bit);
}
-DefInit::DefInit(Record *D)
- : TypedInit(IK_DefInit, D->getType()), Def(D) {}
+DefInit::DefInit(Record *D) : TypedInit(IK_DefInit, D->getType()), Def(D) {}
DefInit *DefInit::get(Record *R) {
return R->getDefInit();
Lex.Lex(); // eat the '['
SmallVector<unsigned, 16> Ranges;
ParseRangeList(Ranges);
- if (Ranges.empty()) return nullptr;
+ if (Ranges.empty())
+ return nullptr;
Result = Result->convertInitListSlice(Ranges);
if (!Result) {
MadeChange |= getChild(i+1)->ApplyTypeConstraints(TP, NotRegisters);
MVT::SimpleValueType OpVT = Int->IS.ParamVTs[i];
- assert(getChild(i+1)->getNumTypes() == 1 && "Unhandled case");
- MadeChange |= getChild(i+1)->UpdateNodeType(0, OpVT, TP);
+ assert(getChild(i + 1)->getNumTypes() == 1 && "Unhandled case");
+ MadeChange |= getChild(i + 1)->UpdateNodeType(0, OpVT, TP);
}
return MadeChange;
}
OS << "#endif\n\n";
}
-
// NOTE: This must be kept in synch with the copy in lib/IR/Function.cpp!
enum IIT_Info {
// Common values should be encoded with 0-15.
}
#if defined(_MSC_VER) && !defined(__clang__)
-#pragma optimize("",off) // MSVC 2015 optimizer can't deal with this function.
+#pragma optimize("", off) // MSVC 2015 optimizer can't deal with this function.
#endif
static void EncodeFixedType(Record *R, std::vector<unsigned char> &ArgCodes,
MVT::SimpleValueType VT = getValueType(R->getValueAsDef("ElTy"));
EncodeFixedValueType(VT, Sig);
return;
- }
- else if (R->isSubClassOf("LLVMPointerTo"))
+ } else if (R->isSubClassOf("LLVMPointerTo"))
Sig.push_back(IIT_PTR_TO_ARG);
else if (R->isSubClassOf("LLVMVectorOfAnyPointersToElt")) {
Sig.push_back(IIT_VEC_OF_ANYPTRS_TO_ELT);
unsigned Tmp = 0;
switch (getValueType(R->getValueAsDef("VT"))) {
- default: break;
+ default:
+ break;
case MVT::iPTR:
UpdateArgCodes(R->getValueAsDef("ElTy"), ArgCodes, NumInserted, Mapping);
break;
case MVT::Any:
unsigned OriginalIdx = ArgCodes.size() - NumInserted;
assert(OriginalIdx >= Mapping.size());
- Mapping.resize(OriginalIdx+1);
+ Mapping.resize(OriginalIdx + 1);
Mapping[OriginalIdx] = ArgCodes.size();
ArgCodes.push_back(Tmp);
break;
}
#if defined(_MSC_VER) && !defined(__clang__)
-#pragma optimize("",on)
+#pragma optimize("", on)
#endif
/// ComputeFixedEncoding - If we can encode the type signature for this
unsigned NextArgCode = 0;
if (Int.IS.RetVTs.empty())
TypeSig.push_back(IIT_Done);
- else if (Int.IS.RetVTs.size() == 1 &&
- Int.IS.RetVTs[0] == MVT::isVoid)
+ else if (Int.IS.RetVTs.size() == 1 && Int.IS.RetVTs[0] == MVT::isVoid)
TypeSig.push_back(IIT_Done);
else {
switch (Int.IS.RetVTs.size()) {