R600: Use MCAsmInfoELF as AMDGPUMCAsmInfo base class
authorTom Stellard <thomas.stellard@amd.com>
Tue, 7 Oct 2014 21:09:23 +0000 (21:09 +0000)
committerTom Stellard <thomas.stellard@amd.com>
Tue, 7 Oct 2014 21:09:23 +0000 (21:09 +0000)
The main reason for this is that the MCAsmInfo class,
which we were previously using as the base class, sets
PrivateGlobalPrefix to "L", which causes all global
functions that start with L to be treated as local symbols.

MCAsmInfoELF sets PrivateGlobalPrefix to ".L", which is what
we want, and it is probably a good idea to use this as the
base class anyway, since we are emitting ELF binaries.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219237 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/R600/MCTargetDesc/AMDGPUMCAsmInfo.cpp
lib/Target/R600/MCTargetDesc/AMDGPUMCAsmInfo.h

index 8e43800b79f770485cb6a881d8efab6ad72b77ce..fcec9cbfdc3cf0fe50525001236c07b9a4291296 100644 (file)
@@ -11,7 +11,7 @@
 #include "AMDGPUMCAsmInfo.h"
 
 using namespace llvm;
-AMDGPUMCAsmInfo::AMDGPUMCAsmInfo(StringRef &TT) : MCAsmInfo() {
+AMDGPUMCAsmInfo::AMDGPUMCAsmInfo(StringRef &TT) : MCAsmInfoELF() {
   HasSingleParameterDotFile = false;
   //===------------------------------------------------------------------===//
   HasSubsectionsViaSymbols = true;
index abbeab9c431cd078e54e0fd3613a398d4c44cd26..637a977f59f895ec40595bfd4f018ebea08b6dcc 100644 (file)
 #ifndef LLVM_LIB_TARGET_R600_MCTARGETDESC_AMDGPUMCASMINFO_H
 #define LLVM_LIB_TARGET_R600_MCTARGETDESC_AMDGPUMCASMINFO_H
 
-#include "llvm/MC/MCAsmInfo.h"
+#include "llvm/MC/MCAsmInfoELF.h"
 namespace llvm {
 
 class StringRef;
 
-class AMDGPUMCAsmInfo : public MCAsmInfo {
+// If you need to create another MCAsmInfo class, which inherits from MCAsmInfo,
+// you will need to make sure your new class sets PrivateGlobalPrefix to
+// a prefix that won't appeary in a fuction name.  The default value
+// for PrivateGlobalPrefix is 'L', so it will consider any function starting
+// with 'L' as a local symbol.
+class AMDGPUMCAsmInfo : public MCAsmInfoELF {
 public:
   explicit AMDGPUMCAsmInfo(StringRef &TT);
   const MCSection* getNonexecutableStackSection(MCContext &CTX) const override;