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;
}
}
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) {}
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);
}