X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FSupport%2FFileUtilities.cpp;h=6a65ccae3e40e7a3c7caf624b151e7f2f5cff2dc;hb=ef9531efedd2233269f670227fb0e6aae7480d53;hp=0a6e154d9264062eeb35eca40228e380db9c870b;hpb=2ee51cbeb8f83f0b04d9611535151c801bbe3d4b;p=oota-llvm.git diff --git a/lib/Support/FileUtilities.cpp b/lib/Support/FileUtilities.cpp index 0a6e154d926..6a65ccae3e4 100644 --- a/lib/Support/FileUtilities.cpp +++ b/lib/Support/FileUtilities.cpp @@ -18,6 +18,7 @@ #include "llvm/ADT/StringExtras.h" #include #include +#include using namespace llvm; static bool isNumberChar(char C) { @@ -47,6 +48,14 @@ static bool CompareNumbers(char *&F1P, char *&F2P, char *F1End, char *F2End, std::string *ErrorMsg) { char *F1NumEnd, *F2NumEnd; double V1 = 0.0, V2 = 0.0; + + // If one of the positions is at a space and the other isn't, chomp up 'til + // the end of the space. + while (isspace(*F1P) && F1P != F1End) + ++F1P; + while (isspace(*F2P) && F2P != F2End) + ++F2P; + // If we stop on numbers, compare their difference. if (isNumberChar(*F1P) && isNumberChar(*F2P)) { V1 = strtod(F1P, &F1NumEnd);