[Lldb-commits] [lldb] r357037 - Frontend: Remove CompilerInstance::VirtualFileSystem, NFC

2019-03-26 Thread Duncan P. N. Exon Smith via lldb-commits
Author: dexonsmith
Date: Tue Mar 26 15:18:52 2019
New Revision: 357037

URL: http://llvm.org/viewvc/llvm-project?rev=357037&view=rev
Log:
Frontend: Remove CompilerInstance::VirtualFileSystem, NFC

Remove CompilerInstance::VirtualFileSystem and
CompilerInstance::setVirtualFileSystem, instead relying on the VFS in
the FileManager.  CompilerInstance and its clients already went to some
trouble to make these match.  Now they are guaranteed to match.

As part of this, I added a VFS parameter (defaults to nullptr) to
CompilerInstance::createFileManager, to avoid repeating construction
logic in clients that just wanted to customize the VFS.

https://reviews.llvm.org/D59377

Modified:
lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp

Modified: 
lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp?rev=357037&r1=357036&r2=357037&view=diff
==
--- lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp 
(original)
+++ lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp 
Tue Mar 26 15:18:52 2019
@@ -309,8 +309,7 @@ ClangExpressionParser::ClangExpressionPa
   }
 
   // Make sure clang uses the same VFS as LLDB.
-  m_compiler->setVirtualFileSystem(
-  FileSystem::Instance().GetVirtualFileSystem());
+  m_compiler->createFileManager(FileSystem::Instance().GetVirtualFileSystem());
 
   lldb::LanguageType frame_lang =
   expr.Language(); // defaults to lldb::eLanguageTypeUnknown

Modified: 
lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp?rev=357037&r1=357036&r2=357037&view=diff
==
--- lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp 
(original)
+++ lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp 
Tue Mar 26 15:18:52 2019
@@ -679,7 +679,7 @@ ClangModulesDeclVendor::Create(Target &t
   }
 
   // Make sure clang uses the same VFS as LLDB.
-  
instance->setVirtualFileSystem(FileSystem::Instance().GetVirtualFileSystem());
+  instance->createFileManager(FileSystem::Instance().GetVirtualFileSystem());
   instance->setDiagnostics(diagnostics_engine.get());
   instance->setInvocation(invocation);
 


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] f96e16b - lldb: Update for change in `clang::Lexer`'s constructor

2020-10-19 Thread Duncan P . N . Exon Smith via lldb-commits

Author: Duncan P. N. Exon Smith
Date: 2020-10-19T20:09:27-04:00
New Revision: f96e16bc15a9a10857681b85b6c8824b9addd9b2

URL: 
https://github.com/llvm/llvm-project/commit/f96e16bc15a9a10857681b85b6c8824b9addd9b2
DIFF: 
https://github.com/llvm/llvm-project/commit/f96e16bc15a9a10857681b85b6c8824b9addd9b2.diff

LOG: lldb: Update for change in `clang::Lexer`'s constructor

b3eff6b7bb31e7ef059a3d238de138849839fbbd updated `Lexer::Lexer` to take
`clang::MemoryBufferRef` instead of `clang::MemoryBuffer*`. Update LLDB
to fix the bots.

Added: 


Modified: 
lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.cpp
lldb/source/Plugins/Language/ClangCommon/ClangHighlighter.cpp

Removed: 




