[Lldb-commits] [lldb] r236182 - Fix build after Clang API change in r236176.

Richard Smith richard-llvm at metafoo.co.uk
Wed Apr 29 16:46:49 PDT 2015


Author: rsmith
Date: Wed Apr 29 18:46:48 2015
New Revision: 236182

URL: http://llvm.org/viewvc/llvm-project?rev=236182&view=rev
Log:
Fix build after Clang API change in r236176.

Modified:
    lldb/trunk/source/Expression/ClangModulesDeclVendor.cpp

Modified: lldb/trunk/source/Expression/ClangModulesDeclVendor.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangModulesDeclVendor.cpp?rev=236182&r1=236181&r2=236182&view=diff
==============================================================================
--- lldb/trunk/source/Expression/ClangModulesDeclVendor.cpp (original)
+++ lldb/trunk/source/Expression/ClangModulesDeclVendor.cpp Wed Apr 29 18:46:48 2015
@@ -446,23 +446,16 @@ ClangModulesDeclVendorImpl::ForEachMacro
         ssize_t found_priority = -1;
         clang::MacroInfo *info = nullptr;
         
-        for (clang::MacroDirective *directive = m_compiler_instance->getPreprocessor().getMacroDirectiveHistory(ii);
-             directive != nullptr;
-             directive = directive->getPrevious())
+        for (clang::ModuleMacro *macro : m_compiler_instance->getPreprocessor().getMacroDefinition(ii).getModuleMacros())
         {
-            unsigned module_id = directive->getMacroInfo()->getOwningModuleID();
-            
-            if (!module_id)
-                continue;
-            
-            clang::Module *module = m_compiler_instance->getModuleManager()->getModule(module_id);
+            clang::Module *module = macro->getOwningModule();
             
             {
                 ModulePriorityMap::iterator pi = module_priorities.find(reinterpret_cast<ModuleID>(module));
                 
                 if (pi != module_priorities.end() && pi->second > found_priority)
                 {
-                    info = directive->getMacroInfo();
+                    info = macro->getMacroInfo();
                     found_priority = pi->second;
                 }
             }
@@ -475,7 +468,7 @@ ClangModulesDeclVendorImpl::ForEachMacro
 
                 if ((pi != module_priorities.end()) && pi->second > found_priority)
                 {
-                    info = directive->getMacroInfo();
+                    info = macro->getMacroInfo();
                     found_priority = pi->second;
                 }
             }





More information about the lldb-commits mailing list