llvm.org GIT mirror llvm / 9251f13
When emitting .set directives, make sure the EH and Debug labels can't conflict. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42257 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 13 years ago
1 changed file(s) with 20 addition(s) and 10 deletion(s). Raw diff Collapse all Expand all
797797 /// SubprogramCount - The running count of functions being compiled.
798798 ///
799799 unsigned SubprogramCount;
800
801 /// Flavor - A unique string indicating what dwarf producer this is, used to
802 /// unique labels.
803 const char * const Flavor;
800804
801805 unsigned SetCounter;
802 Dwarf(std::ostream &OS, AsmPrinter *A, const TargetAsmInfo *T)
806 Dwarf(std::ostream &OS, AsmPrinter *A, const TargetAsmInfo *T,
807 const char *flavor)
803808 : O(OS)
804809 , Asm(A)
805810 , TAI(T)
809814 , MF(NULL)
810815 , MMI(NULL)
811816 , SubprogramCount(0)
817 , Flavor(flavor)
812818 , SetCounter(1)
813819 {
814820 }
838844 PrintLabelName(Label.Tag, Label.Number);
839845 }
840846 void PrintLabelName(const char *Tag, unsigned Number) const {
841
842847 O << TAI->getPrivateGlobalPrefix() << Tag;
843848 if (Number) O << Number;
849 }
850
851 void PrintLabelName(const char *Tag, unsigned Number,
852 const char *Suffix) const {
853 O << TAI->getPrivateGlobalPrefix() << Tag;
854 if (Number) O << Number;
855 O << Suffix;
844856 }
845857
846858 /// EmitLabel - Emit location label for internal use by Dwarf.
887899 bool IsSmall = false) {
888900 if (TAI->needsSet()) {
889901 O << "\t.set\t";
890 PrintLabelName("set", SetCounter);
902 PrintLabelName("set", SetCounter, Flavor);
891903 O << ",";
892904 PrintLabelName(TagHi, NumberHi);
893905 O << "-";
895907 O << "\n";
896908
897909 PrintRelDirective(IsSmall);
898
899 PrintLabelName("set", SetCounter);
900
910 PrintLabelName("set", SetCounter, Flavor);
901911 ++SetCounter;
902912 } else {
903913 PrintRelDirective(IsSmall);
914924 bool printAbsolute = false;
915925 if (TAI->needsSet()) {
916926 O << "\t.set\t";
917 PrintLabelName("set", SetCounter);
927 PrintLabelName("set", SetCounter, Flavor);
918928 O << ",";
919929 PrintLabelName(Label, LabelNumber);
920930
931941
932942 PrintRelDirective(IsSmall);
933943
934 PrintLabelName("set", SetCounter);
944 PrintLabelName("set", SetCounter, Flavor);
935945 ++SetCounter;
936946 } else {
937947 PrintRelDirective(IsSmall, true);
25642574 // Main entry points.
25652575 //
25662576 DwarfDebug(std::ostream &OS, AsmPrinter *A, const TargetAsmInfo *T)
2567 : Dwarf(OS, A, T)
2577 : Dwarf(OS, A, T, "dbg")
25682578 , CompileUnits()
25692579 , AbbreviationsSet(InitAbbreviationsSetSize)
25702580 , Abbreviations()
32673277 // Main entry points.
32683278 //
32693279 DwarfException(std::ostream &OS, AsmPrinter *A, const TargetAsmInfo *T)
3270 : Dwarf(OS, A, T)
3280 : Dwarf(OS, A, T, "eh")
32713281 , shouldEmit(false)
32723282 {}
32733283