diff options
author | Dale Johannesen <dalej@apple.com> | 2008-09-09 22:29:13 +0000 |
---|---|---|
committer | Dale Johannesen <dalej@apple.com> | 2008-09-09 22:29:13 +0000 |
commit | d2e51af0358b571367a9f1e5175b87e9dd72edf8 (patch) | |
tree | 829af1ac09fe4d71385f4e3370c0854d79bbb7e8 /include | |
parent | b4ec2830499b8c3c5e0de56a2620fb2b21c88b9e (diff) | |
download | llvm-d2e51af0358b571367a9f1e5175b87e9dd72edf8.tar.gz llvm-d2e51af0358b571367a9f1e5175b87e9dd72edf8.tar.bz2 llvm-d2e51af0358b571367a9f1e5175b87e9dd72edf8.tar.xz |
Move the uglier parts of deciding not to emit a
UsedDirective for some symbols in llvm.used into
Darwin-specific code. I've decided LessPrivateGlobal
is potentially a useful abstraction and left it in
the target-independent area, with improved comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56024 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Target/DarwinTargetAsmInfo.h | 3 | ||||
-rw-r--r-- | include/llvm/Target/TargetAsmInfo.h | 14 |
2 files changed, 14 insertions, 3 deletions
diff --git a/include/llvm/Target/DarwinTargetAsmInfo.h b/include/llvm/Target/DarwinTargetAsmInfo.h index 0ed9b38703..4abf4b7cfd 100644 --- a/include/llvm/Target/DarwinTargetAsmInfo.h +++ b/include/llvm/Target/DarwinTargetAsmInfo.h @@ -22,6 +22,7 @@ namespace llvm { class GlobalValue; class GlobalVariable; class Type; + class Mangler; struct DarwinTargetAsmInfo: public virtual TargetAsmInfo { const Section* TextCoalSection; @@ -33,6 +34,8 @@ namespace llvm { virtual const Section* SelectSectionForGlobal(const GlobalValue *GV) const; virtual std::string UniqueSectionForGlobal(const GlobalValue* GV, SectionKind::Kind kind) const; + virtual bool emitUsedDirectiveFor(const GlobalValue *GV, + Mangler *Mang) const; const Section* MergeableConstSection(const GlobalVariable *GV) const; const Section* MergeableConstSection(const Type *Ty) const; const Section* MergeableStringSection(const GlobalVariable *GV) const; diff --git a/include/llvm/Target/TargetAsmInfo.h b/include/llvm/Target/TargetAsmInfo.h index bbb58527eb..589c9a6efc 100644 --- a/include/llvm/Target/TargetAsmInfo.h +++ b/include/llvm/Target/TargetAsmInfo.h @@ -100,6 +100,7 @@ namespace llvm { class CallInst; class GlobalValue; class Type; + class Mangler; class Section { friend class TargetAsmInfo; @@ -220,9 +221,9 @@ namespace llvm { /// have names in the .o file. This is often "." or "L". const char *PrivateGlobalPrefix; // Defaults to "." - /// LessPrivateGlobalPrefix - This prefix is used for some Objective C - /// metadata symbols that should be passed through the assembler but be - /// removed by the linker. This is "l" on Darwin. + /// LessPrivateGlobalPrefix - This prefix is used for symbols that should + /// be passed through the assembler but be removed by the linker. This + /// is "l" on Darwin, currently used for some ObjC metadata. const char *LessPrivateGlobalPrefix; // Defaults to "" /// JumpTableSpecialLabelPrefix - If not null, a extra (dead) label is @@ -543,6 +544,13 @@ namespace llvm { return false; } + /// emitUsedDirectiveFor - This hook allows targets to selectively decide + /// not to emit the UsedDirective for some symbols in llvm.used. + virtual bool emitUsedDirectiveFor(const GlobalValue *GV, + Mangler *Mang) const { + return (GV!=0); + } + /// PreferredEHDataFormat - This hook allows the target to select data /// format used for encoding pointers in exception handling data. Reason is /// 0 for data, 1 for code labels, 2 for function pointers. Global is true |