]> granicus.if.org Git - clang/commitdiff
Add a getName accessor for ModuleMacros.
authorBob Wilson <bob.wilson@apple.com>
Thu, 10 Aug 2017 16:42:46 +0000 (16:42 +0000)
committerBob Wilson <bob.wilson@apple.com>
Thu, 10 Aug 2017 16:42:46 +0000 (16:42 +0000)
Swift would like to be able to access the name of a ModuleMacro.
There was some discussion of this in
https://github.com/apple/swift-clang/pull/93, suggesting that it makes
sense to have this accessor in Clang.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@310622 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Lex/MacroInfo.h

index d25431b55fdc3de06ebf36a29da7dc5266a8299a..47f10d6e762324a3b886a2de9995df8a4f60df9f 100644 (file)
@@ -510,6 +510,9 @@ public:
     ID.AddPointer(II);
   }
 
+  /// Get the name of the macro.
+  IdentifierInfo *getName() const { return II; }
+
   /// Get the ID of the module that exports this macro.
   Module *getOwningModule() const { return OwningModule; }