Skip to content

Commit

Permalink
BinaryFunction.h: Clarify commet for getSize(), add getNumNonPseudos()
Browse files Browse the repository at this point in the history
Summary: Minor fix and add new function

(cherry picked from FBD5270376)
  • Loading branch information
yzhao30 authored and maksfb committed Jun 17, 2017
1 parent dc4dd64 commit 37d0f81
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion bolt/BinaryFunction.h
Expand Up @@ -1093,7 +1093,7 @@ class BinaryFunction {
return FileOffset;
}

/// Return (original) size of the function.
/// Return (original) byte size of the function.
uint64_t getSize() const {
return Size;
}
Expand All @@ -1103,6 +1103,15 @@ class BinaryFunction {
return MaxSize;
}

/// Return the number of emitted instructions for this function.
uint32_t getNumNonPseudos() const {
uint32_t N = 0;
for (auto &BB : layout()) {
N += BB->getNumNonPseudos();
}
return N;
}

/// Return MC symbol associated with the function.
/// All references to the function should use this symbol.
MCSymbol *getSymbol() {
Expand Down

0 comments on commit 37d0f81

Please sign in to comment.