Skip to content

Commit

Permalink
Merge pull request #59 from taewookoh/use_discriminator_encoding
Browse files Browse the repository at this point in the history
Use discriminator encoding
  • Loading branch information
danielcdh authored Dec 5, 2017
2 parents cf651b8 + cc79160 commit 0f13b0e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ create_llvm_prof_SOURCES = $(COMMON_PROFILE_CREATOR_FILES) \
llvm_profile_writer.cc create_llvm_prof.cc
create_llvm_prof_LDADD = $(LLVM_LDFLAGS) libquipper.a libglog.a libsymbolize.a \
libgflags.a
create_llvm_prof_CXXFLAGS = $(LLVM_CXXFLAGS)
create_llvm_prof_CXXFLAGS = $(LLVM_CXXFLAGS) -DCREATE_LLVM_PROF

noinst_LIBRARIES = libquipper.a
libquipper_a_SOURCES = chromiumos-wide-profiling/address_mapper.cc chromiumos-wide-profiling/perf_reader.cc \
Expand Down
7 changes: 4 additions & 3 deletions source_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@

#include <vector>

#if defined(HAVE_LLVM)
#include "config.h"
#if defined(CREATE_LLVM_PROF) && defined(HAVE_LLVM)
#include "llvm/IR/DebugInfoMetadata.h"
#endif

Expand Down Expand Up @@ -50,7 +51,7 @@ struct SourceInfo {
}

uint32 Offset(bool use_discriminator_encoding) const {
#if defined(HAVE_LLVM)
#if defined(CREATE_LLVM_PROF) && defined(HAVE_LLVM)
return ((line - start_line) << 16) |
(use_discriminator_encoding
? llvm::DILocation::getBaseDiscriminatorFromDiscriminator(
Expand All @@ -62,7 +63,7 @@ struct SourceInfo {
}

uint32 DuplicationFactor() const {
#if defined(HAVE_LLVM)
#if defined(CREATE_LLVM_PROF) && defined(HAVE_LLVM)
return llvm::DILocation::getDuplicationFactorFromDiscriminator(
discriminator);
#else
Expand Down

0 comments on commit 0f13b0e

Please sign in to comment.