Avoid unnecessary string construction during asm printing.
[oota-llvm.git] / lib / CodeGen / MachineModuleInfo.cpp
index 3d3a9957bb082080f9a1393c7730a70a901ca795..5c826b5ffc1a86e594af2e724d2b8a51a854bee6 100644 (file)
@@ -1285,8 +1285,7 @@ const PointerType *DISerializer::getEmptyStructPtrType() {
   if (EmptyStructPtrTy) return EmptyStructPtrTy;
 
   // Construct the pointer to empty structure type.
-  const StructType *EmptyStructTy =
-    StructType::get(std::vector<const Type*>());
+  const StructType *EmptyStructTy = StructType::get(NULL, NULL);
 
   // Construct the pointer to empty structure type.
   EmptyStructPtrTy = PointerType::getUnqual(EmptyStructTy);
@@ -1321,7 +1320,7 @@ const StructType *DISerializer::getTagType(DebugInfoDesc *DD) {
 ///
 Constant *DISerializer::getString(const std::string &String) {
   // Check string cache for previous edition.
-  Constant *&Slot = StringCache[String.c_str()];
+  Constant *&Slot = StringCache[String];
 
   // Return Constant if previously defined.
   if (Slot) return Slot;
@@ -1754,7 +1753,7 @@ void MachineModuleInfo::addCatchTypeInfo(MachineBasicBlock *LandingPad,
 void MachineModuleInfo::addFilterTypeInfo(MachineBasicBlock *LandingPad,
                                         std::vector<GlobalVariable *> &TyInfo) {
   LandingPadInfo &LP = getOrCreateLandingPadInfo(LandingPad);
-  std::vector<unsigned> IdsInFilter (TyInfo.size());
+  std::vector<unsigned> IdsInFilter(TyInfo.size());
   for (unsigned I = 0, E = TyInfo.size(); I != E; ++I)
     IdsInFilter[I] = getTypeIDFor(TyInfo[I]);
   LP.TypeIds.push_back(getFilterIDFor(IdsInFilter));