Deleted Added
full compact
MipsTargetObjectFile.cpp (198090) MipsTargetObjectFile.cpp (199511)
1//===-- MipsTargetObjectFile.cpp - Mips object files ----------------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#include "MipsTargetObjectFile.h"
1//===-- MipsTargetObjectFile.cpp - Mips object files ----------------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#include "MipsTargetObjectFile.h"
11#include "MipsSubtarget.h"
11#include "llvm/DerivedTypes.h"
12#include "llvm/GlobalVariable.h"
13#include "llvm/MC/MCSectionELF.h"
14#include "llvm/Target/TargetData.h"
15#include "llvm/Target/TargetMachine.h"
16#include "llvm/Support/CommandLine.h"
17using namespace llvm;
18

--- 32 unchanged lines hidden (view full) ---

51 return IsGlobalInSmallSection(GV, TM, getKindForGlobal(GV, TM));
52}
53
54/// IsGlobalInSmallSection - Return true if this global address should be
55/// placed into small data/bss section.
56bool MipsTargetObjectFile::
57IsGlobalInSmallSection(const GlobalValue *GV, const TargetMachine &TM,
58 SectionKind Kind) const {
12#include "llvm/DerivedTypes.h"
13#include "llvm/GlobalVariable.h"
14#include "llvm/MC/MCSectionELF.h"
15#include "llvm/Target/TargetData.h"
16#include "llvm/Target/TargetMachine.h"
17#include "llvm/Support/CommandLine.h"
18using namespace llvm;
19

--- 32 unchanged lines hidden (view full) ---

52 return IsGlobalInSmallSection(GV, TM, getKindForGlobal(GV, TM));
53}
54
55/// IsGlobalInSmallSection - Return true if this global address should be
56/// placed into small data/bss section.
57bool MipsTargetObjectFile::
58IsGlobalInSmallSection(const GlobalValue *GV, const TargetMachine &TM,
59 SectionKind Kind) const {
60
61 // Only use small section for non linux targets.
62 const MipsSubtarget &Subtarget = TM.getSubtarget<MipsSubtarget>();
63 if (Subtarget.isLinux())
64 return false;
65
59 // Only global variables, not functions.
60 const GlobalVariable *GVA = dyn_cast<GlobalVariable>(GV);
61 if (!GVA)
62 return false;
63
64 // We can only do this for datarel or BSS objects for now.
65 if (!Kind.isBSS() && !Kind.isDataRel())
66 return false;

--- 27 unchanged lines hidden ---
66 // Only global variables, not functions.
67 const GlobalVariable *GVA = dyn_cast<GlobalVariable>(GV);
68 if (!GVA)
69 return false;
70
71 // We can only do this for datarel or BSS objects for now.
72 if (!Kind.isBSS() && !Kind.isDataRel())
73 return false;

--- 27 unchanged lines hidden ---