Update all of the libclang code corresponding to the preprocessor
MacroInstantiation -> MacroExpansion rename. Internally, everything is
switched.

Introduce a new cursor kind enum with the new name, but retain the old
name as an alias so that we don't break backwards compatibility.

Also update the debug printing routine to use 'macro expansions' as its
explicitly not guaranteed to be stable, and mechanically switch the test
cases over to that.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135140 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/libclang/CIndex.cpp b/tools/libclang/CIndex.cpp
index e85b94f..02ef6f8 100644
--- a/tools/libclang/CIndex.cpp
+++ b/tools/libclang/CIndex.cpp
@@ -3151,7 +3151,7 @@
     return createCXString("");
   }
   
-  if (C.kind == CXCursor_MacroInstantiation)
+  if (C.kind == CXCursor_MacroExpansion)
     return createCXString(getCursorMacroExpansion(C)->getName()
                                                            ->getNameStart());
 
@@ -3352,8 +3352,8 @@
     return createCXString("preprocessing directive");
   case CXCursor_MacroDefinition:
     return createCXString("macro definition");
-  case CXCursor_MacroInstantiation:
-    return createCXString("macro instantiation");
+  case CXCursor_MacroExpansion:
+    return createCXString("macro expansion");
   case CXCursor_InclusionDirective:
     return createCXString("inclusion directive");
   case CXCursor_Namespace:
@@ -3672,7 +3672,7 @@
     return cxloc::translateSourceLocation(getCursorContext(C), L);
   }
 
-  if (C.kind == CXCursor_MacroInstantiation) {
+  if (C.kind == CXCursor_MacroExpansion) {
     SourceLocation L
       = cxcursor::getCursorMacroExpansion(C)->getSourceRange().getBegin();
     return cxloc::translateSourceLocation(getCursorContext(C), L);
@@ -3759,7 +3759,7 @@
   if (C.kind == CXCursor_PreprocessingDirective)
     return cxcursor::getCursorPreprocessingDirective(C);
 
-  if (C.kind == CXCursor_MacroInstantiation)
+  if (C.kind == CXCursor_MacroExpansion)
     return cxcursor::getCursorMacroExpansion(C)->getSourceRange();
 
   if (C.kind == CXCursor_MacroDefinition)
@@ -3876,7 +3876,7 @@
     return clang_getNullCursor();
   }
   
-  if (C.kind == CXCursor_MacroInstantiation) {
+  if (C.kind == CXCursor_MacroExpansion) {
     if (MacroDefinition *Def = getCursorMacroExpansion(C)->getDefinition())
       return MakeMacroDefinitionCursor(Def, tu);
   }
@@ -3945,7 +3945,7 @@
     WasReference = true;
   }
 
-  if (C.kind == CXCursor_MacroInstantiation)
+  if (C.kind == CXCursor_MacroExpansion)
     return clang_getCursorReferenced(C);
 
   if (!clang_isDeclaration(C.kind))
@@ -4543,7 +4543,7 @@
   if (clang_isPreprocessing(cursor.kind)) {    
     // For macro instantiations, just note where the beginning of the macro
     // instantiation occurs.
-    if (cursor.kind == CXCursor_MacroInstantiation) {
+    if (cursor.kind == CXCursor_MacroExpansion) {
       Annotated[Loc.int_data] = cursor;
       return CXChildVisit_Recurse;
     }
diff --git a/tools/libclang/CXCursor.cpp b/tools/libclang/CXCursor.cpp
index b48ad91..86997d6 100644
--- a/tools/libclang/CXCursor.cpp
+++ b/tools/libclang/CXCursor.cpp
@@ -380,12 +380,12 @@
 
 CXCursor cxcursor::MakeMacroExpansionCursor(MacroExpansion *MI, 
                                             CXTranslationUnit TU) {
-  CXCursor C = { CXCursor_MacroInstantiation, { MI, 0, TU } };
+  CXCursor C = { CXCursor_MacroExpansion, { MI, 0, TU } };
   return C;
 }
 
 MacroExpansion *cxcursor::getCursorMacroExpansion(CXCursor C) {
-  assert(C.kind == CXCursor_MacroInstantiation);
+  assert(C.kind == CXCursor_MacroExpansion);
   return static_cast<MacroExpansion *>(C.data[0]);
 }