[PATCH] D54252: [llvm-exegesis][NFC] Add missing header guard + cosmetics.
Clement Courbet via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 8 04:40:41 PST 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rL346400: [llvm-exegesis][NFC] Add missing header guard + cosmetics. (authored by courbet, committed by ).
Repository:
rL LLVM
https://reviews.llvm.org/D54252
Files:
llvm/trunk/tools/llvm-exegesis/lib/RegisterValue.h
llvm/trunk/tools/llvm-exegesis/lib/SnippetGenerator.cpp
Index: llvm/trunk/tools/llvm-exegesis/lib/SnippetGenerator.cpp
===================================================================
--- llvm/trunk/tools/llvm-exegesis/lib/SnippetGenerator.cpp
+++ llvm/trunk/tools/llvm-exegesis/lib/SnippetGenerator.cpp
@@ -91,7 +91,7 @@
if (Op.isUse()) {
const unsigned Reg = GetOpReg(Op);
if (Reg > 0 && !DefinedRegs.test(Reg)) {
- RIV.push_back(RegisterValue{Reg, llvm::APInt()});
+ RIV.push_back(RegisterValue::zero(Reg));
DefinedRegs.set(Reg);
}
}
Index: llvm/trunk/tools/llvm-exegesis/lib/RegisterValue.h
===================================================================
--- llvm/trunk/tools/llvm-exegesis/lib/RegisterValue.h
+++ llvm/trunk/tools/llvm-exegesis/lib/RegisterValue.h
@@ -14,14 +14,18 @@
///
//===----------------------------------------------------------------------===//
+#ifndef LLVM_TOOLS_LLVM_EXEGESIS_REGISTERVALUE_H
+#define LLVM_TOOLS_LLVM_EXEGESIS_REGISTERVALUE_H
+
#include <llvm/ADT/APFloat.h>
#include <llvm/ADT/APInt.h>
namespace llvm {
namespace exegesis {
// A simple object storing the value for a particular register.
struct RegisterValue {
+ static RegisterValue zero(unsigned Reg) { return {Reg, llvm::APInt()}; }
unsigned Register;
llvm::APInt Value;
};
@@ -45,3 +49,5 @@
} // namespace exegesis
} // namespace llvm
+
+#endif // LLVM_TOOLS_LLVM_EXEGESIS_REGISTERVALUE_H
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54252.173146.patch
Type: text/x-patch
Size: 1438 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181108/28562f8f/attachment.bin>
More information about the llvm-commits
mailing list