diff options
author | Chris Lattner <sabre@nondot.org> | 2009-08-05 04:25:40 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-08-05 04:25:40 +0000 |
commit | cbc7b2654217f514777bba85481319bf3ece86bf (patch) | |
tree | ee3efadf7f3a15fa4ae60b7c10593ec6c95182af /llvm/lib/Target/TargetLoweringObjectFile.cpp | |
parent | d3a44b52c61fa0cf30daaa87e889e02b47ba5659 (diff) | |
download | bcm5719-llvm-cbc7b2654217f514777bba85481319bf3ece86bf.tar.gz bcm5719-llvm-cbc7b2654217f514777bba85481319bf3ece86bf.zip |
expose SectionKindForGlobal to curious clients, named as
getKindForGlobal.
llvm-svn: 78156
Diffstat (limited to 'llvm/lib/Target/TargetLoweringObjectFile.cpp')
-rw-r--r-- | llvm/lib/Target/TargetLoweringObjectFile.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/llvm/lib/Target/TargetLoweringObjectFile.cpp b/llvm/lib/Target/TargetLoweringObjectFile.cpp index 7489883998d..23e549a42b0 100644 --- a/llvm/lib/Target/TargetLoweringObjectFile.cpp +++ b/llvm/lib/Target/TargetLoweringObjectFile.cpp @@ -110,13 +110,16 @@ static bool IsNullTerminatedString(const Constant *C) { return false; } -/// SectionKindForGlobal - This is a top-level target-independent classifier for +/// getKindForGlobal - This is a top-level target-independent classifier for /// a global variable. Given an global variable and information from TM, it /// classifies the global in a variety of ways that make various target /// implementations simpler. The target implementation is free to ignore this /// extra info of course. -static SectionKind SectionKindForGlobal(const GlobalValue *GV, - const TargetMachine &TM) { +SectionKind TargetLoweringObjectFile::getKindForGlobal(const GlobalValue *GV, + const TargetMachine &TM){ + assert(!GV->isDeclaration() && !GV->hasAvailableExternallyLinkage() && + "Can only be used for global definitions"); + Reloc::Model ReloModel = TM.getRelocationModel(); // Early exit - functions should be always in text sections. @@ -227,13 +230,8 @@ static SectionKind SectionKindForGlobal(const GlobalValue *GV, /// the specified global variable or function definition. This should not /// be passed external (or available externally) globals. const MCSection *TargetLoweringObjectFile:: -SectionForGlobal(const GlobalValue *GV, Mangler *Mang, +SectionForGlobal(const GlobalValue *GV, SectionKind Kind, Mangler *Mang, const TargetMachine &TM) const { - assert(!GV->isDeclaration() && !GV->hasAvailableExternallyLinkage() && - "Can only be used for global definitions"); - - SectionKind Kind = SectionKindForGlobal(GV, TM); - // Select section name. if (GV->hasSection()) { // If the target has special section hacks for specifically named globals, @@ -254,6 +252,7 @@ SectionForGlobal(const GlobalValue *GV, Mangler *Mang, return SelectSectionForGlobal(GV, Kind, Mang, TM); } + // Lame default implementation. Calculate the section name for global. const MCSection * TargetLoweringObjectFile::SelectSectionForGlobal(const GlobalValue *GV, |