Skip to content

Commit

Permalink
clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
nikic committed Mar 20, 2024
1 parent 1deaafc commit 0f2d875
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 20 deletions.
24 changes: 12 additions & 12 deletions llvm/include/llvm/Bitcode/LLVMBitCodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -400,18 +400,18 @@ enum ConstantsCodes {
CST_CODE_INLINEASM_OLD2 = 23, // INLINEASM: [sideeffect|alignstack|
// asmdialect,asmstr,conststr]
CST_CODE_CE_GEP_WITH_INRANGE_INDEX_OLD = 24, // [opty, flags, n x operands]
CST_CODE_CE_UNOP = 25, // CE_UNOP: [opcode, opval]
CST_CODE_POISON = 26, // POISON
CST_CODE_DSO_LOCAL_EQUIVALENT = 27, // DSO_LOCAL_EQUIVALENT [gvty, gv]
CST_CODE_INLINEASM_OLD3 = 28, // INLINEASM: [sideeffect|alignstack|
// asmdialect|unwind,
// asmstr,conststr]
CST_CODE_NO_CFI_VALUE = 29, // NO_CFI [ fty, f ]
CST_CODE_INLINEASM = 30, // INLINEASM: [fnty,
// sideeffect|alignstack|
// asmdialect|unwind,
// asmstr,conststr]
CST_CODE_CE_GEP_WITH_INRANGE = 31, // [opty, flags, range, n x operands]
CST_CODE_CE_UNOP = 25, // CE_UNOP: [opcode, opval]
CST_CODE_POISON = 26, // POISON
CST_CODE_DSO_LOCAL_EQUIVALENT = 27, // DSO_LOCAL_EQUIVALENT [gvty, gv]
CST_CODE_INLINEASM_OLD3 = 28, // INLINEASM: [sideeffect|alignstack|
// asmdialect|unwind,
// asmstr,conststr]
CST_CODE_NO_CFI_VALUE = 29, // NO_CFI [ fty, f ]
CST_CODE_INLINEASM = 30, // INLINEASM: [fnty,
// sideeffect|alignstack|
// asmdialect|unwind,
// asmstr,conststr]
CST_CODE_CE_GEP_WITH_INRANGE = 31, // [opty, flags, range, n x operands]
};

/// CastOpcodes - These are values used in the bitcode files to encode which
Expand Down
12 changes: 5 additions & 7 deletions llvm/lib/Bitcode/Reader/BitcodeReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3321,8 +3321,7 @@ Error BitcodeReader::parseConstants() {
unsigned OpNum = 0;
Type *PointeeType = nullptr;
if (BitCode == bitc::CST_CODE_CE_GEP_WITH_INRANGE_INDEX_OLD ||
BitCode == bitc::CST_CODE_CE_GEP_WITH_INRANGE ||
Record.size() % 2)
BitCode == bitc::CST_CODE_CE_GEP_WITH_INRANGE || Record.size() % 2)
PointeeType = getTypeByID(Record[OpNum++]);

bool InBounds = false;
Expand All @@ -3333,7 +3332,7 @@ Error BitcodeReader::parseConstants() {
unsigned InRangeIndex = Op >> 1;
// "Upgrade" inrange by dropping it. The feature is too niche to
// bother.
(void) InRangeIndex;
(void)InRangeIndex;
} else if (BitCode == bitc::CST_CODE_CE_GEP_WITH_INRANGE) {
uint64_t Op = Record[OpNum++];
InBounds = Op & 1;
Expand Down Expand Up @@ -3373,10 +3372,9 @@ Error BitcodeReader::parseConstants() {
return error("Missing element type for old-style constant GEP");
}

V = BitcodeConstant::create(Alloc, CurTy,
{Instruction::GetElementPtr, InBounds,
PointeeType, InRange},
Elts);
V = BitcodeConstant::create(
Alloc, CurTy,
{Instruction::GetElementPtr, InBounds, PointeeType, InRange}, Elts);
break;
}
case bitc::CST_CODE_CE_SELECT: { // CE_SELECT: [opval#, opval#, opval#]
Expand Down
3 changes: 2 additions & 1 deletion llvm/lib/IR/AsmWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1700,7 +1700,8 @@ static void WriteConstantInternal(raw_ostream &Out, const Constant *CV,
Out << ", ";
}

for (User::const_op_iterator OI=CE->op_begin(); OI != CE->op_end(); ++OI) {
for (User::const_op_iterator OI = CE->op_begin(); OI != CE->op_end();
++OI) {
WriterCtx.TypePrinter->print((*OI)->getType(), Out);
Out << ' ';
WriteAsOperandInternal(Out, *OI, WriterCtx);
Expand Down

0 comments on commit 0f2d875

Please sign in to comment.