[PATCH] D10522: Implement target independent TLS compatible with glibc's emutls.c.

Chih-Hung Hsieh chh at google.com
Thu Jul 16 17:31:21 PDT 2015


chh marked 3 inline comments as done.

================
Comment at: docs/LangRef.rst:490
@@ -487,1 +489,3 @@
+When a target does not implement "general dynamic" model, it might
+implemet the "emulated" mode as the default.
 
----------------
beanz wrote:
> s/implemet/implement/
This part will be removed due to new simplified clang/driver flags.


================
Comment at: lib/CodeGen/AsmPrinter/AsmPrinter.cpp:381
@@ -363,2 +380,3 @@
   MCSymbol *GVSym = getSymbol(GV);
-  EmitVisibility(GVSym, GV->getVisibility(), !GV->isDeclaration());
+  MCSymbol *EmittedSym = IsEmuTLSVar ?
+      createEmuTLSControlSym(GVSym, OutContext) : GVSym;
----------------
davidxl wrote:
> Should GVSym be just overwritten for emulated tls?
They are two different symbols in the emulated mode.
It helps debugging when GVSym is available even not emitted.


================
Comment at: lib/CodeGen/AsmPrinter/AsmPrinter.cpp:440
@@ +439,3 @@
+      OutStreamer->EmitSymbolValue(
+          createEmuTLSInitSym(GVSym, OutContext), WordSize);
+    } else
----------------
davidxl wrote:
> createEmuTLSInitSym is called later again which seems wrong.
It's on purpose to get-or-create the symbol from one place, and createEmuTLSInitSym can be called multiple times.


================
Comment at: lib/CodeGen/AsmPrinter/AsmPrinter.cpp:505
@@ +504,3 @@
+
+  MCSymbol *EmittedInitSym = IsEmuTLSVar ?
+      createEmuTLSInitSym(GVSym, OutContext) : GVSym;
----------------
davidxl wrote:
> Just overwrite GVSym?
It's useful to keep under emulated mode and debug both GVSym and EmittedInitSym.


================
Comment at: lib/CodeGen/AsmPrinter/AsmPrinter.cpp:506
@@ +505,3 @@
+  MCSymbol *EmittedInitSym = IsEmuTLSVar ?
+      createEmuTLSInitSym(GVSym, OutContext) : GVSym;
+  // createEmuTLSInitSym only creates the symbol with name and default attributes.
----------------
davidxl wrote:
> This was called before.
It's okay. It returns the previously created symbol.



Repository:
  rL LLVM

http://reviews.llvm.org/D10522







More information about the llvm-commits mailing list