[PATCH] D30663: Use filename in linemarker when compiling preprocessed source (Revised)

Bob Haarman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 6 10:51:46 PST 2017


inglorion added inline comments.


================
Comment at: test/Frontend/preprocessed-input.c:3
+// RUN: %clang -emit-llvm -S -o - %t.i | FileCheck %s
+// CHECK: source_filename = {{.*}}preprocessed-input.c"{{$}}
----------------
Actually, I think you don't even have to run the preprocessor - you can just put the file with the linemarker here and check that the name from the linemarker is propagated, right?

Also, it seems that there is a similar issue to the one you're trying to fix when going from .ll to .o (or .ll to .s, for that matter) - the name is taken from the file you're reading from, not from the source_filename directive in that file. Of course, that doesn't differ from gcc (given that gcc doesn't handle .ll files), but you may want to address that, too, for consistency.


https://reviews.llvm.org/D30663





More information about the cfe-commits mailing list