summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/PseudoSourceValue.cpp
diff options
context:
space:
mode:
authorAlex Lorenz <arphaman@gmail.com>2015-08-11 22:17:22 +0000
committerAlex Lorenz <arphaman@gmail.com>2015-08-11 22:17:22 +0000
commit4ae214d5d7eb20e5bafadc1bafc9dcdae64d5f24 (patch)
tree758e9f54b81b21e3dbec5a7dcb628a32bc03213e /llvm/lib/CodeGen/PseudoSourceValue.cpp
parent438ffe5eac02270208529d29330eef76991af70f (diff)
downloadbcm5719-llvm-4ae214d5d7eb20e5bafadc1bafc9dcdae64d5f24.tar.gz
bcm5719-llvm-4ae214d5d7eb20e5bafadc1bafc9dcdae64d5f24.zip
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
Diffstat (limited to 'llvm/lib/CodeGen/PseudoSourceValue.cpp')
-rw-r--r--llvm/lib/CodeGen/PseudoSourceValue.cpp55
1 files changed, 26 insertions, 29 deletions
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<int, const PseudoSourceValue *> FSValues;
PSVGlobalsTy() : PSVs() {}
~PSVGlobalsTy() {
for (std::map<int, const PseudoSourceValue *>::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<PSVGlobalsTy> 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);
}
OpenPOWER on IntegriCloud