summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorJustin Bogner <mail@justinbogner.com>2014-03-12 20:40:14 +0000
committerJustin Bogner <mail@justinbogner.com>2014-03-12 20:40:14 +0000
commitf548af539cbb5a95e951ac409eb333fbeb46e2bb (patch)
tree06ad2c3af5d602aabd591fbe11761a3e9b9b6a3b /llvm
parenta1f278f96c2e96b38905b9351e66007a92a817a3 (diff)
downloadbcm5719-llvm-f548af539cbb5a95e951ac409eb333fbeb46e2bb.tar.gz
bcm5719-llvm-f548af539cbb5a95e951ac409eb333fbeb46e2bb.zip
Profile: Avoid an unnecessary __attribute__((packed))
MSVC doesn't understand it, and it wasn't really necessary anyway. llvm-svn: 203709
Diffstat (limited to 'llvm')
-rw-r--r--llvm/include/llvm/Profile/ProfileData.h1
-rw-r--r--llvm/include/llvm/Profile/ProfileDataWriter.h11
2 files changed, 3 insertions, 9 deletions
diff --git a/llvm/include/llvm/Profile/ProfileData.h b/llvm/include/llvm/Profile/ProfileData.h
index b25e82c1edc..72cc840e803 100644
--- a/llvm/include/llvm/Profile/ProfileData.h
+++ b/llvm/include/llvm/Profile/ProfileData.h
@@ -23,6 +23,7 @@ namespace llvm {
const char PROFILEDATA_MAGIC[4] = {'L', 'P', 'R', 'F'};
const uint32_t PROFILEDATA_VERSION = 1;
+const uint32_t PROFILEDATA_HEADER_SIZE = 24;
const error_category &profiledata_category();
diff --git a/llvm/include/llvm/Profile/ProfileDataWriter.h b/llvm/include/llvm/Profile/ProfileDataWriter.h
index 7e7802a83c7..3498d2eca3e 100644
--- a/llvm/include/llvm/Profile/ProfileDataWriter.h
+++ b/llvm/include/llvm/Profile/ProfileDataWriter.h
@@ -16,6 +16,7 @@
#define LLVM_PROFILE_PROFILEDATA_WRITER_H__
#include "llvm/ADT/StringMap.h"
+#include "llvm/Profile/ProfileData.h"
#include "llvm/Support/DataTypes.h"
#include "llvm/Support/raw_ostream.h"
@@ -23,14 +24,6 @@
namespace llvm {
-struct __attribute__((packed)) ProfileDataHeader {
- char Magic[4];
- uint32_t Version;
- uint32_t DataStart;
- uint32_t Padding;
- uint64_t MaxFunctionCount;
-};
-
/// Writer for instrumentation based profile data
class ProfileDataWriter {
StringMap<size_t> FunctionOffsets;
@@ -42,7 +35,7 @@ class ProfileDataWriter {
void write64(raw_ostream &OS, uint64_t Value);
public:
ProfileDataWriter()
- : DataStart(sizeof(ProfileDataHeader)), MaxFunctionCount(0) {}
+ : DataStart(PROFILEDATA_HEADER_SIZE), MaxFunctionCount(0) {}
void addFunctionCounts(StringRef FuncName, uint64_t FunctionHash,
uint64_t NumCounters, const uint64_t *Counters);
OpenPOWER on IntegriCloud