diff  --git 
a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.cpp 
b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.cpp
index a429963277d1..937dbc00521e 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.cpp
@@ -231,7 +231,7 @@ TokenVerifier::TokenVerifier(std::string body) {
   Opts.CPlusPlus17 = true;
   Opts.LineComment = true;
 
-  Lexer lex(FID, buf.get(), SM, Opts);
+  Lexer lex(FID, buf->getMemBufferRef(), SM, Opts);
 
   Token token;
   bool exit = false;

diff  --git a/lldb/source/Plugins/Language/ClangCommon/ClangHighlighter.cpp 
b/lldb/source/Plugins/Language/ClangCommon/ClangHighlighter.cpp
index aaf578c6f728..f3194beff1ec 100644
--- a/lldb/source/Plugins/Language/ClangCommon/ClangHighlighter.cpp
+++ b/lldb/source/Plugins/Language/ClangCommon/ClangHighlighter.cpp
@@ -178,7 +178,7 @@ void ClangHighlighter::Highlight(const HighlightStyle 
&options,
   Opts.CPlusPlus17 = true;
   Opts.LineComment = true;
 
-  Lexer lex(FID, buf.get(), SM, Opts);
+  Lexer lex(FID, buf->getMemBufferRef(), SM, Opts);
   // The lexer should keep whitespace around.
   lex.SetKeepWhitespaceMode(true);
 



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] b333d6e - lldb: Migrate to MemoryBufferRef for createFileID (after 51d1d585e5838ea0f02f1271f7543c4e43639969)

2020-10-20 Thread Duncan P . N . Exon Smith via lldb-commits

Author: Duncan P. N. Exon Smith
Date: 2020-10-20T13:52:39-04:00
New Revision: b333d6e129f23d204cd3a44ffb9f3a69dc3e0bc9

URL: 
https://github.com/llvm/llvm-project/commit/b333d6e129f23d204cd3a44ffb9f3a69dc3e0bc9
DIFF: 
https://github.com/llvm/llvm-project/commit/b333d6e129f23d204cd3a44ffb9f3a69dc3e0bc9.diff

LOG: lldb: Migrate to MemoryBufferRef for createFileID (after 
51d1d585e5838ea0f02f1271f7543c4e43639969)

I missed these two lldb users before deleting the `UnownedTag` API for
`createFileID` in 51d1d585e5838ea0f02f1271f7543c4e43639969. This should
fix the build.

Added: 


Modified: 
lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.cpp
lldb/source/Plugins/Language/ClangCommon/ClangHighlighter.cpp

Removed: 




diff  --git 
a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.cpp 
b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.cpp
index 937dbc00521e..91fd246eb456 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.cpp
@@ -221,7 +221,7 @@ TokenVerifier::TokenVerifier(std::string body) {
   clang::SourceManager SM(diags, file_mgr);
   auto buf = llvm::MemoryBuffer::getMemBuffer(body);
 
-  FileID FID = SM.createFileID(clang::SourceManager::Unowned, buf.get());
+  FileID FID = SM.createFileID(buf->getMemBufferRef());
 
   // Let's just enable the latest ObjC and C++ which should get most tokens
   // right.

diff  --git a/lldb/source/Plugins/Language/ClangCommon/ClangHighlighter.cpp 
b/lldb/source/Plugins/Language/ClangCommon/ClangHighlighter.cpp
index f3194beff1ec..fe6eeea54e4d 100644
--- a/lldb/source/Plugins/Language/ClangCommon/ClangHighlighter.cpp
+++ b/lldb/source/Plugins/Language/ClangCommon/ClangHighlighter.cpp
@@ -168,7 +168,7 @@ void ClangHighlighter::Highlight(const HighlightStyle 
&options,
   clang::SourceManager SM(diags, file_mgr);
   auto buf = llvm::MemoryBuffer::getMemBuffer(full_source);
 
-  FileID FID = SM.createFileID(clang::SourceManager::Unowned, buf.get());
+  FileID FID = SM.createFileID(buf->getMemBufferRef());
 
   // Let's just enable the latest ObjC and C++ which should get most tokens
   // right.



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] d636b88 - Adapt lldb to a40db5502b2515a6f2f1676b5d7a655ae0f41179

2020-12-14 Thread Duncan P. N. Exon Smith via lldb-commits

Author: Duncan P. N. Exon Smith
Date: 2020-12-14T14:41:15-08:00
New Revision: d636b881bb9214938973098a012fad453082c444

URL: 
https://github.com/llvm/llvm-project/commit/d636b881bb9214938973098a012fad453082c444
DIFF: 
https://github.com/llvm/llvm-project/commit/d636b881bb9214938973098a012fad453082c444.diff

LOG: Adapt lldb to a40db5502b2515a6f2f1676b5d7a655ae0f41179

The bots just told me about a place in LLDB I missed in
a40db5502b2515a6f2f1676b5d7a655ae0f41179 when changing
`HeaderSearch::LoadedModuleMaps`, but I think this will fix it.

Added: 


Modified: 
lldb/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp

Removed: 




diff  --git 
a/lldb/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp 
b/lldb/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp
index c014ad504d378..89cb9d52356ab 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp
@@ -278,10 +278,10 @@ bool ClangModulesDeclVendorImpl::AddModule(const 
SourceModule &module,
   HS.getFileMgr().getDirectory(module.search_path.GetStringRef());
   if (!dir)
 return error();
-  auto *file = HS.lookupModuleMapFile(*dir, is_framework);
+  auto file = HS.lookupModuleMapFile(*dir, is_framework);
   if (!file)
 return error();
-  if (!HS.loadModuleMapFile(file, is_system))
+  if (!HS.loadModuleMapFile(*file, is_system))
 return error();
 }
   }



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r252378 - lldb/ADT: Remove implicit ilist iterator conversions, NFC

2015-11-06 Thread Duncan P. N. Exon Smith via lldb-commits
Author: dexonsmith
Date: Fri Nov  6 18:54:13 2015
New Revision: 252378

URL: http://llvm.org/viewvc/llvm-project?rev=252378&view=rev
Log:
lldb/ADT: Remove implicit ilist iterator conversions, NFC

Remove implicit ilist iterator conversions before reapplying r252372
(which will disallow them).

Modified:
lldb/trunk/source/Expression/IRInterpreter.cpp
lldb/trunk/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp

Modified: lldb/trunk/source/Expression/IRInterpreter.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/IRInterpreter.cpp?rev=252378&r1=252377&r2=252378&view=diff
==
--- lldb/trunk/source/Expression/IRInterpreter.cpp (original)
+++ lldb/trunk/source/Expression/IRInterpreter.cpp Fri Nov  6 18:54:13 2015
@@ -498,7 +498,7 @@ IRInterpreter::CanInterpret (llvm::Modul
 default:
 {
 if (log)
-log->Printf("Unsupported instruction: %s", 
PrintValue(ii).c_str());
+log->Printf("Unsupported instruction: %s", 
PrintValue(&*ii).c_str());
 error.SetErrorToGenericError();
 error.SetErrorString(unsupported_opcode_error);
 return false;
@@ -522,7 +522,7 @@ IRInterpreter::CanInterpret (llvm::Modul
 if (!CanIgnoreCall(call_inst) && !support_function_calls)
 {
 if (log)
-log->Printf("Unsupported instruction: %s", 
PrintValue(ii).c_str());
+log->Printf("Unsupported instruction: %s", 
PrintValue(&*ii).c_str());
 error.SetErrorToGenericError();
 error.SetErrorString(unsupported_opcode_error);
 return false;
@@ -547,7 +547,7 @@ IRInterpreter::CanInterpret (llvm::Modul
 default:
 {
 if (log)
-log->Printf("Unsupported ICmp predicate: %s", 
PrintValue(ii).c_str());
+log->Printf("Unsupported ICmp predicate: %s", 
PrintValue(&*ii).c_str());
 
 error.SetErrorToGenericError();
 error.SetErrorString(unsupported_opcode_error);
@@ -663,16 +663,16 @@ IRInterpreter::Interpret (llvm::Module &
 
 lldb::addr_t ptr = args[arg_index];
 
-frame.MakeArgument(ai, ptr);
+frame.MakeArgument(&*ai, ptr);
 }
 
 uint32_t num_insts = 0;
 
-frame.Jump(function.begin());
+frame.Jump(&function.front());
 
 while (frame.m_ii != frame.m_ie && (++num_insts < 4096))
 {
-const Instruction *inst = frame.m_ii;
+const Instruction *inst = &*frame.m_ii;
 
 if (log)
 log->Printf("Interpreting %s", PrintValue(inst).c_str());

Modified: lldb/trunk/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp?rev=252378&r1=252377&r2=252378&view=diff
==
--- lldb/trunk/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp (original)
+++ lldb/trunk/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp Fri Nov  6 
18:54:13 2015
@@ -338,7 +338,7 @@ IRForTarget::ResolveFunctionPointers(llv
  fi != llvm_module.end();
  ++fi)
 {
-Function *fun = fi;
+Function *fun = &*fi;
 
 bool is_decl = fun->isDeclaration();
 
@@ -1955,7 +1955,7 @@ IRForTarget::ReplaceStaticLiterals (llvm
 if (operand_constant_fp/* && 
operand_constant_fp->getType()->isX86_FP80Ty()*/)
 {
 static_constants.push_back(operand_val);
-static_users.push_back(ii);
+static_users.push_back(&*ii);
 }
 }
 }
@@ -2280,7 +2280,7 @@ IRForTarget::ReplaceVariables (Function
 return false;
 }
 
-Argument *argument = iter;
+Argument *argument = &*iter;
 
 if (argument->getName().equals("this"))
 {
@@ -2294,7 +2294,7 @@ IRForTarget::ReplaceVariables (Function
 return false;
 }
 
-argument = iter;
+argument = &*iter;
 }
 else if (argument->getName().equals("self"))
 {
@@ -2326,7 +2326,7 @@ IRForTarget::ReplaceVariables (Function
 return false;
 }
 
-argument = iter;
+argument = &*iter;
 }
 
 if (!argument->getName().equals("$__lldb_arg"))
@@ -2624,7 +2624,7 @@ IRForTarget::runOnModule (Module &llvm_m
  fi != fe;
  ++fi)
 {
-llvm::Function *function = fi;
+llvm::Function *function = &*fi;
 
 if (function->begin() == function->end())
 continue;
@@ -2699,7 +2699,7 @@ IRForTarget::runOnModule (Module &llvm_m
  fi != fe;
  ++fi)
 {