Skip to content

Commit

Permalink
Remove CLANG_FORMAT_COMMENT_ANCHOR (dotnet#100615)
Browse files Browse the repository at this point in the history
* Remove CLANG_FORMAT_COMMENT_ANCHOR

Not needed after dotnet#100498

* Fix build

* Formatting
  • Loading branch information
BruceForstall authored and matouskozak committed Apr 30, 2024
1 parent 86dfca2 commit 61bd842
Show file tree
Hide file tree
Showing 45 changed files with 31 additions and 190 deletions.
2 changes: 0 additions & 2 deletions src/coreclr/jit/codegen.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ class CodeGen final : public CodeGenInterface
// the GC info. Requires "codeSize" to be the size of the generated code, "prologSize" and "epilogSize"
// to be the sizes of the prolog and epilog, respectively. In DEBUG, makes a check involving the
// "codePtr", assumed to be a pointer to the start of the generated code.
CLANG_FORMAT_COMMENT_ANCHOR;

#ifdef JIT32_GCENCODER
void* genCreateAndStoreGCInfo(unsigned codeSize, unsigned prologSize, unsigned epilogSize DEBUGARG(void* codePtr));
Expand Down Expand Up @@ -529,7 +528,6 @@ class CodeGen final : public CodeGenInterface
//
// Epilog functions
//
CLANG_FORMAT_COMMENT_ANCHOR;

#if defined(TARGET_ARM)
bool genCanUsePopToReturn(regMaskTP maskPopRegsInt, bool jmpEpilog);
Expand Down
1 change: 0 additions & 1 deletion src/coreclr/jit/codegenarmarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5708,7 +5708,6 @@ void CodeGen::genFnEpilog(BasicBlock* block)
0, // disp
true); // isJump
// clang-format on
CLANG_FORMAT_COMMENT_ANCHOR;
#endif // TARGET_ARMARCH
}
#if FEATURE_FASTTAILCALL
Expand Down
40 changes: 14 additions & 26 deletions src/coreclr/jit/codegencommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ void CodeGenInterface::setFramePointerRequiredEH(bool value)
// if they are fully-interruptible. So if we have a catch
// or finally that will keep frame-vars alive, we need to
// force fully-interruptible.
CLANG_FORMAT_COMMENT_ANCHOR;

#ifdef DEBUG
if (verbose)
Expand Down Expand Up @@ -392,26 +391,25 @@ void CodeGen::genMarkLabelsForCodegen()
case BBJ_CALLFINALLY:
// The finally target itself will get marked by walking the EH table, below, and marking
// all handler begins.
CLANG_FORMAT_COMMENT_ANCHOR;

#if FEATURE_EH_CALLFINALLY_THUNKS
{
// For callfinally thunks, we need to mark the block following the callfinally/callfinallyret pair,
// as that's needed for identifying the range of the "duplicate finally" region in EH data.
BasicBlock* bbToLabel = block->Next();
if (block->isBBCallFinallyPair())
{
// For callfinally thunks, we need to mark the block following the callfinally/callfinallyret pair,
// as that's needed for identifying the range of the "duplicate finally" region in EH data.
BasicBlock* bbToLabel = block->Next();
if (block->isBBCallFinallyPair())
{
bbToLabel = bbToLabel->Next(); // skip the BBJ_CALLFINALLYRET
}
if (bbToLabel != nullptr)
{
JITDUMP(" " FMT_BB " : callfinally thunk region end\n", bbToLabel->bbNum);
bbToLabel->SetFlags(BBF_HAS_LABEL);
}
bbToLabel = bbToLabel->Next(); // skip the BBJ_CALLFINALLYRET
}
if (bbToLabel != nullptr)
{
JITDUMP(" " FMT_BB " : callfinally thunk region end\n", bbToLabel->bbNum);
bbToLabel->SetFlags(BBF_HAS_LABEL);
}
}
#endif // FEATURE_EH_CALLFINALLY_THUNKS

break;
break;

