#include "llvm/Function.h"
#include "llvm/Module.h"
#include "llvm/CodeGen/DwarfWriter.h"
-#include "llvm/Support/FormattedStream.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
-#include "llvm/Support/Mangler.h"
-#include "llvm/Support/ErrorHandling.h"
#include "llvm/CodeGen/DwarfWriter.h"
#include "llvm/CodeGen/MachineModuleInfo.h"
+#include "llvm/MC/MCSection.h"
#include "llvm/Target/TargetRegistry.h"
#include "llvm/Target/TargetLoweringObjectFile.h"
-
+#include "llvm/Support/ErrorHandling.h"
+#include "llvm/Support/FormattedStream.h"
+#include "llvm/Support/Mangler.h"
using namespace llvm;
#include "PIC16GenAsmWriter.inc"
std::string T = PAN::getCodeSectionName(CurrentFnName);
const char *codeSection = T.c_str();
- const Section *fCodeSection =
+ const MCSection *fCodeSection =
getObjFileLowering().getOrCreateSection(codeSection, false,
- SectionKind::Text);
+ SectionKind::getText());
// Start the Code Section.
O << "\n";
SwitchToSection(fCodeSection);
// Set the section names for all globals.
for (Module::global_iterator I = M.global_begin(), E = M.global_end();
I != E; ++I)
- I->setSection(getObjFileLowering().SectionForGlobal(I, Mang,TM)->getName());
+ if (!I->isDeclaration() && !I->hasAvailableExternallyLinkage())
+ I->setSection(getObjFileLowering().
+ SectionForGlobal(I, Mang,TM)->getName());
DbgInfo.BeginModule(M);
EmitFunctionDecls(M);
std::string T = PAN::getFrameSectionName(CurrentFnName);
const char *SectionName = T.c_str();
- const Section *fPDataSection =
+ const MCSection *fPDataSection =
getObjFileLowering().getOrCreateSection(SectionName, false,
- SectionKind::DataRel);
+ SectionKind::getDataRel());
SwitchToSection(fPDataSection);
// Emit function frame label