[llvm] r267150 - Document source_filename in LangRef.

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 22 06:09:18 PDT 2016


Author: tejohnson
Date: Fri Apr 22 08:09:17 2016
New Revision: 267150

URL: http://llvm.org/viewvc/llvm-project?rev=267150&view=rev
Log:
Document source_filename in LangRef.

Summary: Add documentation for new LLVM IR source_filename identifier.

Reviewers: joker.eph, majnemer

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D18857

Modified:
    llvm/trunk/docs/LangRef.rst

Modified: llvm/trunk/docs/LangRef.rst
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/LangRef.rst?rev=267150&r1=267149&r2=267150&view=diff
==============================================================================
--- llvm/trunk/docs/LangRef.rst (original)
+++ llvm/trunk/docs/LangRef.rst Fri Apr 22 08:09:17 2016
@@ -2196,6 +2196,26 @@ function's scope.
     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




More information about the llvm-commits mailing list