[flang-commits] [PATCH] D79442: [flang] Add examples in documentation/BijectiveInternalNameUniquing.md

sameeran joshi via Phabricator via flang-commits flang-commits at lists.llvm.org
Tue May 5 13:31:20 PDT 2020


sameeranjoshi created this revision.
sameeranjoshi added reviewers: schweitz, kiranchandramohan, sscalpone, jeanPerier.
sameeranjoshi added a project: Flang.
Herald added a reviewer: jdoerfert.
Herald added a reviewer: DavidTruby.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

I thought it would be simpler to understand on how the unique names would look like when an example is present. So I added some examples.

I found 2 such places to add examples
-Common blocks
-Module scope global data


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D79442

Files:
  flang/documentation/BijectiveInternalNameUniquing.md


Index: flang/documentation/BijectiveInternalNameUniquing.md
===================================================================
--- flang/documentation/BijectiveInternalNameUniquing.md
+++ flang/documentation/BijectiveInternalNameUniquing.md
@@ -49,11 +49,48 @@
 
    * A common block name will be prefixed with `B`
 
+Given:
+```
+   common /variables/ i, j
+```
+
+The uniqued name of `variables` becomes:
+```
+    _QBvariables
+```
+
+Given:
+```
+   common i, j
+```
+
+The uniqued name in case of `blank common block` becomes:
+```
+    _QB
+```
+
 ### Module scope global data
 
    * A global data entity is prefixed with `E`
    * A global entity that is constant (parameter) will be prefixed with `EC`
 
+Given:
+```
+    module mod
+	 integer :: intvar
+	 real, parameter :: pi = 3.14
+```
+
+The uniqued name of `intvar` becomes:
+```
+    _QMmodEintvar
+```
+
+The uniqued name of `pi` becomes:
+```
+    _QMmodECpi
+```
+
 ### Procedures/Subprograms
 
    * A procedure/subprogram is prefixed with `P`


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D79442.262204.patch
Type: text/x-patch
Size: 1016 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20200505/a08a906e/attachment.bin>


More information about the flang-commits mailing list