Added copyright header to all C++ source files.
[oota-llvm.git] / tools / llc / llc.cpp
index 9673343306782782fda99f2501e0ddcb0272990a..ed99c1c4080a8e92e83d62f7b5f75e723cd647dd 100644 (file)
@@ -1,4 +1,12 @@
 //===-- llc.cpp - Implement the LLVM Native Code Generator ----------------===//
+// 
+//                     The LLVM Compiler Infrastructure
+//
+// This file was developed by the LLVM research group and is distributed under
+// the University of Illinois Open Source License. See LICENSE.TXT for details.
+// 
+//===----------------------------------------------------------------------===//
+// 
 //
 // This is the llc code generator.
 //
@@ -44,7 +52,8 @@ GetFileNameRoot(const std::string &InputFilename)
   std::string IFN = InputFilename;
   std::string outputFilename;
   int Len = IFN.length();
-  if (IFN[Len-3] == '.' && IFN[Len-2] == 'b' && IFN[Len-1] == 'c') {
+  if ((Len > 2) &&
+      IFN[Len-3] == '.' && IFN[Len-2] == 'b' && IFN[Len-1] == 'c') {
     outputFilename = std::string(IFN.begin(), IFN.end()-3); // s/.bc/.s/
   } else {
     outputFilename = IFN;
@@ -127,7 +136,7 @@ int main(int argc, char **argv) {
       }
       Out = new std::ofstream(OutputFilename.c_str());
 
-      // Make sure that the Out file gets unlink'd from the disk if we get a
+      // Make sure that the Out file gets unlinked from the disk if we get a
       // SIGINT
       RemoveFileOnSignal(OutputFilename);
     } else {
@@ -156,7 +165,7 @@ int main(int argc, char **argv) {
         return 1;
       }
       
-      // Make sure that the Out file gets unlink'd from the disk if we get a
+      // Make sure that the Out file gets unlinked from the disk if we get a
       // SIGINT
       RemoveFileOnSignal(OutputFilename);
     }