aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2008-07-09 13:24:38 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2008-07-09 13:24:38 +0000
commit0e48a0ca164d6e4c373f1319003e5c1bedc53e76 (patch)
tree4bde36a123bb25931f75a93099796257b20c9004
parentc6f4947d480fdf3b079f1f6338a3fdf8a0ec81d0 (diff)
Fix thinko
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53309 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/TargetAsmInfo.cpp7
-rw-r--r--lib/Target/X86/X86ATTAsmPrinter.cpp5
2 files changed, 8 insertions, 4 deletions
diff --git a/lib/Target/TargetAsmInfo.cpp b/lib/Target/TargetAsmInfo.cpp
index 6d2f6437bb..35099f5854 100644
--- a/lib/Target/TargetAsmInfo.cpp
+++ b/lib/Target/TargetAsmInfo.cpp
@@ -167,7 +167,6 @@ TargetAsmInfo::SectionKindForGlobal(const GlobalValue *GV) const {
bool isThreadLocal = GVar->isThreadLocal();
assert(GVar && "Invalid global value for section selection");
- SectionKind::Kind kind;
if (isSuitableForBSS(GVar)) {
// Variable can be easily put to BSS section.
return (isThreadLocal ? SectionKind::ThreadBSS : SectionKind::BSS);
@@ -177,14 +176,14 @@ TargetAsmInfo::SectionKindForGlobal(const GlobalValue *GV) const {
// note, there is no thread-local r/o section.
Constant *C = GVar->getInitializer();
if (C->ContainsRelocations())
- kind = SectionKind::ROData;
+ return SectionKind::ROData;
else {
const ConstantArray *CVA = dyn_cast<ConstantArray>(C);
// Check, if initializer is a null-terminated string
if (CVA && CVA->isCString())
- kind = SectionKind::RODataMergeStr;
+ return SectionKind::RODataMergeStr;
else
- kind = SectionKind::RODataMergeConst;
+ return SectionKind::RODataMergeConst;
}
}
diff --git a/lib/Target/X86/X86ATTAsmPrinter.cpp b/lib/Target/X86/X86ATTAsmPrinter.cpp
index a61bb2261d..4a9002c13b 100644
--- a/lib/Target/X86/X86ATTAsmPrinter.cpp
+++ b/lib/Target/X86/X86ATTAsmPrinter.cpp
@@ -32,6 +32,8 @@
#include "llvm/Target/TargetOptions.h"
using namespace llvm;
+#include <iostream>
+
STATISTIC(EmittedInsts, "Number of machine instrs printed");
static std::string getPICLabelString(unsigned FnNum,
@@ -772,6 +774,9 @@ void X86ATTAsmPrinter::printModuleLevelGV(const GlobalVariable* GVar) {
if (!GVar->hasInitializer())
return; // External global require no code
+ GVar->dump();
+ std::cout << TAI->SectionForGlobal(GVar) << std::endl;
+
// Check to see if this is a special global used by LLVM, if so, emit it.
if (EmitSpecialLLVMGlobal(GVar)) {
if (Subtarget->isTargetDarwin() &&