[PATCH] Fix DWARFContext::getCompileUnitForOffset().

Frederic Riss friss at apple.com
Tue Sep 16 13:32:58 PDT 2014


================
Comment at: lib/DebugInfo/DWARFUnit.h:50
@@ -57,2 +49,3 @@
     bool operator()(uint32_t LHS,
                     const std::unique_ptr<UnitType> &RHS) const {
+      return LHS < RHS->getNextUnitOffset();
----------------
dblaikie wrote:
> I'm rather surprised if this is the one function that's required. According to the spec, it looks like the specified value is passed as the RHS, not the LHS... 
Note I'm using upper_bound bellow. The link you provided says:
Change 25.3.3.2 [lib.upper.bound] paragraph 1 from:
-1- Requires: Type T is LessThanComparable (lib.lessthancomparable).
to:
-1- Requires: The elements e of [first, last) are partitioned with respect to the expression !(value < e) or !comp(value, e)

So value is on the LHS and the element at the RHS.

http://reviews.llvm.org/D5262






More information about the llvm-commits mailing list