From 2ae0fc61c3ac681482a0e4a6120ee19ecbad7e7f Mon Sep 17 00:00:00 2001 From: Axel Naumann Date: Fri, 19 Sep 2014 16:51:17 +0200 Subject: [PATCH] Make sure we have a cling autoload annotation. --- interpreter/cling/lib/Interpreter/AutoloadCallback.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/interpreter/cling/lib/Interpreter/AutoloadCallback.cpp b/interpreter/cling/lib/Interpreter/AutoloadCallback.cpp index 372ee43..524c4a0 100644 --- a/interpreter/cling/lib/Interpreter/AutoloadCallback.cpp +++ b/interpreter/cling/lib/Interpreter/AutoloadCallback.cpp @@ -40,7 +40,8 @@ namespace cling { = sema.getDiagnostics().getCustomDiagID(DiagnosticsEngine::Level::Note, "Type : %0 , Full Path: %1")*/; - sema.Diags.Report(l, id) << name << header.drop_front(15); + if (header.startswith(llvm::StringRef("$clingAutoload$", 15))) + sema.Diags.Report(l, id) << name << header.drop_front(15); } @@ -59,7 +60,7 @@ namespace cling { void InsertIntoAutoloadingState (Decl* decl, llvm::StringRef annotation) { assert(!annotation.empty() && "Empty annotation!"); - if (annotation != llvm::StringRef("$clingAutoload$", 15)) { + if (!annotation.startswith(llvm::StringRef("$clingAutoload$", 15))) { // not an autoload annotation. return; } -- 1.8.2