return ToContext.getTrivialTypeSourceInfo(*TOrErr, *BeginLocOrErr);
}
+namespace {
// To use this object, it should be created before the new attribute is created,
// and destructed after it is created. The construction already performs the
// import of the data.
return ToAttr;
}
};
+} // namespace
Expected<Attr *> ASTImporter::Import(const Attr *FromAttr) {
AttrImporter AI(*this);
return true;
}
+namespace {
/// Generic file handler interface.
class FileHandler {
public:
}
};
-namespace {
-
// This class implements a list of temporary files that are removed upon
// object destruction.
class TempFileHandlerRAII {
std::forward_list<SmallString<128u>> Files;
};
-} // end anonymous namespace
-
/// Handler for object files. The bundles are organized by sections with a
/// designated name.
///
return Error::success();
}
};
+} // namespace
/// Return an appropriate object file handler. We use the specific object
/// handler if we know how to deal with that format, otherwise we use a default
// Unsafe buffer usage analysis.
//===----------------------------------------------------------------------===//
+namespace {
class UnsafeBufferUsageReporter : public UnsafeBufferUsageHandler {
Sema &S;
D << F;
}
};
-
+} // namespace
//===----------------------------------------------------------------------===//
// AnalysisBasedWarnings - Worker object used by Sema to execute analysis-based
using Bindings = llvm::SmallVector<std::pair<const MemRegion *, SVal>, 4>;
+namespace {
class VarBindingsCollector : public StoreManager::BindingsHandler {
SymbolRef Sym;
Bindings &Result;
return true;
}
};
+} // namespace
Bindings getAllVarBindingsForSymbol(ProgramStateManager &Manager,
const ExplodedNode *Node, SymbolRef Sym) {
}
};
-} // end of anonymous namespace
-
//===----------------------------------------------------------------------===//
// StoreSiteFinder
//===----------------------------------------------------------------------===//
BugReporterContext &BRC,
PathSensitiveBugReport &BR) override;
};
+} // namespace
void StoreSiteFinder::Profile(llvm::FoldingSetNodeID &ID) const {
static int tag = 0;
return std::make_shared<PathDiagnosticEventPiece>(L, NodeText);
}
+namespace {
class DefaultStoreHandler final : public StoreHandler {
public:
using StoreHandler::StoreHandler;
return CombinedResult;
}
};
+} // namespace
Tracker::Tracker(PathSensitiveBugReport &Report) : Report(Report) {
// Default expression handlers.
static const int MAXIMUM_STEP_UNROLLED = 128;
+namespace {
struct LoopState {
private:
enum Kind { Normal, Unrolled } K;
ID.AddInteger(maxStep);
}
};
+} // namespace
// The tracked stack of loops. The stack indicates that which loops the
// simulated element contained by. The loops are marked depending if we decided
return DebugAggregate(Var.getVariable(), Var.getInlinedAt());
}
+namespace {
/// In dwarf emission, the following sequence
/// 1. dbg.value ... Fragment(0, 64)
/// 2. dbg.value ... Fragment(0, 32)
/// true if any variable locations have been added to FnVarLocs.
bool run(FunctionVarLocsBuilder *FnVarLocs);
};
+} // namespace
void AssignmentTrackingLowering::setLocKind(BlockInfo *LiveSet, VariableID Var,
LocKind K) {
return Modified;
}
+namespace {
class ExpandLargeDivRemLegacyPass : public FunctionPass {
public:
static char ID;
AU.addPreserved<GlobalsAAWrapperPass>();
}
};
+} // namespace
char ExpandLargeDivRemLegacyPass::ID = 0;
INITIALIZE_PASS_BEGIN(ExpandLargeDivRemLegacyPass, "expand-large-div-rem",
return Modified;
}
+namespace {
class ExpandLargeFpConvertLegacyPass : public FunctionPass {
public:
static char ID;
AU.addPreserved<GlobalsAAWrapperPass>();
}
};
+} // namespace
char ExpandLargeFpConvertLegacyPass::ID = 0;
INITIALIZE_PASS_BEGIN(ExpandLargeFpConvertLegacyPass, "expand-large-fp-convert",
F = nullptr;
}
+namespace {
class MachineCycleInfoPrinterPass : public MachineFunctionPass {
public:
static char ID;
bool runOnMachineFunction(MachineFunction &F) override;
void getAnalysisUsage(AnalysisUsage &AU) const override;
};
+} // namespace
char MachineCycleInfoPrinterPass::ID = 0;
using namespace llvm;
+namespace {
class MachineSanitizerBinaryMetadata : public MachineFunctionPass {
public:
static char ID;
MachineSanitizerBinaryMetadata();
bool runOnMachineFunction(MachineFunction &F) override;
};
+} // namespace
INITIALIZE_PASS(MachineSanitizerBinaryMetadata, "machine-sanmd",
"Machine Sanitizer Binary Metadata", false, false)
using namespace llvm;
+namespace {
class SPIRVObjectWriter : public MCObjectWriter {
::support::endian::Writer W;
uint64_t writeObject(MCAssembler &Asm, const MCAsmLayout &Layout) override;
void writeHeader(const MCAssembler &Asm);
};
+} // namespace
void SPIRVObjectWriter::writeHeader(const MCAssembler &Asm) {
constexpr uint32_t MagicNumber = 0x07230203;
static cl::opt<unsigned> SVEScatterOverhead("sve-scatter-overhead",
cl::init(10), cl::Hidden);
+namespace {
class TailFoldingKind {
private:
uint8_t Bits = 0; // Currently defaults to disabled.
void add(uint8_t Flag) { Bits |= Flag; }
void remove(uint8_t Flag) { Bits &= ~Flag; }
};
+} // namespace
TailFoldingKind TailFoldingKindLoc;
return checkVOPDRegConstraints(STII, *FirstMI, SecondMI);
}
+namespace {
/// Adapts design from MacroFusion
/// Puts valid candidate instructions back-to-back so they can easily
/// be turned into VOPD instructions
LLVM_DEBUG(dbgs() << "Completed VOPDPairingMutation\n");
}
};
+} // namespace
std::unique_ptr<ScheduleDAGMutation> llvm::createVOPDPairingMutation() {
return std::make_unique<VOPDPairingMutation>(shouldScheduleVOPDAdjacent);
#include "R600Subtarget.h"
#include "llvm/Analysis/ValueTracking.h"
+namespace {
class R600DAGToDAGISel : public AMDGPUDAGToDAGISel {
const R600Subtarget *Subtarget;
// Include the pieces autogenerated from the target description.
#include "R600GenDAGISel.inc"
};
+} // namespace
bool R600DAGToDAGISel::runOnMachineFunction(MachineFunction &MF) {
Subtarget = &MF.getSubtarget<R600Subtarget>();
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCExpr.h"
+namespace {
class R600MCInstLower : public AMDGPUMCInstLower {
public:
R600MCInstLower(MCContext &ctx, const R600Subtarget &ST,
/// Lower a MachineInstr to an MCInst
void lower(const MachineInstr *MI, MCInst &OutMI) const;
};
+} // namespace
R600MCInstLower::R600MCInstLower(MCContext &Ctx, const R600Subtarget &ST,
const AsmPrinter &AP)
return TargetTransformInfo(R600TTIImpl(this, F));
}
+namespace {
class R600PassConfig final : public AMDGPUPassConfig {
public:
R600PassConfig(LLVMTargetMachine &TM, PassManagerBase &PM)
void addPreSched2() override;
void addPreEmitPass() override;
};
+} // namespace
//===----------------------------------------------------------------------===//
// R600 Pass Setup
return SDValue();
}
+namespace {
// Helper class contains information about comparison operation.
// The first two operands of this operation are compared values and the
// last one is the operation.
// Returns consition code of comparison operation.
ISD::CondCode getCondCode() const { return CCode; }
};
+} // namespace
// Verifies conditions to apply an optimization.
// Returns Reference comparison code and three operands A, B, C.
return OffDisp;
}
+namespace {
class EliminateFrameIndex {
const TargetInstrInfo &TII;
const TargetRegisterInfo &TRI;
void processMI(MachineInstr &MI, Register FrameReg, int64_t Offset,
int FIOperandNum);
};
+} // namespace
// Prepare the frame index if it doesn't fit in the immediate field. Use
// clobber register to hold calculated address.
return RM.value_or(Reloc::Static);
}
+namespace {
class VEELFTargetObjectFile : public TargetLoweringObjectFileELF {
void Initialize(MCContext &Ctx, const TargetMachine &TM) override {
TargetLoweringObjectFileELF::Initialize(Ctx, TM);
InitializeELF(TM.Options.UseInitArray);
}
};
+} // namespace
static std::unique_ptr<TargetLoweringObjectFile> createTLOF() {
return std::make_unique<VEELFTargetObjectFile>();
#define PASS_KEY "x86-return-thunks"
#define DEBUG_TYPE PASS_KEY
+namespace {
struct X86ReturnThunks final : public MachineFunctionPass {
static char ID;
X86ReturnThunks() : MachineFunctionPass(ID) {}
StringRef getPassName() const override { return "X86 Return Thunks"; }
bool runOnMachineFunction(MachineFunction &MF) override;
};
+} // namespace
char X86ReturnThunks::ID = 0;
cl::desc("Widen the loop induction variables, if possible, so "
"overflow checks won't reject flattening"));
+namespace {
// We require all uses of both induction variables to match this pattern:
//
// (OuterPHI * InnerTripCount) + InnerPHI
return true;
}
};
+} // namespace
static bool
setLoopComponents(Value *&TC, Value *&TripCount, BinaryOperator *&Increment,
StoreEv, LoadEv, BECount);
}
+namespace {
class MemmoveVerifier {
public:
explicit MemmoveVerifier(const Value &LoadBasePtr, const Value &StoreBasePtr,
public:
const bool IsSameObject;
};
+} // namespace
bool LoopIdiomRecognize::processLoopStoreOfLoopLoad(
Value *DestPtr, Value *SourcePtr, const SCEV *StoreSizeSCEV,
return std::nullopt;
}
+namespace {
// Forward declare GeneratedRTChecks.
class GeneratedRTChecks;
+} // namespace
namespace llvm {
};
} // end namespace llvm
+namespace {
/// Helper struct to manage generating runtime checks for vectorization.
///
/// The runtime checks are created up-front in temporary blocks to allow better
return MemCheckBlock;
}
};
+} // namespace
// Return true if \p OuterLp is an outer loop annotated with hints for explicit
// vectorization. The loop needs to be annotated with #pragma omp simd
});
}
+namespace {
/// Helper class to indicate whether a vector index can be safely scalarized and
/// if a freeze needs to be inserted.
class ScalarizationResult {
ToFreeze = nullptr;
}
};
+} // namespace
/// Check if it is legal to scalarize a memory access to \p VecTy at index \p
/// Idx. \p Idx must access a valid vector element.