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);
// 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;
}
}
#include "llvm/Target/TargetOptions.h"
using namespace llvm;
+#include <iostream>
+
STATISTIC(EmittedInsts, "Number of machine instrs printed");
static std::string getPICLabelString(unsigned FnNum,
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() &&