diff options
author | Chris Lattner <sabre@nondot.org> | 2009-07-25 18:11:58 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-07-25 18:11:58 +0000 |
commit | 4f05591e616497d88053c6b2c72d94b1365f10bd (patch) | |
tree | 5cb6a6161ccf18a851802a8cdd6e2445d2587c25 /lib | |
parent | 10cf6a6a4bdc5a99813cc464030b93466842ffc2 (diff) |
document some invariants.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77084 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Target/TargetAsmInfo.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Target/TargetAsmInfo.cpp b/lib/Target/TargetAsmInfo.cpp index 727c584e3a..dfb274f608 100644 --- a/lib/Target/TargetAsmInfo.cpp +++ b/lib/Target/TargetAsmInfo.cpp @@ -293,8 +293,13 @@ static SectionKind::Kind SectionKindForGlobal(const GlobalValue *GV, } } - +/// SectionForGlobal - This method computes the appropriate section to emit +/// the specified global variable or function definition. This should not +/// be passed external (or available externally) globals. const Section *TargetAsmInfo::SectionForGlobal(const GlobalValue *GV) const { + assert(!GV->isDeclaration() && !GV->hasAvailableExternallyLinkage() && + "Can only be used for global definitions"); + SectionKind::Kind Kind = SectionKindForGlobal(GV, TM.getRelocationModel()); // Select section name. |