[PATCH] D18857: Document source_filename in LangRef.

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 7 06:49:39 PDT 2016


tejohnson created this revision.
tejohnson added reviewers: joker.eph, majnemer.
tejohnson added a subscriber: llvm-commits.

Add documentation for new LLVM IR source_filename identifier.

http://reviews.llvm.org/D18857

Files:
  docs/LangRef.rst

Index: docs/LangRef.rst
===================================================================
--- docs/LangRef.rst
+++ docs/LangRef.rst
@@ -2139,6 +2139,26 @@
     uselistorder i32 (i32) @bar, { 1, 0 }
     uselistorder_bb @foo, %bb, { 5, 1, 3, 2, 0, 4 }
 
+.. _source_filename:
+
+Source Filename
+---------------
+
+The *source filename* string is set to the original module identifier,
+which will be the name of the compiled source file when compiling from
+source through the clang front end, for example. It is then preserved through
+the IR and bitcode.
+
+This is currently necessary to generate a consistent unique global
+identifier for local functions used in profile data, which prepends the
+source file name to the local function name.
+
+The syntax for the source file name is simply:
+
+.. code-block:: llvm
+
+    source_filename = "/path/to/source.c"
+
 .. _typesystem:
 
 Type System


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D18857.52910.patch
Type: text/x-patch
Size: 901 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160407/08b5b029/attachment.bin>


More information about the llvm-commits mailing list