[cfe-commits] r136060 - in /cfe/trunk/lib/Sema: Sema.cpp SemaChecking.cpp SemaType.cpp

Chandler Carruth chandlerc at gmail.com
Mon Jul 25 22:40:03 PDT 2011


Author: chandlerc
Date: Tue Jul 26 00:40:03 2011
New Revision: 136060

URL: http://llvm.org/viewvc/llvm-project?rev=136060&view=rev
Log:
Cleanup the stray comments and variables I could dig out of Sema to
refer to 'expansion' instead of 'instantiation'.

Modified:
    cfe/trunk/lib/Sema/Sema.cpp
    cfe/trunk/lib/Sema/SemaChecking.cpp
    cfe/trunk/lib/Sema/SemaType.cpp

Modified: cfe/trunk/lib/Sema/Sema.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/Sema.cpp?rev=136060&r1=136059&r2=136060&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/Sema.cpp (original)
+++ cfe/trunk/lib/Sema/Sema.cpp Tue Jul 26 00:40:03 2011
@@ -677,16 +677,16 @@
   return Builder;
 }
 
-/// \brief Looks through the macro-instantiation chain for the given
-/// location, looking for a macro instantiation with the given name.
+/// \brief Looks through the macro-expansion chain for the given
+/// location, looking for a macro expansion with the given name.
 /// If one is found, returns true and sets the location to that
-/// instantiation loc.
+/// expansion loc.
 bool Sema::findMacroSpelling(SourceLocation &locref, StringRef name) {
   SourceLocation loc = locref;
   if (!loc.isMacroID()) return false;
 
   // There's no good way right now to look at the intermediate
-  // instantiations, so just jump to the instantiation location.
+  // expansions, so just jump to the expansion location.
   loc = getSourceManager().getExpansionLoc(loc);
 
   // If that's written with the name, stop here.

Modified: cfe/trunk/lib/Sema/SemaChecking.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaChecking.cpp?rev=136060&r1=136059&r2=136060&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaChecking.cpp (original)
+++ cfe/trunk/lib/Sema/SemaChecking.cpp Tue Jul 26 00:40:03 2011
@@ -3067,11 +3067,11 @@
   if (Source == Target) return;
   if (Target->isDependentType()) return;
 
-  // If the conversion context location is invalid don't complain.
-  // We also don't want to emit a warning if the issue occurs from the
-  // instantiation of a system macro.  The problem is that 'getSpellingLoc()'
-  // is slow, so we delay this check as long as possible.  Once we detect
-  // we are in that scenario, we just return.
+  // If the conversion context location is invalid don't complain. We also
+  // don't want to emit a warning if the issue occurs from the expansion of
+  // a system macro. The problem is that 'getSpellingLoc()' is slow, so we
+  // delay this check as long as possible. Once we detect we are in that
+  // scenario, we just return.
   if (CC.isInvalid())
     return;
 

Modified: cfe/trunk/lib/Sema/SemaType.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaType.cpp?rev=136060&r1=136059&r2=136060&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaType.cpp (original)
+++ cfe/trunk/lib/Sema/SemaType.cpp Tue Jul 26 00:40:03 2011
@@ -52,18 +52,18 @@
 /// doesn't apply to the given type.
 static void diagnoseBadTypeAttribute(Sema &S, const AttributeList &attr,
                                      QualType type) {
-  bool useInstantiationLoc = false;
+  bool useExpansionLoc = false;
 
   unsigned diagID = 0;
   switch (attr.getKind()) {
   case AttributeList::AT_objc_gc:
     diagID = diag::warn_pointer_attribute_wrong_type;
-    useInstantiationLoc = true;
+    useExpansionLoc = true;
     break;
 
   case AttributeList::AT_objc_ownership:
     diagID = diag::warn_objc_object_attribute_wrong_type;
-    useInstantiationLoc = true;
+    useExpansionLoc = true;
     break;
 
   default:
@@ -76,7 +76,7 @@
   StringRef name = attr.getName()->getName();
 
   // The GC attributes are usually written with macros;  special-case them.
-  if (useInstantiationLoc && loc.isMacroID() && attr.getParameterName()) {
+  if (useExpansionLoc && loc.isMacroID() && attr.getParameterName()) {
     if (attr.getParameterName()->isStr("strong")) {
       if (S.findMacroSpelling(loc, "__strong")) name = "__strong";
     } else if (attr.getParameterName()->isStr("weak")) {





More information about the cfe-commits mailing list