[cfe-commits] r67437 - /cfe/trunk/lib/CodeGen/CodeGenModule.cpp

Chris Lattner sabre at nondot.org
Sat Mar 21 00:12:05 PDT 2009


Author: lattner
Date: Sat Mar 21 02:12:05 2009
New Revision: 67437

URL: http://llvm.org/viewvc/llvm-project?rev=67437&view=rev
Log:
random code cleanups.

Modified:
    cfe/trunk/lib/CodeGen/CodeGenModule.cpp

Modified: cfe/trunk/lib/CodeGen/CodeGenModule.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.cpp?rev=67437&r1=67436&r2=67437&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenModule.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenModule.cpp Sat Mar 21 02:12:05 2009
@@ -38,14 +38,14 @@
     TheTargetData(TD), Diags(diags), Types(C, M, TD), Runtime(0),
     MemCpyFn(0), MemMoveFn(0), MemSetFn(0), CFConstantStringClassRef(0) {
 
-  if (Features.ObjC1) {
-    if (Features.NeXTRuntime) {
-      Runtime = Features.ObjCNonFragileABI ? CreateMacNonFragileABIObjCRuntime(*this) 
-                                       : CreateMacObjCRuntime(*this);
-    } else {
-      Runtime = CreateGNUObjCRuntime(*this);
-    }
-  }
+  if (!Features.ObjC1)
+    Runtime = 0;
+  else if (!Features.NeXTRuntime)
+    Runtime = CreateGNUObjCRuntime(*this);
+  else if (Features.ObjCNonFragileABI)
+    Runtime = CreateMacNonFragileABIObjCRuntime(*this);
+  else
+    Runtime = CreateMacObjCRuntime(*this);
 
   // If debug info generation is enabled, create the CGDebugInfo object.
   DebugInfo = GenerateDebugInfo ? new CGDebugInfo(this) : 0;
@@ -174,19 +174,18 @@
   // In C, functions with no attributes never need to be mangled. Fastpath them.
   if (!getLangOptions().CPlusPlus && !ND->hasAttrs()) {
     assert(ND->getIdentifier() && "Attempt to mangle unnamed decl.");
-    return ND->getIdentifier()->getName();
+    return ND->getNameAsCString();
   }
     
   llvm::SmallString<256> Name;
   llvm::raw_svector_ostream Out(Name);
   if (!mangleName(ND, Context, Out)) {
     assert(ND->getIdentifier() && "Attempt to mangle unnamed decl.");
-    return ND->getIdentifier()->getName();
+    return ND->getNameAsCString();
   }
 
   Name += '\0';
-  return MangledNames.GetOrCreateValue(Name.begin(), Name.end())
-           .getKeyData();
+  return MangledNames.GetOrCreateValue(Name.begin(), Name.end()).getKeyData();
 }
 
 /// AddGlobalCtor - Add a function to the list that will be called before
@@ -992,8 +991,7 @@
                                   std::vector<llvm::Constant*>& Fields,
                                   FieldDecl *FieldD, FieldDecl *NextFieldD,
                                   llvm::Constant* Field,
-                                  RecordDecl* RD, const llvm::StructType *STy)
-{
+                                  RecordDecl* RD, const llvm::StructType *STy) {
   // Append the field.
   Fields.push_back(Field);
   





More information about the cfe-commits mailing list