Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(36)

Side by Side Diff: lib/Target/ARM/ARMTargetObjectFile.cpp

Issue 939073008: Rebased PNaCl localmods in LLVM to 223109 (Closed)
Patch Set: undo localmod Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « lib/Target/ARM/ARMTargetMachine.cpp ('k') | lib/Target/ARM/CMakeLists.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===-- llvm/Target/ARMTargetObjectFile.cpp - ARM Object Info Impl --------===// 1 //===-- llvm/Target/ARMTargetObjectFile.cpp - ARM Object Info Impl --------===//
2 // 2 //
3 // The LLVM Compiler Infrastructure 3 // The LLVM Compiler Infrastructure
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 9
10 #include "ARMTargetObjectFile.h" 10 #include "ARMTargetObjectFile.h"
11 #include "ARMSubtarget.h" 11 #include "ARMSubtarget.h"
12 #include "llvm/ADT/StringExtras.h" 12 #include "llvm/ADT/StringExtras.h"
13 #include "llvm/ADT/Triple.h" // @LOCALMOD
14 #include "llvm/CodeGen/MachineModuleInfo.h" // @LOCALMOD
13 #include "llvm/IR/Mangler.h" 15 #include "llvm/IR/Mangler.h"
14 #include "llvm/MC/MCAsmInfo.h" 16 #include "llvm/MC/MCAsmInfo.h"
15 #include "llvm/MC/MCContext.h" 17 #include "llvm/MC/MCContext.h"
16 #include "llvm/MC/MCExpr.h" 18 #include "llvm/MC/MCExpr.h"
17 #include "llvm/MC/MCSectionELF.h" 19 #include "llvm/MC/MCSectionELF.h"
18 #include "llvm/Support/Dwarf.h" 20 #include "llvm/Support/Dwarf.h"
19 #include "llvm/Support/ELF.h" 21 #include "llvm/Support/ELF.h"
20 #include "llvm/Target/TargetLowering.h" 22 #include "llvm/Target/TargetLowering.h"
21 using namespace llvm; 23 using namespace llvm;
22 using namespace dwarf; 24 using namespace dwarf;
23 25
24 //===----------------------------------------------------------------------===// 26 //===----------------------------------------------------------------------===//
25 // ELF Target 27 // ELF Target
26 //===----------------------------------------------------------------------===// 28 //===----------------------------------------------------------------------===//
27 29
28 void ARMElfTargetObjectFile::Initialize(MCContext &Ctx, 30 void ARMElfTargetObjectFile::Initialize(MCContext &Ctx,
29 const TargetMachine &TM) { 31 const TargetMachine &TM) {
30 bool isAAPCS_ABI = TM.getSubtarget<ARMSubtarget>().isAAPCS_ABI(); 32 bool isAAPCS_ABI = TM.getSubtarget<ARMSubtarget>().isAAPCS_ABI();
31 TargetLoweringObjectFileELF::Initialize(Ctx, TM); 33 TargetLoweringObjectFileELF::Initialize(Ctx, TM);
32 InitializeELF(isAAPCS_ABI); 34 InitializeELF(isAAPCS_ABI);
33 35
34 if (isAAPCS_ABI) { 36 // @LOCALMOD-BEGIN
37 if (isAAPCS_ABI && !TM.getSubtarget<ARMSubtarget>().isTargetNaCl()) {
38 // @LOCALMOD-END
35 LSDASection = nullptr; 39 LSDASection = nullptr;
36 } 40 }
37 41
38 AttributesSection = 42 AttributesSection =
39 getContext().getELFSection(".ARM.attributes", 43 getContext().getELFSection(".ARM.attributes",
40 ELF::SHT_ARM_ATTRIBUTES, 44 ELF::SHT_ARM_ATTRIBUTES,
41 0, 45 0,
42 SectionKind::getMetadata()); 46 SectionKind::getMetadata());
43 } 47 }
44 48
45 const MCExpr *ARMElfTargetObjectFile::getTTypeGlobalReference( 49 const MCExpr *ARMElfTargetObjectFile::getTTypeGlobalReference(
46 const GlobalValue *GV, unsigned Encoding, Mangler &Mang, 50 const GlobalValue *GV, unsigned Encoding, Mangler &Mang,
47 const TargetMachine &TM, MachineModuleInfo *MMI, 51 const TargetMachine &TM, MachineModuleInfo *MMI,
48 MCStreamer &Streamer) const { 52 MCStreamer &Streamer) const {
49 if (TM.getMCAsmInfo()->getExceptionHandlingType() != ExceptionHandling::ARM) 53 if (TM.getMCAsmInfo()->getExceptionHandlingType() != ExceptionHandling::ARM)
50 return TargetLoweringObjectFileELF::getTTypeGlobalReference( 54 return TargetLoweringObjectFileELF::getTTypeGlobalReference(
51 GV, Encoding, Mang, TM, MMI, Streamer); 55 GV, Encoding, Mang, TM, MMI, Streamer);
52 56
53 assert(Encoding == DW_EH_PE_absptr && "Can handle absptr encoding only"); 57 assert(Encoding == DW_EH_PE_absptr && "Can handle absptr encoding only");
58 // @LOCALMOD-BEGIN
59 // FIXME: There has got to be a better way to get this info.
60 Triple T(MMI->getModule()->getTargetTriple());
61 if (T.isOSNaCl())
62 return TargetLoweringObjectFileELF::getTTypeGlobalReference(
63 GV, Encoding, Mang, TM, MMI, Streamer);
64 // @LOCALMOD-END
54 65
55 return MCSymbolRefExpr::Create(TM.getSymbol(GV, Mang), 66 return MCSymbolRefExpr::Create(TM.getSymbol(GV, Mang),
56 MCSymbolRefExpr::VK_ARM_TARGET2, getContext()); 67 MCSymbolRefExpr::VK_ARM_TARGET2, getContext());
57 } 68 }
58 69
59 const MCExpr *ARMElfTargetObjectFile:: 70 const MCExpr *ARMElfTargetObjectFile::
60 getDebugThreadLocalSymbol(const MCSymbol *Sym) const { 71 getDebugThreadLocalSymbol(const MCSymbol *Sym) const {
61 return MCSymbolRefExpr::Create(Sym, MCSymbolRefExpr::VK_ARM_TLSLDO, 72 return MCSymbolRefExpr::Create(Sym, MCSymbolRefExpr::VK_ARM_TLSLDO,
62 getContext()); 73 getContext());
63 } 74 }
OLDNEW
« no previous file with comments | « lib/Target/ARM/ARMTargetMachine.cpp ('k') | lib/Target/ARM/CMakeLists.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698