Skip to content

Instantly share code, notes, and snippets.

@kaworu
Created November 15, 2013 17:11
Show Gist options
  • Save kaworu/7487982 to your computer and use it in GitHub Desktop.
Save kaworu/7487982 to your computer and use it in GitHub Desktop.
Patch for LLVM to build under DragonFly
diff --git a/include/llvm/Analysis/BlockFrequencyImpl.h b/include/llvm/Analysis/BlockFrequencyImpl.h
index 817a441..cbbd934 100644
--- a/include/llvm/Analysis/BlockFrequencyImpl.h
+++ b/include/llvm/Analysis/BlockFrequencyImpl.h
@@ -235,8 +235,9 @@ class BlockFrequencyImpl {
//
// Iterations = 1 / ExitProb
//
- uint64_t D = std::max(getBlockFreq(Head).getFrequency(), UINT64_C(1));
- uint64_t N = std::max(BackFreq.getFrequency(), UINT64_C(1));
+ uint64_t one = UINT64_C(1);
+ uint64_t D = std::max(getBlockFreq(Head).getFrequency(), one);
+ uint64_t N = std::max(BackFreq.getFrequency(), one);
if (N < D)
N = D - N;
else
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment