diff options
| author | Chris Lattner <sabre@nondot.org> | 2009-07-21 23:49:55 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2009-07-21 23:49:55 +0000 |
| commit | b2fb9ccbb7dfb154c1035f91afff1029a3ed8b58 (patch) | |
| tree | f0ca1c4df6958c8a4dd96471bfd659a274b686e0 /lib/Target/TargetAsmInfo.cpp | |
| parent | fae02a2ab19abdf12854356e19aeb1da62a0b8ea (diff) | |
simplify code now that it is inlined.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76689 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/TargetAsmInfo.cpp')
| -rw-r--r-- | lib/Target/TargetAsmInfo.cpp | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/lib/Target/TargetAsmInfo.cpp b/lib/Target/TargetAsmInfo.cpp index e60855d3dd..580c3fe4db 100644 --- a/lib/Target/TargetAsmInfo.cpp +++ b/lib/Target/TargetAsmInfo.cpp @@ -209,20 +209,11 @@ TargetAsmInfo::SectionKindForGlobal(const GlobalValue *GV) const { // note, there is no thread-local r/o section. Constant *C = GVar->getInitializer(); if (C->ContainsRelocations(Reloc::LocalOrGlobal)) { - // Decide, whether it is still possible to put symbol into r/o section. - unsigned Reloc = (TM.getRelocationModel() != Reloc::Static ? - Reloc::LocalOrGlobal : Reloc::None); - - // We already did a query for 'all' relocs, thus - early exits. - if (Reloc == Reloc::LocalOrGlobal) + // Decide whether it is still possible to put symbol into r/o section. + if (TM.getRelocationModel() != Reloc::Static) return SectionKind::Data; - else if (Reloc == Reloc::None) + else return SectionKind::ROData; - else { - // Ok, target wants something funny. Honour it. - return (C->ContainsRelocations(Reloc) ? - SectionKind::Data : SectionKind::ROData); - } } else { // Check, if initializer is a null-terminated string if (isConstantString(C)) |
