[cfe-commits] r135139 - in /cfe/trunk: include/clang/Lex/PreprocessingRecord.h include/clang/Lex/Preprocessor.h lib/Lex/PPMacroExpansion.cpp lib/Lex/PreprocessingRecord.cpp lib/Lex/Preprocessor.cpp lib/Parse/ParseStmt.cpp lib/Serialization/ASTReader.cpp lib/Serialization/ASTWriter.cpp tools/libclang/CIndex.cpp tools/libclang/CXCursor.cpp tools/libclang/CXCursor.h

Chandler Carruth chandlerc at gmail.com
Thu Jul 14 01:20:47 PDT 2011


Author: chandlerc
Date: Thu Jul 14 03:20:46 2011
New Revision: 135139

URL: http://llvm.org/viewvc/llvm-project?rev=135139&view=rev
Log:
Move the rest of the preprocessor terminology from 'instantiate' and
variants to 'expand'. This changed a couple of public APIs, including
one public type "MacroInstantiation" which is now "MacroExpansion". The
rest of the codebase was updated to reflect this, especially the
libclang code. Two of the C++ (and thus easily changed) libclang APIs
were updated as well because they pertained directly to the old
MacroInstantiation class.

No functionality changed.

Modified:
    cfe/trunk/include/clang/Lex/PreprocessingRecord.h
    cfe/trunk/include/clang/Lex/Preprocessor.h
    cfe/trunk/lib/Lex/PPMacroExpansion.cpp
    cfe/trunk/lib/Lex/PreprocessingRecord.cpp
    cfe/trunk/lib/Lex/Preprocessor.cpp
    cfe/trunk/lib/Parse/ParseStmt.cpp
    cfe/trunk/lib/Serialization/ASTReader.cpp
    cfe/trunk/lib/Serialization/ASTWriter.cpp
    cfe/trunk/tools/libclang/CIndex.cpp
    cfe/trunk/tools/libclang/CXCursor.cpp
    cfe/trunk/tools/libclang/CXCursor.h

Modified: cfe/trunk/include/clang/Lex/PreprocessingRecord.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Lex/PreprocessingRecord.h?rev=135139&r1=135138&r2=135139&view=diff
==============================================================================
--- cfe/trunk/include/clang/Lex/PreprocessingRecord.h (original)
+++ cfe/trunk/include/clang/Lex/PreprocessingRecord.h Thu Jul 14 03:20:46 2011
@@ -38,13 +38,13 @@
   class FileEntry;
 
   /// \brief Base class that describes a preprocessed entity, which may be a
