diff options
| author | Benjamin Kramer <benny.kra@googlemail.com> | 2009-08-07 10:42:28 +0000 |
|---|---|---|
| committer | Benjamin Kramer <benny.kra@googlemail.com> | 2009-08-07 10:42:28 +0000 |
| commit | 24ee4d0aa410a9b4ffbc4ae706b305d422e259ee (patch) | |
| tree | a6f484cb5de86cb2ac1e06f442523251c58d58f4 /llvm/lib/Target/PIC16 | |
| parent | cf18d6befb699507ab9a0a745af4d2eef3a1c9f6 (diff) | |
| download | bcm5719-llvm-24ee4d0aa410a9b4ffbc4ae706b305d422e259ee.tar.gz bcm5719-llvm-24ee4d0aa410a9b4ffbc4ae706b305d422e259ee.zip | |
Simplify code and avoid allocations.
llvm-svn: 78382
Diffstat (limited to 'llvm/lib/Target/PIC16')
| -rw-r--r-- | llvm/lib/Target/PIC16/PIC16AsmPrinter.cpp | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/llvm/lib/Target/PIC16/PIC16AsmPrinter.cpp b/llvm/lib/Target/PIC16/PIC16AsmPrinter.cpp index 55ec1fe7d55..dc332ffe6d5 100644 --- a/llvm/lib/Target/PIC16/PIC16AsmPrinter.cpp +++ b/llvm/lib/Target/PIC16/PIC16AsmPrinter.cpp @@ -27,6 +27,7 @@ #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/FormattedStream.h" #include "llvm/Support/Mangler.h" +#include <cstring> using namespace llvm; #include "PIC16GenAsmWriter.inc" @@ -181,21 +182,13 @@ void PIC16AsmPrinter::printCCOperand(const MachineInstr *MI, int opNum) { // This function is used to sort the decls list. // should return true if s1 should come before s2. static bool is_before(const char *s1, const char *s2) { - std::string str1 = s1; - std::string str2 = s2; - int i = str1.compare(str2); - // Return true if s1 is smaller or equal. - if (i <= 0) return true; - // false if s1 should come after s2. - return false; + return strcmp(s1, s2) <= 0; } // This is used by list::unique below. // unique will filter out duplicates if it knows them. static bool is_duplicate(const char *s1, const char *s2) { - std::string str1 = s1; - std::string str2 = s2; - return str1 == str2; + return !strcmp(s1, s2); } /// printLibcallDecls - print the extern declarations for compiler |

