diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2019-08-20 20:50:12 +0000 | 
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2019-08-20 20:50:12 +0000 | 
| commit | e6d1592492a3a379186bfb02bd0f4eda0669c0d5 (patch) | |
| tree | 599ab169a01f1c86eda9adc774edaedde2f2db5b /lib/IR/ProfileSummary.cpp | |
| parent | 1a56a5ead7a2e84bee8240f5f6b033b5f1707154 (diff) | |
Notes
Diffstat (limited to 'lib/IR/ProfileSummary.cpp')
| -rw-r--r-- | lib/IR/ProfileSummary.cpp | 13 | 
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/IR/ProfileSummary.cpp b/lib/IR/ProfileSummary.cpp index 491fe834df9a..11d95ac19be6 100644 --- a/lib/IR/ProfileSummary.cpp +++ b/lib/IR/ProfileSummary.cpp @@ -1,9 +1,8 @@  //=-- Profilesummary.cpp - Profile summary support --------------------------=//  // -//                     The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception  //  //===----------------------------------------------------------------------===//  // @@ -22,8 +21,6 @@  using namespace llvm; -const char *ProfileSummary::KindStr[2] = {"InstrProf", "SampleProfile"}; -  // Return an MDTuple with two elements. The first element is a string Key and  // the second is a uint64_t Value.  static Metadata *getKeyValMD(LLVMContext &Context, const char *Key, @@ -69,6 +66,7 @@ Metadata *ProfileSummary::getDetailedSummaryMD(LLVMContext &Context) {  // "SampleProfile"). The rest of the elements of the outer MDTuple are specific  // to the kind of profile summary as returned by getFormatSpecificMD.  Metadata *ProfileSummary::getMD(LLVMContext &Context) { +  const char *KindStr[3] = {"InstrProf", "CSInstrProf", "SampleProfile"};    Metadata *Components[] = {      getKeyValMD(Context, "ProfileFormat", KindStr[PSK]),      getKeyValMD(Context, "TotalCount", getTotalCount()), @@ -154,6 +152,9 @@ ProfileSummary *ProfileSummary::getFromMD(Metadata *MD) {    else if (isKeyValuePair(dyn_cast_or_null<MDTuple>(FormatMD), "ProfileFormat",                            "InstrProf"))      SummaryKind = PSK_Instr; +  else if (isKeyValuePair(dyn_cast_or_null<MDTuple>(FormatMD), "ProfileFormat", +                          "CSInstrProf")) +    SummaryKind = PSK_CSInstr;    else      return nullptr;  | 