-  /// preprocessor directive or macro instantiation.
+  /// preprocessor directive or macro expansion.
   class PreprocessedEntity {
   public:
     /// \brief The kind of preprocessed entity an object describes.
     enum EntityKind {
-      /// \brief A macro instantiation.
-      MacroInstantiationKind,
+      /// \brief A macro expansion.
+      MacroExpansionKind,
       
       /// \brief A preprocessing directive whose kind is not specified.
       ///
@@ -110,31 +110,31 @@
     void operator delete(void* data) throw();
   };
   
-  /// \brief Records the location of a macro instantiation.
-  class MacroInstantiation : public PreprocessedEntity {
-    /// \brief The name of the macro being instantiation.
+  /// \brief Records the location of a macro expansion.
+  class MacroExpansion : public PreprocessedEntity {
+    /// \brief The name of the macro being expanded.
     IdentifierInfo *Name;
     
     /// \brief The definition of this macro.
     MacroDefinition *Definition;
     
   public:
-    MacroInstantiation(IdentifierInfo *Name, SourceRange Range,
-                       MacroDefinition *Definition)
-      : PreprocessedEntity(MacroInstantiationKind, Range), Name(Name), 
+    MacroExpansion(IdentifierInfo *Name, SourceRange Range,
+                   MacroDefinition *Definition)
+      : PreprocessedEntity(MacroExpansionKind, Range), Name(Name),
         Definition(Definition) { }
     
-    /// \brief The name of the macro being instantiated.
+    /// \brief The name of the macro being expanded.
     IdentifierInfo *getName() const { return Name; }
     
-    /// \brief The definition of the macro being instantiated.
+    /// \brief The definition of the macro being expanded.
     MacroDefinition *getDefinition() const { return Definition; }
 
     // Implement isa/cast/dyncast/etc.
     static bool classof(const PreprocessedEntity *PE) {
-      return PE->getKind() == MacroInstantiationKind;
+      return PE->getKind() == MacroExpansionKind;
     }
-    static bool classof(const MacroInstantiation *) { return true; }
+    static bool classof(const MacroExpansion *) { return true; }
 
   };
   
@@ -256,11 +256,11 @@
   
   /// \brief A record of the steps taken while preprocessing a source file,
   /// including the various preprocessing directives processed, macros 
-  /// instantiated, etc.
+  /// expanded, etc.
   class PreprocessingRecord : public PPCallbacks {
-    /// \brief Whether we should include nested macro instantiations in
+    /// \brief Whether we should include nested macro expansions in
     /// the preprocessing record.
-    bool IncludeNestedMacroInstantiations;
+    bool IncludeNestedMacroExpansions;
     
     /// \brief Allocator used to store preprocessing objects.
     llvm::BumpPtrAllocator BumpAlloc;
@@ -286,7 +286,7 @@
     
   public:
     /// \brief Construct 
-    explicit PreprocessingRecord(bool IncludeNestedMacroInstantiations);
+    explicit PreprocessingRecord(bool IncludeNestedMacroExpansions);
     
     /// \brief Allocate memory in the preprocessing record.
     void *Allocate(unsigned Size, unsigned Align = 8) {

Modified: cfe/trunk/include/clang/Lex/Preprocessor.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Lex/Preprocessor.h?rev=135139&r1=135138&r2=135139&view=diff
==============================================================================
--- cfe/trunk/include/clang/Lex/Preprocessor.h (original)
+++ cfe/trunk/include/clang/Lex/Preprocessor.h Thu Jul 14 03:20:46 2011
@@ -121,7 +121,7 @@
 
   /// Selectors - This table contains all the selectors in the program. Unlike
   /// IdentifierTable above, this table *isn't* populated by the preprocessor.
-  /// It is declared/instantiated here because it's role/lifetime is
+  /// It is declared/expanded here because it's role/lifetime is
   /// conceptually similar the IdentifierTable. In addition, the current control
   /// flow (in clang::ParseAST()), make it convenient to put here.
   /// FIXME: Make sure the lifetime of Identifiers/Selectors *isn't* tied to
@@ -220,9 +220,9 @@
   /// previous macro value.
   llvm::DenseMap<IdentifierInfo*, std::vector<MacroInfo*> > PragmaPushMacroInfo;
 
-  /// \brief Instantiation source location for the last macro that expanded
+  /// \brief Expansion source location for the last macro that expanded
   /// to no tokens.
-  SourceLocation LastEmptyMacroInstantiationLoc;
+  SourceLocation LastEmptyMacroExpansionLoc;
 
   // Various statistics we track for performance analysis.
   unsigned NumDirectives, NumIncluded, NumDefined, NumUndefined, NumPragma;
@@ -249,7 +249,7 @@
   llvm::SmallVector<Token, 16> MacroExpandedTokens;
   std::vector<std::pair<TokenLexer *, size_t> > MacroExpandingLexersStack;
 
-  /// \brief A record of the macro definitions and instantiations that
+  /// \brief A record of the macro definitions and expansions that
   /// occurred during preprocessing. 
   ///
   /// This is an optional side structure that can be enabled with
@@ -380,10 +380,10 @@
   macro_iterator macro_begin(bool IncludeExternalMacros = true) const;
   macro_iterator macro_end(bool IncludeExternalMacros = true) const;
 
-  /// \brief Instantiation source location for the last macro that expanded
+  /// \brief Expansion source location for the last macro that expanded
   /// to no tokens.
-  SourceLocation getLastEmptyMacroInstantiationLoc() const {
-    return LastEmptyMacroInstantiationLoc;
+  SourceLocation getLastEmptyMacroExpansionLoc() const {
+    return LastEmptyMacroExpansionLoc;
   }
 
   const std::string &getPredefines() const { return Predefines; }
@@ -451,7 +451,7 @@
   
   /// \brief Create a new preprocessing record, which will keep track of 
   /// all macro expansions, macro definitions, etc.
-  void createPreprocessingRecord(bool IncludeNestedMacroInstantiations);
+  void createPreprocessingRecord(bool IncludeNestedMacroExpansions);
   
   /// EnterMainSourceFile - Enter the specified FileID as the main source file,
   /// which implicitly adds the builtin defines etc.
@@ -667,7 +667,7 @@
 
   /// getSpelling() - Return the 'spelling' of the token at the given
   /// location; does not go up to the spelling location or down to the
-  /// instantiation location.
+  /// expansion location.
   ///
   /// \param buffer A buffer which will be used only if the token requires
   ///   "cleaning", e.g. if it contains trigraphs or escaped newlines
@@ -730,7 +730,7 @@
 
   /// CreateString - Plop the specified string into a scratch buffer and set the
   /// specified token's location and length to it.  If specified, the source
-  /// location provides a location of the instantiation point of the token.
+  /// location provides a location of the expansion point of the token.
   void CreateString(const char *Buf, unsigned Len,
                     Token &Tok, SourceLocation SourceLoc = SourceLocation());
 
@@ -754,13 +754,13 @@
   }
 
   /// \brief Returns true if the given MacroID location points at the first
-  /// token of the macro instantiation.
+  /// token of the macro expansion.
   bool isAtStartOfMacroExpansion(SourceLocation loc) const {
     return Lexer::isAtStartOfMacroExpansion(loc, SourceMgr, Features);
   }
 
   /// \brief Returns true if the given MacroID location points at the last
-  /// token of the macro instantiation.
+  /// token of the macro expansion.
   bool isAtEndOfMacroExpansion(SourceLocation loc) const {
     return Lexer::isAtEndOfMacroExpansion(loc, SourceMgr, Features);
   }
@@ -1019,7 +1019,7 @@
   /// invoked to read all of the formal arguments specified for the macro
   /// invocation.  This returns null on error.
   MacroArgs *ReadFunctionLikeMacroArgs(Token &MacroName, MacroInfo *MI,
-                                       SourceLocation &InstantiationEnd);
+                                       SourceLocation &ExpansionEnd);
 
   /// ExpandBuiltinMacro - If an identifier token is read that is to be expanded
   /// as a builtin macro, handle it and return the next token as 'Tok'.

Modified: cfe/trunk/lib/Lex/PPMacroExpansion.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/PPMacroExpansion.cpp?rev=135139&r1=135138&r2=135139&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/PPMacroExpansion.cpp (original)
+++ cfe/trunk/lib/Lex/PPMacroExpansion.cpp Thu Jul 14 03:20:46 2011
@@ -195,9 +195,9 @@
   /// invocation.
   MacroArgs *Args = 0;
 
-  // Remember where the end of the instantiation occurred.  For an object-like
+  // Remember where the end of the expansion occurred.  For an object-like
   // macro, this is the identifier.  For a function-like macro, this is the ')'.
-  SourceLocation InstantiationEnd = Identifier.getLocation();
+  SourceLocation ExpansionEnd = Identifier.getLocation();
 
   // If this is a function-like macro, read the arguments.
   if (MI->isFunctionLike()) {
@@ -210,7 +210,7 @@
     // Preprocessor directives used inside macro arguments are not portable, and
     // this enables the warning.
     InMacroArgs = true;
-    Args = ReadFunctionLikeMacroArgs(Identifier, MI, InstantiationEnd);
+    Args = ReadFunctionLikeMacroArgs(Identifier, MI, ExpansionEnd);
 
     // Finished parsing args.
     InMacroArgs = false;
@@ -230,8 +230,8 @@
   
   // If we started lexing a macro, enter the macro expansion body.
 
-  // Remember where the token is instantiated.
-  SourceLocation InstantiateLoc = Identifier.getLocation();
+  // Remember where the token is expanded.
+  SourceLocation ExpandLoc = Identifier.getLocation();
 
   // If this macro expands to no tokens, don't bother to push it onto the
   // expansion stack, only to take it right back off.
@@ -255,7 +255,7 @@
       if (HadLeadingSpace) Identifier.setFlag(Token::LeadingSpace);
     }
     Identifier.setFlag(Token::LeadingEmptyMacro);
-    LastEmptyMacroInstantiationLoc = InstantiateLoc;
+    LastEmptyMacroExpansionLoc = ExpandLoc;
     ++NumFastMacroExpanded;
     return false;
 
@@ -281,11 +281,11 @@
     Identifier.setFlagValue(Token::StartOfLine , isAtStartOfLine);
     Identifier.setFlagValue(Token::LeadingSpace, hasLeadingSpace);
 
-    // Update the tokens location to include both its instantiation and physical
+    // Update the tokens location to include both its expansion and physical
     // locations.
     SourceLocation Loc =
-      SourceMgr.createInstantiationLoc(Identifier.getLocation(), InstantiateLoc,
-                                       InstantiationEnd,Identifier.getLength());
+      SourceMgr.createInstantiationLoc(Identifier.getLocation(), ExpandLoc,
+                                       ExpansionEnd,Identifier.getLength());
     Identifier.setLocation(Loc);
 
     // If this is a disabled macro or #define X X, we must mark the result as
@@ -303,7 +303,7 @@
   }
 
   // Start expanding the macro.
-  EnterMacro(Identifier, InstantiationEnd, Args);
+  EnterMacro(Identifier, ExpansionEnd, Args);
 
   // Now that the macro is at the top of the include stack, ask the
   // preprocessor to read the next token from it.
@@ -833,10 +833,10 @@
     Loc = AdvanceToTokenCharacter(Loc, 0);
 
     // One wrinkle here is that GCC expands __LINE__ to location of the *end* of
-    // a macro instantiation.  This doesn't matter for object-like macros, but
+    // a macro expansion.  This doesn't matter for object-like macros, but
     // can matter for a function-like macro that expands to contain __LINE__.
-    // Skip down through instantiation points until we find a file loc for the
-    // end of the instantiation history.
+    // Skip down through expansion points until we find a file loc for the
+    // end of the expansion history.
     Loc = SourceMgr.getInstantiationRange(Loc).second;
     PresumedLoc PLoc = SourceMgr.getPresumedLoc(Loc);
 

Modified: cfe/trunk/lib/Lex/PreprocessingRecord.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/PreprocessingRecord.cpp?rev=135139&r1=135138&r2=135139&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/PreprocessingRecord.cpp (original)
+++ cfe/trunk/lib/Lex/PreprocessingRecord.cpp Thu Jul 14 03:20:46 2011
@@ -45,8 +45,8 @@
   ExternalSource->ReadPreprocessedEntities();
 }
 
-PreprocessingRecord::PreprocessingRecord(bool IncludeNestedMacroInstantiations)
-  : IncludeNestedMacroInstantiations(IncludeNestedMacroInstantiations),
+PreprocessingRecord::PreprocessingRecord(bool IncludeNestedMacroExpansions)
+  : IncludeNestedMacroExpansions(IncludeNestedMacroExpansions),
     ExternalSource(0), NumPreallocatedEntities(0), 
     LoadedPreallocatedEntities(false)
 {
@@ -121,14 +121,13 @@
 }
 
 void PreprocessingRecord::MacroExpands(const Token &Id, const MacroInfo* MI) {
-  if (!IncludeNestedMacroInstantiations && Id.getLocation().isMacroID())
+  if (!IncludeNestedMacroExpansions && Id.getLocation().isMacroID())
     return;
 
   if (MacroDefinition *Def = findMacroDefinition(MI))
     PreprocessedEntities.push_back(
-                       new (*this) MacroInstantiation(Id.getIdentifierInfo(),
-                                                      Id.getLocation(),
-                                                      Def));
+                       new (*this) MacroExpansion(Id.getIdentifierInfo(),
+                                                  Id.getLocation(), Def));
 }
 
 void PreprocessingRecord::MacroDefined(const Token &Id,

Modified: cfe/trunk/lib/Lex/Preprocessor.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/Preprocessor.cpp?rev=135139&r1=135138&r2=135139&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/Preprocessor.cpp (original)
+++ cfe/trunk/lib/Lex/Preprocessor.cpp Thu Jul 14 03:20:46 2011
@@ -328,15 +328,15 @@
 /// location for it.  If specified, the source location provides a source
 /// location for the token.
 void Preprocessor::CreateString(const char *Buf, unsigned Len, Token &Tok,
-                                SourceLocation InstantiationLoc) {
+                                SourceLocation ExpansionLoc) {
   Tok.setLength(Len);
 
   const char *DestPtr;
   SourceLocation Loc = ScratchBuf->getToken(Buf, Len, DestPtr);
 
-  if (InstantiationLoc.isValid())
-    Loc = SourceMgr.createInstantiationLoc(Loc, InstantiationLoc,
-                                           InstantiationLoc, Len);
+  if (ExpansionLoc.isValid())
+    Loc = SourceMgr.createInstantiationLoc(Loc, ExpansionLoc,
+                                           ExpansionLoc, Len);
   Tok.setLocation(Loc);
 
   // If this is a raw identifier or a literal token, set the pointer data.
@@ -534,10 +534,10 @@
 CodeCompletionHandler::~CodeCompletionHandler() { }
 
 void Preprocessor::createPreprocessingRecord(
-                                      bool IncludeNestedMacroInstantiations) {
+                                      bool IncludeNestedMacroExpansions) {
   if (Record)
     return;
   
-  Record = new PreprocessingRecord(IncludeNestedMacroInstantiations);
+  Record = new PreprocessingRecord(IncludeNestedMacroExpansions);
   addPPCallbacks(Record);
 }

Modified: cfe/trunk/lib/Parse/ParseStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseStmt.cpp?rev=135139&r1=135138&r2=135139&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseStmt.cpp (original)
+++ cfe/trunk/lib/Parse/ParseStmt.cpp Thu Jul 14 03:20:46 2011
@@ -226,7 +226,7 @@
   case tok::semi: {                 // C99 6.8.3p3: expression[opt] ';'
     SourceLocation LeadingEmptyMacroLoc;
     if (Tok.hasLeadingEmptyMacro())
-      LeadingEmptyMacroLoc = PP.getLastEmptyMacroInstantiationLoc();
+      LeadingEmptyMacroLoc = PP.getLastEmptyMacroExpansionLoc();
     return Actions.ActOnNullStmt(ConsumeToken(), LeadingEmptyMacroLoc);
   }
 

Modified: cfe/trunk/lib/Serialization/ASTReader.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReader.cpp?rev=135139&r1=135138&r2=135139&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/ASTReader.cpp (original)
+++ cfe/trunk/lib/Serialization/ASTReader.cpp Thu Jul 14 03:20:46 2011
@@ -1560,13 +1560,13 @@
     if (PreprocessedEntity *PE = PPRec.getPreprocessedEntity(Record[0]))
       return PE;
     
-    MacroInstantiation *MI
-      = new (PPRec) MacroInstantiation(DecodeIdentifierInfo(Record[3]),
+    MacroExpansion *ME =
+      new (PPRec) MacroExpansion(DecodeIdentifierInfo(Record[3]),
                                  SourceRange(ReadSourceLocation(F, Record[1]),
                                              ReadSourceLocation(F, Record[2])),
-                                       getMacroDefinition(Record[4]));
-    PPRec.SetPreallocatedEntity(Record[0], MI);
-    return MI;
+                                 getMacroDefinition(Record[4]));
+    PPRec.SetPreallocatedEntity(Record[0], ME);
+    return ME;
   }
       
   case PPD_MACRO_DEFINITION: {

Modified: cfe/trunk/lib/Serialization/ASTWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTWriter.cpp?rev=135139&r1=135138&r2=135139&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/ASTWriter.cpp (original)
+++ cfe/trunk/lib/Serialization/ASTWriter.cpp Thu Jul 14 03:20:46 2011
@@ -1800,12 +1800,12 @@
       SerializationListener->SerializedPreprocessedEntity(*E, 
                                                     Stream.GetCurrentBitNo());
 
-    if (MacroInstantiation *MI = dyn_cast<MacroInstantiation>(*E)) {          
+    if (MacroExpansion *ME = dyn_cast<MacroExpansion>(*E)) {
       Record.push_back(IndexBase + NumPreprocessingRecords++);
-      AddSourceLocation(MI->getSourceRange().getBegin(), Record);
-      AddSourceLocation(MI->getSourceRange().getEnd(), Record);
-      AddIdentifierRef(MI->getName(), Record);
-      Record.push_back(getMacroDefinitionID(MI->getDefinition()));
+      AddSourceLocation(ME->getSourceRange().getBegin(), Record);
+      AddSourceLocation(ME->getSourceRange().getEnd(), Record);
+      AddIdentifierRef(ME->getName(), Record);
+      Record.push_back(getMacroDefinitionID(ME->getDefinition()));
       Stream.EmitRecord(PPD_MACRO_INSTANTIATION, Record);
       continue;
     }

Modified: cfe/trunk/tools/libclang/CIndex.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CIndex.cpp?rev=135139&r1=135138&r2=135139&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/CIndex.cpp (original)
+++ cfe/trunk/tools/libclang/CIndex.cpp Thu Jul 14 03:20:46 2011
@@ -544,8 +544,8 @@
         // do so.
         PreprocessingRecord::iterator E, EEnd;
         for (llvm::tie(E, EEnd) = getPreprocessedEntities(); E != EEnd; ++E) {
-          if (MacroInstantiation *MI = dyn_cast<MacroInstantiation>(*E)) {
-            if (Visit(MakeMacroInstantiationCursor(MI, tu)))
+          if (MacroExpansion *ME = dyn_cast<MacroExpansion>(*E)) {
+            if (Visit(MakeMacroExpansionCursor(ME, tu)))
               return true;
             
             continue;
@@ -3152,7 +3152,7 @@
   }
   
   if (C.kind == CXCursor_MacroInstantiation)
-    return createCXString(getCursorMacroInstantiation(C)->getName()
+    return createCXString(getCursorMacroExpansion(C)->getName()
                                                            ->getNameStart());
 
   if (C.kind == CXCursor_MacroDefinition)
@@ -3674,7 +3674,7 @@
 
   if (C.kind == CXCursor_MacroInstantiation) {
     SourceLocation L
-      = cxcursor::getCursorMacroInstantiation(C)->getSourceRange().getBegin();
+      = cxcursor::getCursorMacroExpansion(C)->getSourceRange().getBegin();
     return cxloc::translateSourceLocation(getCursorContext(C), L);
   }
 
@@ -3760,7 +3760,7 @@
     return cxcursor::getCursorPreprocessingDirective(C);
 
   if (C.kind == CXCursor_MacroInstantiation)
-    return cxcursor::getCursorMacroInstantiation(C)->getSourceRange();
+    return cxcursor::getCursorMacroExpansion(C)->getSourceRange();
 
   if (C.kind == CXCursor_MacroDefinition)
     return cxcursor::getCursorMacroDefinition(C)->getSourceRange();
@@ -3877,7 +3877,7 @@
   }
   
   if (C.kind == CXCursor_MacroInstantiation) {
-    if (MacroDefinition *Def = getCursorMacroInstantiation(C)->getDefinition())
+    if (MacroDefinition *Def = getCursorMacroExpansion(C)->getDefinition())
       return MakeMacroDefinitionCursor(Def, tu);
   }
 

Modified: cfe/trunk/tools/libclang/CXCursor.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CXCursor.cpp?rev=135139&r1=135138&r2=135139&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/CXCursor.cpp (original)
+++ cfe/trunk/tools/libclang/CXCursor.cpp Thu Jul 14 03:20:46 2011
@@ -378,15 +378,15 @@
   return static_cast<MacroDefinition *>(C.data[0]);
 }
 
-CXCursor cxcursor::MakeMacroInstantiationCursor(MacroInstantiation *MI, 
-                                                CXTranslationUnit TU) {
+CXCursor cxcursor::MakeMacroExpansionCursor(MacroExpansion *MI, 
+                                            CXTranslationUnit TU) {
   CXCursor C = { CXCursor_MacroInstantiation, { MI, 0, TU } };
   return C;
 }
 
-MacroInstantiation *cxcursor::getCursorMacroInstantiation(CXCursor C) {
+MacroExpansion *cxcursor::getCursorMacroExpansion(CXCursor C) {
   assert(C.kind == CXCursor_MacroInstantiation);
-  return static_cast<MacroInstantiation *>(C.data[0]);
+  return static_cast<MacroExpansion *>(C.data[0]);
 }
 
 CXCursor cxcursor::MakeInclusionDirectiveCursor(InclusionDirective *ID, 

Modified: cfe/trunk/tools/libclang/CXCursor.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CXCursor.h?rev=135139&r1=135138&r2=135139&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/CXCursor.h (original)
+++ cfe/trunk/tools/libclang/CXCursor.h Thu Jul 14 03:20:46 2011
@@ -31,7 +31,7 @@
 class InclusionDirective;
 class LabelStmt;
 class MacroDefinition;
-class MacroInstantiation;
+class MacroExpansion;
 class NamedDecl;
 class ObjCInterfaceDecl;
 class ObjCProtocolDecl;
@@ -134,13 +134,13 @@
 /// source range.
 MacroDefinition *getCursorMacroDefinition(CXCursor C);
 
-/// \brief Create a macro instantiation cursor.
-CXCursor MakeMacroInstantiationCursor(MacroInstantiation *,
-                                      CXTranslationUnit TU);
+/// \brief Create a macro expansion cursor.
+CXCursor MakeMacroExpansionCursor(MacroExpansion *,
+                                  CXTranslationUnit TU);
 
-/// \brief Unpack a given macro instantiation cursor to retrieve its
+/// \brief Unpack a given macro expansion cursor to retrieve its
 /// source range.
-MacroInstantiation *getCursorMacroInstantiation(CXCursor C);
+MacroExpansion *getCursorMacroExpansion(CXCursor C);
 
 /// \brief Create an inclusion directive cursor.
 CXCursor MakeInclusionDirectiveCursor(InclusionDirective *,





More information about the cfe-commits mailing list