r259031 - Fix isBeforeInTranslationUnit to not abort on macros defined in cmdline.

David Blaikie via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 28 08:11:16 PST 2016


Test case?

On Thu, Jan 28, 2016 at 1:28 AM, Yury Gribov via cfe-commits <
cfe-commits at lists.llvm.org> wrote:

> Author: ygribov
> Date: Thu Jan 28 03:28:18 2016
> New Revision: 259031
>
> URL: http://llvm.org/viewvc/llvm-project?rev=259031&view=rev
> Log:
> Fix isBeforeInTranslationUnit to not abort on macros defined in cmdline.
>
> Differential Revision: http://reviews.llvm.org/D15804
>
> Modified:
>     cfe/trunk/lib/Basic/SourceManager.cpp
>
> Modified: cfe/trunk/lib/Basic/SourceManager.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/SourceManager.cpp?rev=259031&r1=259030&r2=259031&view=diff
>
> ==============================================================================
> --- cfe/trunk/lib/Basic/SourceManager.cpp (original)
> +++ cfe/trunk/lib/Basic/SourceManager.cpp Thu Jan 28 03:28:18 2016
> @@ -2110,6 +2110,14 @@ bool SourceManager::isBeforeInTranslatio
>      assert(LOffs.first == ROffs.first);
>      return false;
>    }
> +  bool LIsScratch = strcmp("<scratch space>", LB) == 0;
> +  bool RIsScratch = strcmp("<scratch space>", RB) == 0;
> +  // Sort scratch after inline asm, but before the rest.
> +  if (LIsScratch || RIsScratch) {
> +    if (LIsScratch != RIsScratch)
> +      return LIsScratch;
> +    return LOffs.second < ROffs.second;
> +  }
>    llvm_unreachable("Unsortable locations found");
>  }
>
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160128/110d56f1/attachment.html>


More information about the cfe-commits mailing list