move #includes earlier.
[oota-llvm.git] / lib / Target / PIC16 / PIC16.h
index 29f907923083f9d93d4d771b5d2be58563309b82..8d067de676b69c19239dce9da597dda260fa37d4 100644 (file)
 
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Target/TargetMachine.h"
-#include <iosfwd>
 #include <cassert>
 #include <sstream>
 #include <cstring>
 #include <string>
-#include "PIC16PAN.h"
 
 namespace llvm {
   class PIC16TargetMachine;
@@ -44,11 +42,23 @@ namespace PIC16CC {
     UGE
   };
 }
+
+  enum PIC16SectionType {
+      CODE,
+      UDATA,
+      IDATA,
+      ROMDATA,
+      UDATA_OVR,
+      UDATA_SHR
+    };
+
+
   // External symbol names require memory to live till the program end.
   // So we have to allocate it and keep.
+  // FIXME: Don't leak the allocated strings.
   inline static const char *createESName (const std::string &name) {
     char *tmpName = new char[name.size() + 1];
-    strcpy (tmpName, name.c_str());
+    memcpy(tmpName, name.c_str(), name.size() + 1);
     return tmpName;
   }