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 "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 {
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 ---
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 "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 {
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 ---