case BBJ_CALLFINALLYRET:
JITDUMP(" " FMT_BB " : finally continuation\n", block->GetFinallyContinuation()->bbNum);
Expand Down Expand Up @@ -932,7 +930,6 @@ void CodeGen::genAdjustStackLevel(BasicBlock* block)
{
#if !FEATURE_FIXED_OUT_ARGS
// Check for inserted throw blocks and adjust genStackLevel.
CLANG_FORMAT_COMMENT_ANCHOR;

#if defined(UNIX_X86_ABI)
if (isFramePointerUsed() && compiler->fgIsThrowHlpBlk(block))
Expand Down Expand Up @@ -1081,7 +1078,6 @@ bool CodeGen::genCreateAddrMode(GenTree* addr,
constant, or we have gone through a GT_NOP or GT_COMMA node. We never come back
here if we find a scaled index.
*/
CLANG_FORMAT_COMMENT_ANCHOR;

assert(mul == 0);

Expand Down Expand Up @@ -3436,7 +3432,6 @@ void CodeGen::genFnPrologCalleeRegArgs(regNumber xtraReg, bool* pXtraRegClobbere

/* At this point, everything that has the "circular" flag
* set to "true" forms a circular dependency */
CLANG_FORMAT_COMMENT_ANCHOR;

#ifdef DEBUG
if (regArgMaskLive)
Expand Down Expand Up @@ -4504,7 +4499,6 @@ void CodeGen::genCheckUseBlockInit()
// find structs that are guaranteed to be block initialized.
// If this logic changes, Compiler::fgVarNeedsExplicitZeroInit needs
// to be modified.
CLANG_FORMAT_COMMENT_ANCHOR;

#ifdef TARGET_64BIT
#if defined(TARGET_AMD64)
Expand Down Expand Up @@ -5311,7 +5305,6 @@ void CodeGen::genFinalizeFrame()
genCheckUseBlockInit();

// Set various registers as "modified" for special code generation scenarios: Edit & Continue, P/Invoke calls, etc.
CLANG_FORMAT_COMMENT_ANCHOR;

#if defined(TARGET_X86)

Expand Down Expand Up @@ -5778,7 +5771,6 @@ void CodeGen::genFnProlog()

// If there is a frame pointer used, due to frame pointer chaining it will point to the stored value of the
// previous frame pointer. Thus, stkOffs can't be zero.
CLANG_FORMAT_COMMENT_ANCHOR;

#if !defined(TARGET_AMD64)
// However, on amd64 there is no requirement to chain frame pointers.
Expand Down Expand Up @@ -6066,7 +6058,6 @@ void CodeGen::genFnProlog()
// Subtract the local frame size from SP.
//
//-------------------------------------------------------------------------
CLANG_FORMAT_COMMENT_ANCHOR;

#if !defined(TARGET_ARM64) && !defined(TARGET_LOONGARCH64) && !defined(TARGET_RISCV64)
regMaskTP maskStackAlloc = RBM_NONE;
Expand Down Expand Up @@ -6256,8 +6247,7 @@ void CodeGen::genFnProlog()
// we've set the live-in regs with values from the Tier0 frame.
//
// Otherwise we'll do some of these fetches twice.
//
CLANG_FORMAT_COMMENT_ANCHOR;

#if defined(TARGET_ARM64) || defined(TARGET_LOONGARCH64) || defined(TARGET_RISCV64)
genEnregisterOSRArgsAndLocals(initReg, &initRegZeroed);
#else
Expand Down Expand Up @@ -6648,7 +6638,6 @@ void CodeGen::genGeneratePrologsAndEpilogs()
genFnProlog();

// Generate all the prologs and epilogs.
CLANG_FORMAT_COMMENT_ANCHOR;

#if defined(FEATURE_EH_FUNCLETS)

Expand Down Expand Up @@ -8487,7 +8476,6 @@ void CodeGen::genPoisonFrame(regMaskTP regLiveIn)
if ((size / TARGET_POINTER_SIZE) > 16)
{
// This will require more than 16 instructions, switch to rep stosd/memset call.
CLANG_FORMAT_COMMENT_ANCHOR;
#if defined(TARGET_XARCH)
GetEmitter()->emitIns_R_S(INS_lea, EA_PTRSIZE, REG_EDI, (int)varNum, 0);
assert(size % 4 == 0);
Expand Down
2 changes: 0 additions & 2 deletions src/coreclr/jit/codegenlinear.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,6 @@ void CodeGen::genCodeForBBlist()

// Traverse the block in linear order, generating code for each node as we
// as we encounter it.
CLANG_FORMAT_COMMENT_ANCHOR;

#ifdef DEBUG
// Set the use-order numbers for each node.
Expand Down Expand Up @@ -1780,7 +1779,6 @@ void CodeGen::genConsumePutStructArgStk(GenTreePutArgStk* putArgNode,

// If the op1 is already in the dstReg - nothing to do.
// Otherwise load the op1 (the address) into the dstReg to copy the struct on the stack by value.
CLANG_FORMAT_COMMENT_ANCHOR;

#ifdef TARGET_X86
assert(dstReg != REG_SPBASE);
Expand Down
1 change: 0 additions & 1 deletion src/coreclr/jit/codegenloongarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1307,7 +1307,6 @@ void CodeGen::genFnEpilog(BasicBlock* block)
0, // disp
true); // isJump
// clang-format on
CLANG_FORMAT_COMMENT_ANCHOR;
}
#if FEATURE_FASTTAILCALL
else
Expand Down
1 change: 0 additions & 1 deletion src/coreclr/jit/codegenriscv64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1294,7 +1294,6 @@ void CodeGen::genFnEpilog(BasicBlock* block)
0, // disp
true); // isJump
// clang-format on
CLANG_FORMAT_COMMENT_ANCHOR;
}
#if FEATURE_FASTTAILCALL
else
Expand Down
5 changes: 0 additions & 5 deletions src/coreclr/jit/codegenxarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1719,7 +1719,6 @@ void CodeGen::inst_JMP(emitJumpKind jmp, BasicBlock* tgtBlock, bool isRemovableJ
//
// Thus only on x86 do we need to assert that the stack level at the target block matches the current stack level.
//
CLANG_FORMAT_COMMENT_ANCHOR;

#ifdef UNIX_X86_ABI
// bbTgtStkDepth is a (pure) argument count (stack alignment padding should be excluded).
Expand Down Expand Up @@ -6638,7 +6637,6 @@ void CodeGen::genJmpMethod(GenTree* jmp)
#endif // !defined(UNIX_AMD64_ABI)
{
// Register argument
CLANG_FORMAT_COMMENT_ANCHOR;
#ifdef TARGET_X86
noway_assert(isRegParamType(genActualType(varDsc->TypeGet())) ||
((varDsc->TypeGet() == TYP_STRUCT) &&
Expand Down Expand Up @@ -9125,7 +9123,6 @@ void CodeGen::genAmd64EmitterUnitTestsSse2()
//
// Loads
//
CLANG_FORMAT_COMMENT_ANCHOR;

genDefineTempLabel(genCreateTempLabel());

Expand Down Expand Up @@ -10742,7 +10739,6 @@ void CodeGen::genFuncletProlog(BasicBlock* block)
compiler->unwindEndProlog();

// TODO We may need EBP restore sequence here if we introduce PSPSym
CLANG_FORMAT_COMMENT_ANCHOR;

#ifdef UNIX_X86_ABI
// Add a padding for 16-byte alignment
Expand Down Expand Up @@ -10890,7 +10886,6 @@ void CodeGen::genZeroInitFrameUsingBlockInit(int untrLclHi, int untrLclLo, regNu
else
{
// Grab a non-argument, non-callee saved XMM reg
CLANG_FORMAT_COMMENT_ANCHOR;
#ifdef UNIX_AMD64_ABI
// System V x64 first temp reg is xmm8
regNumber zeroSIMDReg = genRegNumFromMask(RBM_XMM8);
Expand Down
6 changes: 0 additions & 6 deletions src/coreclr/jit/compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,6 @@ var_types Compiler::getArgTypeForStruct(CORINFO_CLASS_HANDLE clsHnd,
{
// We have a (large) struct that can't be replaced with a "primitive" type
// and can't be passed in multiple registers
CLANG_FORMAT_COMMENT_ANCHOR;

#if defined(TARGET_X86) || defined(TARGET_ARM) || defined(UNIX_AMD64_ABI)

Expand Down Expand Up @@ -1908,7 +1907,6 @@ void Compiler::compInit(ArenaAllocator* pAlloc,
//
// Initialize all the per-method statistics gathering data structures.
//
CLANG_FORMAT_COMMENT_ANCHOR;
#if LOOP_HOIST_STATS
m_loopsConsidered = 0;
m_curLoopHasHoistedExpression = false;
Expand Down Expand Up @@ -2279,7 +2277,6 @@ void Compiler::compSetProcessor()
//
// Processor specific optimizations
//
CLANG_FORMAT_COMMENT_ANCHOR;

CORINFO_InstructionSetFlags instructionSetFlags = jitFlags.GetInstructionSetFlags();
opts.compSupportsISA.Reset();
Expand Down Expand Up @@ -2880,7 +2877,6 @@ void Compiler::compInitOptions(JitFlags* jitFlags)
// The rest of the opts fields that we initialize here
// should only be used when we generate code for the method
// They should not be used when importing or inlining
CLANG_FORMAT_COMMENT_ANCHOR;

#if FEATURE_TAILCALL_OPT
opts.compTailCallLoopOpt = true;
Expand Down Expand Up @@ -5825,7 +5821,6 @@ void Compiler::generatePatchpointInfo()
//
// For arm64, if the frame pointer is not at the top of the frame, we need to adjust the
// offset.
CLANG_FORMAT_COMMENT_ANCHOR;

#if defined(TARGET_AMD64)
// We add +TARGET_POINTER_SIZE here is to account for the slot that Jit_Patchpoint
Expand Down Expand Up @@ -9866,7 +9861,6 @@ JITDBGAPI void __cdecl cTreeFlags(Compiler* comp, GenTree* tree)
chars += printf("flags=");

// Node flags
CLANG_FORMAT_COMMENT_ANCHOR;

#if defined(DEBUG)
if (tree->gtDebugFlags & GTF_DEBUG_NODE_LARGE)
Expand Down
4 changes: 0 additions & 4 deletions src/coreclr/jit/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -8945,7 +8945,6 @@ class Compiler
// We need to report the ISA dependency to the VM so that scenarios
// such as R2R work correctly for larger vector sizes, so we always
// do `compExactlyDependsOn` for such cases.
CLANG_FORMAT_COMMENT_ANCHOR;

#if defined(TARGET_XARCH)
if (compExactlyDependsOn(InstructionSet_VectorT512))
Expand Down Expand Up @@ -10364,7 +10363,6 @@ class Compiler
// There are cases where implicit RetBuf argument should be explicitly returned in a register.
// In such cases the return type is changed to TYP_BYREF and appropriate IR is generated.
// These cases are:
CLANG_FORMAT_COMMENT_ANCHOR;
#ifdef TARGET_AMD64
// 1. on x64 Windows and Unix the address of RetBuf needs to be returned by
// methods with hidden RetBufArg in RAX. In such case GT_RETURN is of TYP_BYREF,
Expand All @@ -10383,7 +10381,6 @@ class Compiler
#endif
// 3. Windows ARM64 native instance calling convention requires the address of RetBuff
// to be returned in x0.
CLANG_FORMAT_COMMENT_ANCHOR;
#if defined(TARGET_ARM64)
if (TargetOS::IsWindows)
{
Expand All @@ -10395,7 +10392,6 @@ class Compiler
}
#endif // TARGET_ARM64
// 4. x86 unmanaged calling conventions require the address of RetBuff to be returned in eax.
CLANG_FORMAT_COMMENT_ANCHOR;
#if defined(TARGET_X86)
if (info.compCallConv != CorInfoCallConvExtension::Managed)
{
Expand Down
3 changes: 0 additions & 3 deletions src/coreclr/jit/compiler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2594,7 +2594,6 @@ inline
if (!FPbased)
{
// Worst case stack based offset.
CLANG_FORMAT_COMMENT_ANCHOR;
#if FEATURE_FIXED_OUT_ARGS
int outGoingArgSpaceSize = lvaOutgoingArgSpaceSize;
#else
Expand All @@ -2606,7 +2605,6 @@ inline
else
{
// Worst case FP based offset.
CLANG_FORMAT_COMMENT_ANCHOR;

#ifdef TARGET_ARM
varOffset = codeGen->genCallerSPtoInitialSPdelta() - codeGen->genCallerSPtoFPdelta();
Expand Down Expand Up @@ -2694,7 +2692,6 @@ inline bool Compiler::lvaIsOriginalThisArg(unsigned varNum)
{
LclVarDsc* varDsc = lvaGetDesc(varNum);
// Should never write to or take the address of the original 'this' arg
CLANG_FORMAT_COMMENT_ANCHOR;

#ifndef JIT32_GCENCODER
// With the general encoder/decoder, when the original 'this' arg is needed as a generics context param, we
Expand Down
1 change: 0 additions & 1 deletion src/coreclr/jit/decomposelongs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2169,7 +2169,6 @@ void DecomposeLongs::TryPromoteLongVar(unsigned lclNum)
for (unsigned index = 0; index < 2; ++index)
{
// Grab the temp for the field local.
CLANG_FORMAT_COMMENT_ANCHOR;

// Lifetime of field locals might span multiple BBs, so they are long lifetime temps.
unsigned fieldLclNum = m_compiler->lvaGrabTemp(
Expand Down
2 changes: 0 additions & 2 deletions src/coreclr/jit/ee_il_dll.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,6 @@ unsigned Compiler::eeGetArgSize(CorInfoType corInfoType, CORINFO_CLASS_HANDLE ty

// Everything fits into a single 'slot' size
// to accommodate irregular sized structs, they are passed byref
CLANG_FORMAT_COMMENT_ANCHOR;

#ifdef UNIX_AMD64_ABI
if (varTypeIsStruct(argType))
Expand Down Expand Up @@ -396,7 +395,6 @@ unsigned Compiler::eeGetArgSize(CorInfoType corInfoType, CORINFO_CLASS_HANDLE ty

// For each target that supports passing struct args in multiple registers
// apply the target specific rules for them here:
CLANG_FORMAT_COMMENT_ANCHOR;

#if FEATURE_MULTIREG_ARGS
#if defined(TARGET_ARM64)
Expand Down
Loading

0 comments on commit 61bd842

Please sign in to comment.