From: Axel Naumann Date: Fri, 12 Sep 2014 11:57:19 +0000 (+0200) Subject: Prefix annotation by $clingAutoload$ to not confuse it with others. X-Git-Tag: v6-02-00-rc1~128^2~10 X-Git-Url: https://root.cern.ch/gitweb?p=root.git;a=commitdiff_plain;h=c2be7873881ce393b091404e09448e8a5f9fd6cb Prefix annotation by $clingAutoload$ to not confuse it with others. --- diff --git a/interpreter/cling/lib/Interpreter/AutoloadCallback.cpp b/interpreter/cling/lib/Interpreter/AutoloadCallback.cpp index f0bfcff..b9edeb6 100644 --- a/interpreter/cling/lib/Interpreter/AutoloadCallback.cpp +++ b/interpreter/cling/lib/Interpreter/AutoloadCallback.cpp @@ -40,7 +40,7 @@ namespace cling { = sema.getDiagnostics().getCustomDiagID(DiagnosticsEngine::Level::Note, "Type : %0 , Full Path: %1")*/; - sema.Diags.Report(l, id) << name << header; + sema.Diags.Report(l, id) << name << header.drop_front(15); } @@ -58,9 +58,14 @@ namespace cling { AutoloadCallback::FwdDeclsMap* m_Map; clang::Preprocessor* m_PP; private: - void InsertIntoAutoloadingState (Decl* decl, std::string annotation) { + void InsertIntoAutoloadingState (Decl* decl, llvm::StringRef annotation) { + + assert(!annotation.empty() && "Empty annotation!"); + if (annotation != llvm::StringRef("$clingAutoload$", 15)) { + // not an autoload annotation. + return; + } - assert(annotation != "" && "Empty annotation!"); assert(m_PP); const FileEntry* FE = 0; @@ -69,10 +74,11 @@ namespace cling { const DirectoryLookup* LookupFrom = 0; const DirectoryLookup* CurDir = 0; - FE = m_PP->LookupFile(fileNameLoc, annotation, isAngled, LookupFrom, - CurDir, /*SearchPath*/0, /*RelativePath*/ 0, - /*suggestedModule*/0, /*SkipCache*/false, - /*OpenFile*/ false, /*CacheFail*/ false); + FE = m_PP->LookupFile(fileNameLoc, annotation.data() + 15, isAngled, + LookupFrom, CurDir, /*SearchPath*/0, + /*RelativePath*/ 0, /*suggestedModule*/0, + /*SkipCache*/false, /*OpenFile*/ false, + /*CacheFail*/ false); assert(FE && "Must have a valid FileEntry"); diff --git a/interpreter/cling/lib/Interpreter/ForwardDeclPrinter.cpp b/interpreter/cling/lib/Interpreter/ForwardDeclPrinter.cpp index 9d17790..b88c53b 100644 --- a/interpreter/cling/lib/Interpreter/ForwardDeclPrinter.cpp +++ b/interpreter/cling/lib/Interpreter/ForwardDeclPrinter.cpp @@ -162,8 +162,8 @@ namespace cling { } std::string file = PLocs[PLocs.size() -1].getFilename(); // assert ( file.length() != 0 && "Filename Should not be blank"); - Out() << " __attribute__((annotate(\"" - << file; + Out() << " __attribute__((annotate(\"$clingAutoload$" + << llvm::StringRef(includeText, includeEnd - includeText); if (!extra.empty()) Out() << " " << extra; Out() << "\"))) ";