From deb80b5397fd53debca9a8f6afa5a35c29420287 Mon Sep 17 00:00:00 2001 From: NAKAMURA Takumi Date: Mon, 5 Oct 2015 04:46:30 +0000 Subject: [PATCH] Reformat partially. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249288 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/CodeGen/MachineConstantPool.h | 15 +++++----- include/llvm/CodeGen/RegAllocRegistry.h | 5 ++-- include/llvm/CodeGen/RegisterScavenging.h | 6 ++-- include/llvm/CodeGen/SelectionDAGNodes.h | 18 ++++++------ include/llvm/MC/MCRegisterInfo.h | 6 ++-- include/llvm/PassInfo.h | 34 ++++++++++------------ 6 files changed, 38 insertions(+), 46 deletions(-) diff --git a/include/llvm/CodeGen/MachineConstantPool.h b/include/llvm/CodeGen/MachineConstantPool.h index d7db50c1c30..c82935a251b 100644 --- a/include/llvm/CodeGen/MachineConstantPool.h +++ b/include/llvm/CodeGen/MachineConstantPool.h @@ -88,9 +88,9 @@ public: Val.ConstVal = V; } MachineConstantPoolEntry(MachineConstantPoolValue *V, unsigned A) - : Alignment(A) { - Val.MachineCPVal = V; - Alignment |= 1U << (sizeof(unsigned)*CHAR_BIT-1); + : Alignment(A) { + Val.MachineCPVal = V; + Alignment |= 1U << (sizeof(unsigned) * CHAR_BIT - 1); } /// isMachineConstantPoolEntry - Return true if the MachineConstantPoolEntry @@ -100,8 +100,8 @@ public: return (int)Alignment < 0; } - int getAlignment() const { - return Alignment & ~(1 << (sizeof(unsigned)*CHAR_BIT-1)); + int getAlignment() const { + return Alignment & ~(1 << (sizeof(unsigned) * CHAR_BIT - 1)); } Type *getType() const; @@ -155,8 +155,9 @@ public: /// an existing one. User must specify the minimum required alignment for /// the object. unsigned getConstantPoolIndex(const Constant *C, unsigned Alignment); - unsigned getConstantPoolIndex(MachineConstantPoolValue *V,unsigned Alignment); - + unsigned getConstantPoolIndex(MachineConstantPoolValue *V, + unsigned Alignment); + /// isEmpty - Return true if this constant pool contains no constants. bool isEmpty() const { return Constants.empty(); } diff --git a/include/llvm/CodeGen/RegAllocRegistry.h b/include/llvm/CodeGen/RegAllocRegistry.h index d6d8c8229f3..5c7e9999cc9 100644 --- a/include/llvm/CodeGen/RegAllocRegistry.h +++ b/include/llvm/CodeGen/RegAllocRegistry.h @@ -33,9 +33,8 @@ public: static MachinePassRegistry Registry; RegisterRegAlloc(const char *N, const char *D, FunctionPassCtor C) - : MachinePassRegistryNode(N, D, (MachinePassCtor)C) - { - Registry.Add(this); + : MachinePassRegistryNode(N, D, (MachinePassCtor)C) { + Registry.Add(this); } ~RegisterRegAlloc() { Registry.Remove(this); } diff --git a/include/llvm/CodeGen/RegisterScavenging.h b/include/llvm/CodeGen/RegisterScavenging.h index 5de4e3851e0..6517a58f5c0 100644 --- a/include/llvm/CodeGen/RegisterScavenging.h +++ b/include/llvm/CodeGen/RegisterScavenging.h @@ -104,10 +104,8 @@ public: MBBI = I; } - MachineBasicBlock::iterator getCurrentPosition() const { - return MBBI; - } - + MachineBasicBlock::iterator getCurrentPosition() const { return MBBI; } + /// Return if a specific register is currently used. bool isRegUsed(unsigned Reg, bool includeReserved = true) const; diff --git a/include/llvm/CodeGen/SelectionDAGNodes.h b/include/llvm/CodeGen/SelectionDAGNodes.h index 972f0b9ed20..523e10c8584 100644 --- a/include/llvm/CodeGen/SelectionDAGNodes.h +++ b/include/llvm/CodeGen/SelectionDAGNodes.h @@ -2020,9 +2020,9 @@ class MaskedLoadStoreSDNode : public MemSDNode { public: friend class SelectionDAG; MaskedLoadStoreSDNode(ISD::NodeType NodeTy, unsigned Order, DebugLoc dl, - SDValue *Operands, unsigned numOperands, - SDVTList VTs, EVT MemVT, MachineMemOperand *MMO) - : MemSDNode(NodeTy, Order, dl, VTs, MemVT, MMO) { + SDValue *Operands, unsigned numOperands, SDVTList VTs, + EVT MemVT, MachineMemOperand *MMO) + : MemSDNode(NodeTy, Order, dl, VTs, MemVT, MMO) { InitOperands(Ops, Operands, numOperands); } @@ -2126,8 +2126,8 @@ public: MMO) { assert(getValue().getValueType() == getValueType(0) && "Incompatible type of the PathThru value in MaskedGatherSDNode"); - assert(getMask().getValueType().getVectorNumElements() == - getValueType(0).getVectorNumElements() && + assert(getMask().getValueType().getVectorNumElements() == + getValueType(0).getVectorNumElements() && "Vector width mismatch between mask and data"); assert(getMask().getValueType().getScalarType() == MVT::i1 && "Vector width mismatch between mask and data"); @@ -2146,10 +2146,10 @@ public: friend class SelectionDAG; MaskedScatterSDNode(unsigned Order, DebugLoc dl,ArrayRef Operands, SDVTList VTs, EVT MemVT, MachineMemOperand *MMO) - : MaskedGatherScatterSDNode(ISD::MSCATTER, Order, dl, Operands, VTs, MemVT, - MMO) { - assert(getMask().getValueType().getVectorNumElements() == - getValue().getValueType().getVectorNumElements() && + : MaskedGatherScatterSDNode(ISD::MSCATTER, Order, dl, Operands, VTs, + MemVT, MMO) { + assert(getMask().getValueType().getVectorNumElements() == + getValue().getValueType().getVectorNumElements() && "Vector width mismatch between mask and data"); assert(getMask().getValueType().getScalarType() == MVT::i1 && "Vector width mismatch between mask and data"); diff --git a/include/llvm/MC/MCRegisterInfo.h b/include/llvm/MC/MCRegisterInfo.h index 8f0e6c2fc6c..a4d5e086723 100644 --- a/include/llvm/MC/MCRegisterInfo.h +++ b/include/llvm/MC/MCRegisterInfo.h @@ -652,10 +652,8 @@ public: } } - bool isValid() const { - return RI.isValid(); - } - + bool isValid() const { return RI.isValid(); } + unsigned operator*() const { assert (SI.isValid() && "Cannot dereference an invalid iterator."); return *SI; diff --git a/include/llvm/PassInfo.h b/include/llvm/PassInfo.h index 321b100a189..cee4ade323e 100644 --- a/include/llvm/PassInfo.h +++ b/include/llvm/PassInfo.h @@ -33,13 +33,13 @@ public: typedef Pass *(*TargetMachineCtor_t)(TargetMachine *); private: - const char *const PassName; // Nice name for Pass - const char *const PassArgument; // Command Line argument to run this pass - const void *PassID; - const bool IsCFGOnlyPass; // Pass only looks at the CFG. - const bool IsAnalysis; // True if an analysis pass. - const bool IsAnalysisGroup; // True if an analysis group. - std::vector ItfImpl;// Interfaces implemented by this pass + const char *const PassName; // Nice name for Pass + const char *const PassArgument; // Command Line argument to run this pass + const void *PassID; + const bool IsCFGOnlyPass; // Pass only looks at the CFG. + const bool IsAnalysis; // True if an analysis pass. + const bool IsAnalysisGroup; // True if an analysis group. + std::vector ItfImpl; // Interfaces implemented by this pass NormalCtor_t NormalCtor; TargetMachineCtor_t TargetMachineCtor; @@ -50,18 +50,16 @@ public: PassInfo(const char *name, const char *arg, const void *pi, NormalCtor_t normal, bool isCFGOnly, bool is_analysis, TargetMachineCtor_t machine = nullptr) - : PassName(name), PassArgument(arg), PassID(pi), - IsCFGOnlyPass(isCFGOnly), - IsAnalysis(is_analysis), IsAnalysisGroup(false), NormalCtor(normal), - TargetMachineCtor(machine) {} + : PassName(name), PassArgument(arg), PassID(pi), IsCFGOnlyPass(isCFGOnly), + IsAnalysis(is_analysis), IsAnalysisGroup(false), NormalCtor(normal), + TargetMachineCtor(machine) {} /// PassInfo ctor - Do not call this directly, this should only be invoked /// through RegisterPass. This version is for use by analysis groups; it /// does not auto-register the pass. PassInfo(const char *name, const void *pi) - : PassName(name), PassArgument(""), PassID(pi), - IsCFGOnlyPass(false), - IsAnalysis(false), IsAnalysisGroup(true), NormalCtor(nullptr), - TargetMachineCtor(nullptr) {} + : PassName(name), PassArgument(""), PassID(pi), IsCFGOnlyPass(false), + IsAnalysis(false), IsAnalysisGroup(true), NormalCtor(nullptr), + TargetMachineCtor(nullptr) {} /// getPassName - Return the friendly name for the pass, never returns null /// @@ -78,10 +76,8 @@ public: const void *getTypeInfo() const { return PassID; } /// Return true if this PassID implements the specified ID pointer. - bool isPassID(const void *IDPtr) const { - return PassID == IDPtr; - } - + bool isPassID(const void *IDPtr) const { return PassID == IDPtr; } + /// isAnalysisGroup - Return true if this is an analysis group, not a normal /// pass. /// -- 2.34.1