From 4ae214d5d7eb20e5bafadc1bafc9dcdae64d5f24 Mon Sep 17 00:00:00 2001 From: Alex Lorenz Date: Tue, 11 Aug 2015 22:17:22 +0000 Subject: Reformat PseudoSourceValue.cpp and PseudoSourceValue.h. NFC. This commit reformats the files lib/CodeGen/PseudoSourceValue.cpp and include/llvm/CodeGen/PseudoSourceValue.h using clang-format. This change is done in preparation for the changes to the pseudo source value object management and to the PseudoSourceValue's class hierarchy. llvm-svn: 244685 --- llvm/lib/CodeGen/PseudoSourceValue.cpp | 55 ++++++++++++++++------------------ 1 file changed, 26 insertions(+), 29 deletions(-) (limited to 'llvm/lib/CodeGen/PseudoSourceValue.cpp') diff --git a/llvm/lib/CodeGen/PseudoSourceValue.cpp b/llvm/lib/CodeGen/PseudoSourceValue.cpp index b1c341d3a68..5c9bec9aa0e 100644 --- a/llvm/lib/CodeGen/PseudoSourceValue.cpp +++ b/llvm/lib/CodeGen/PseudoSourceValue.cpp @@ -26,13 +26,15 @@ namespace { struct PSVGlobalsTy { // PseudoSourceValues are immutable so don't need locking. const PseudoSourceValue PSVs[4]; - sys::Mutex Lock; // Guards FSValues, but not the values inside it. + sys::Mutex Lock; // Guards FSValues, but not the values inside it. std::map FSValues; PSVGlobalsTy() : PSVs() {} ~PSVGlobalsTy() { for (std::map::iterator - I = FSValues.begin(), E = FSValues.end(); I != E; ++I) { + I = FSValues.begin(), + E = FSValues.end(); + I != E; ++I) { delete I->second; } } @@ -40,23 +42,23 @@ struct PSVGlobalsTy { static ManagedStatic PSVGlobals; -} // anonymous namespace - -const PseudoSourceValue *PseudoSourceValue::getStack() -{ return &PSVGlobals->PSVs[0]; } -const PseudoSourceValue *PseudoSourceValue::getGOT() -{ return &PSVGlobals->PSVs[1]; } -const PseudoSourceValue *PseudoSourceValue::getJumpTable() -{ return &PSVGlobals->PSVs[2]; } -const PseudoSourceValue *PseudoSourceValue::getConstantPool() -{ return &PSVGlobals->PSVs[3]; } - -static const char *const PSVNames[] = { - "Stack", - "GOT", - "JumpTable", - "ConstantPool" -}; +} // anonymous namespace + +const PseudoSourceValue *PseudoSourceValue::getStack() { + return &PSVGlobals->PSVs[0]; +} +const PseudoSourceValue *PseudoSourceValue::getGOT() { + return &PSVGlobals->PSVs[1]; +} +const PseudoSourceValue *PseudoSourceValue::getJumpTable() { + return &PSVGlobals->PSVs[2]; +} +const PseudoSourceValue *PseudoSourceValue::getConstantPool() { + return &PSVGlobals->PSVs[3]; +} + +static const char *const PSVNames[] = {"Stack", "GOT", "JumpTable", + "ConstantPool"}; PseudoSourceValue::PseudoSourceValue(bool isFixed) : isFixed(isFixed) {} @@ -78,31 +80,26 @@ const PseudoSourceValue *PseudoSourceValue::getFixedStack(int FI) { bool PseudoSourceValue::isConstant(const MachineFrameInfo *) const { if (this == getStack()) return false; - if (this == getGOT() || - this == getConstantPool() || - this == getJumpTable()) + if (this == getGOT() || this == getConstantPool() || this == getJumpTable()) return true; llvm_unreachable("Unknown PseudoSourceValue!"); } bool PseudoSourceValue::isAliased(const MachineFrameInfo *MFI) const { - if (this == getStack() || - this == getGOT() || - this == getConstantPool() || + if (this == getStack() || this == getGOT() || this == getConstantPool() || this == getJumpTable()) return false; llvm_unreachable("Unknown PseudoSourceValue!"); } bool PseudoSourceValue::mayAlias(const MachineFrameInfo *MFI) const { - if (this == getGOT() || - this == getConstantPool() || - this == getJumpTable()) + if (this == getGOT() || this == getConstantPool() || this == getJumpTable()) return false; return true; } -bool FixedStackPseudoSourceValue::isConstant(const MachineFrameInfo *MFI) const{ +bool FixedStackPseudoSourceValue::isConstant( + const MachineFrameInfo *MFI) const { return MFI && MFI->isImmutableObjectIndex(FI); } -- cgit v1.2.3