Adapt to interface changes due to upgrade to r302975.

This commit is contained in:
Vassil Vassilev 2017-05-18 15:16:30 +02:00 committed by sftnight
parent 1e7b6619f5
commit a1bd767b6b
19 changed files with 103 additions and 124 deletions

View File

@ -1 +1 @@
274612
302975

View File

@ -26,7 +26,7 @@ namespace cling {
ClingCodeCompleteConsumer(const CodeCompleteOptions &CodeCompleteOpts,
std::vector<std::string> &completions)
: CodeCompleteConsumer(CodeCompleteOpts, false),
m_CCTUInfo(new GlobalCodeCompletionAllocator),
m_CCTUInfo(std::make_shared<GlobalCodeCompletionAllocator>()),
m_Completions(completions) {}
~ClingCodeCompleteConsumer() {}

View File

@ -28,7 +28,7 @@ namespace cling {
public:
InterpreterException(const std::string& Reason);
InterpreterException(const char* What, clang::Sema* = nullptr);
virtual ~InterpreterException() LLVM_NOEXCEPT;
virtual ~InterpreterException() noexcept;
///\brief Return true if error was diagnosed false otherwise
virtual bool diagnose() const;
@ -45,7 +45,7 @@ namespace cling {
const DerefType m_Type;
public:
InvalidDerefException(clang::Sema* S, const clang::Expr* E, DerefType type);
virtual ~InvalidDerefException() LLVM_NOEXCEPT;
virtual ~InvalidDerefException() noexcept;
bool diagnose() const override;
};
@ -60,7 +60,7 @@ namespace cling {
class CompilationException: public InterpreterException {
public:
CompilationException(const std::string& Reason);
~CompilationException() LLVM_NOEXCEPT;
~CompilationException() noexcept;
// Handle fatal llvm errors by throwing an exception.
// Yes, throwing exceptions in error handlers is bad.

View File

@ -124,8 +124,8 @@ namespace cling {
FE = m_PP->LookupFile(fileNameLoc, FileName, isAngled,
FromDir, FromFile, CurDir, /*SearchPath*/0,
/*RelativePath*/ 0, /*suggestedModule*/0,
/*SkipCache*/ false, /*OpenFile*/ false,
/*CacheFail*/ true);
/*IsMapped*/0, /*SkipCache*/ false,
/*OpenFile*/ false, /*CacheFail*/ true);
needCacheUpdate = true;
}

View File

@ -17,7 +17,8 @@
#include "llvm/IR/Verifier.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Transforms/IPO.h"
#include "llvm/Transforms/IPO/InlinerPass.h"
#include "llvm/Transforms/IPO/AlwaysInliner.h"
#include "llvm/Transforms/IPO/Inliner.h"
#include "llvm/Transforms/IPO/PassManagerBuilder.h"
#include "llvm/Transforms/Scalar.h"
@ -106,7 +107,7 @@ void BackendPasses::CreatePasses(llvm::Module& M, int OptLevel)
// Handle disabling of LLVM optimization, where we want to preserve the
// internal module before any optimization.
if (m_CGOpts.DisableLLVMOpts) {
if (m_CGOpts.DisableLLVMPasses) {
OptLevel = 0;
// Always keep at least ForceInline - NoInlining is deadly for libc++.
// Inlining = CGOpts.NoInlining;
@ -120,33 +121,21 @@ void BackendPasses::CreatePasses(llvm::Module& M, int OptLevel)
PMBuilder.LoopVectorize = OptLevel > 1 ? 1 : 0; // m_CGOpts.VectorizeLoop
PMBuilder.DisableTailCalls = m_CGOpts.DisableTailCalls;
PMBuilder.DisableUnitAtATime = OptLevel == 2 ? !m_CGOpts.UnitAtATime : 1;
PMBuilder.DisableUnrollLoops = !m_CGOpts.UnrollLoops;
PMBuilder.MergeFunctions = m_CGOpts.MergeFunctions;
PMBuilder.RerollLoops = m_CGOpts.RerollLoops;
PMBuilder.LibraryInfo = new TargetLibraryInfoImpl(m_TM.getTargetTriple());
switch (Inlining) {
case CodeGenOptions::OnlyHintInlining: // fall-through:
case CodeGenOptions::NoInlining: {
assert(0 && "libc++ requires at least OnlyAlwaysInlining!");
break;
}
case CodeGenOptions::NormalInlining: {
PMBuilder.Inliner =
createFunctionInliningPass(OptLevel, m_CGOpts.OptimizeSize);
break;
}
case CodeGenOptions::OnlyAlwaysInlining:
// Respect always_inline.
if (OptLevel == 0)
// Do not insert lifetime intrinsics at -O0.
PMBuilder.Inliner = createAlwaysInlinerPass(false);
else
PMBuilder.Inliner = createAlwaysInlinerPass();
break;
// At O0 and O1 we only run the always inliner which is more efficient. At
// higher optimization levels we run the normal inliner.
if (m_CGOpts.OptimizationLevel <= 1) {
bool InsertLifetimeIntrinsics = m_CGOpts.OptimizationLevel != 0;
PMBuilder.Inliner = createAlwaysInlinerLegacyPass(InsertLifetimeIntrinsics);
} else {
PMBuilder.Inliner = createFunctionInliningPass(m_CGOpts.OptimizationLevel,
m_CGOpts.OptimizeSize,
(!m_CGOpts.SampleProfileFile.empty() && m_CGOpts.EmitSummaryIndex));
}
// Set up the per-module pass manager.
@ -156,13 +145,7 @@ void BackendPasses::CreatePasses(llvm::Module& M, int OptLevel)
m_MPM[OptLevel]->add(createTargetTransformInfoWrapperPass(
m_TM.getTargetIRAnalysis()));
// Add target-specific passes that need to run as early as possible.
PMBuilder.addExtension(
PassManagerBuilder::EP_EarlyAsPossible,
[&](const PassManagerBuilder &,
legacy::PassManagerBase &PM) {
m_TM.addEarlyAsPossiblePasses(PM);
});
m_TM.adjustPassManager(PMBuilder);
PMBuilder.addExtension(PassManagerBuilder::EP_EarlyAsPossible,
[&](const PassManagerBuilder &,

View File

@ -29,6 +29,7 @@
#include "clang/Frontend/VerifyDiagnosticConsumer.h"
#include "clang/Serialization/SerializationDiagnostic.h"
#include "clang/Lex/Preprocessor.h"
#include "clang/Lex/PreprocessorOptions.h"
#include "clang/Sema/Sema.h"
#include "clang/Sema/SemaDiagnostic.h"
#include "clang/Serialization/ASTReader.h"
@ -39,6 +40,7 @@
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Host.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/Process.h"
#include "llvm/Support/TargetSelect.h"
#include "llvm/Target/TargetOptions.h"
@ -730,8 +732,7 @@ static void stringifyPreprocSetting(PreprocessorOptions& PPOpts,
argvCompile.push_back("-");
}
std::unique_ptr<clang::CompilerInvocation>
InvocationPtr(new clang::CompilerInvocation);
auto InvocationPtr = std::make_shared<clang::CompilerInvocation>();
// The compiler invocation is the owner of the diagnostic options.
// Everything else points to them.
@ -775,8 +776,7 @@ static void stringifyPreprocSetting(PreprocessorOptions& PPOpts,
// Create and setup a compiler instance.
std::unique_ptr<CompilerInstance> CI(new CompilerInstance());
CI->setInvocation(InvocationPtr.get());
InvocationPtr.release();
CI->setInvocation(InvocationPtr);
CI->setDiagnostics(Diags.get()); // Diags is ref-counted
if (!OnlyLex)
CI->getDiagnosticOpts().ShowColors = cling::utils::ColorizeOutput();
@ -850,7 +850,8 @@ static void stringifyPreprocSetting(PreprocessorOptions& PPOpts,
CI->getFileManager(),
CI->getPCHContainerReader(),
false /*FindModuleFileExt*/,
listener)) {
listener,
/*ValidateDiagnosticOptions=*/false)) {
// When running interactively pass on the info that the PCH
// has failed so that IncrmentalParser::Initialize won't try again.
if (!HasInput && llvm::sys::Process::StandardInIsUserInput()) {

View File

@ -264,7 +264,7 @@ namespace cling {
///
void CollectFilesToUncache(clang::SourceLocation Loc);
LLVM_CONSTEXPR static bool isDefinition(void*) { return false; }
constexpr static bool isDefinition(void*) { return false; }
static bool isDefinition(clang::TagDecl* R);
static void resetDefinitionData(void*) {

View File

@ -96,9 +96,8 @@ namespace {
if (Node->hasExplicitTemplateArgs())
TemplateSpecializationType::PrintTemplateArgumentList(OS,
Node->getTemplateArgs(),
Node->getNumTemplateArgs(),
m_Policy);
Node->template_arguments(),
m_Policy);
if (Node->hasExplicitTemplateArgs())
assert((Node->getTemplateArgs() || Node->getNumTemplateArgs()) && \
"There shouldn't be template paramlist");
@ -490,8 +489,7 @@ namespace cling {
Inits);
m_Sema->AddInitializerToDecl(HandlerInstance,
InitExprResult.get(),
/*DirectInit*/ true,
/*TypeMayContainAuto*/ false);
/*DirectInit*/ true);
// 2.5 Register the instance in the enclosing context
CuredDecl->getDeclContext()->addDecl(HandlerInstance);
@ -783,8 +781,7 @@ namespace cling {
//valid!
// TODO: Propose a patch in clang
m_NoRange,
Initializer.get(),
/*TypeMayContainAuto*/false
Initializer.get()
).get();
return Result;
}

View File

@ -61,7 +61,7 @@ namespace cling {
std::runtime_error(What), m_Sema(S) {}
bool InterpreterException::diagnose() const { return false; }
InterpreterException::~InterpreterException() LLVM_NOEXCEPT {}
InterpreterException::~InterpreterException() noexcept {}
InvalidDerefException::InvalidDerefException(clang::Sema* S,
@ -73,7 +73,7 @@ namespace cling {
"non-null arguments", S),
m_Arg(E), m_Type(type) {}
InvalidDerefException::~InvalidDerefException() LLVM_NOEXCEPT {}
InvalidDerefException::~InvalidDerefException() noexcept {}
bool InvalidDerefException::diagnose() const {
// Construct custom diagnostic: warning for invalid memory address;
@ -94,7 +94,7 @@ namespace cling {
CompilationException::CompilationException(const std::string& Reason) :
InterpreterException(Reason) {}
CompilationException::~CompilationException() LLVM_NOEXCEPT {}
CompilationException::~CompilationException() noexcept {}
void CompilationException::throwingHandler(void * /*user_data*/,
const std::string& reason,

View File

@ -206,8 +206,8 @@ namespace cling {
FE = PP.LookupFile(fileNameLoc, FileName, isAngled,
FromDir, FromFile, CurDir, /*SearchPath*/0,
/*RelativePath*/ 0, /*suggestedModule*/0,
/*SkipCache*/ false, /*OpenFile*/ false,
/*CacheFail*/ true);
/*IsMapped*/0, /*SkipCache*/ false,
/*OpenFile*/ false, /*CacheFail*/ true);
// Return true if we can '#include' the given filename
return FE != nullptr;
};

View File

@ -18,6 +18,7 @@
#include "cling/Utils/Platform.h"
#include "clang/Basic/Diagnostic.h"
#include "clang/Basic/TargetOptions.h"
#include "clang/Frontend/CodeGenOptions.h"
#include "clang/Frontend/CompilerInstance.h"

View File

@ -41,7 +41,7 @@ public:
class NotifyFinalizedT {
public:
NotifyFinalizedT(cling::IncrementalJIT &jit) : m_JIT(jit) {}
void operator()(llvm::orc::ObjectLinkingLayerBase::ObjSetHandleT H) {
void operator()(llvm::orc::RTDyldObjectLinkingLayerBase::ObjSetHandleT H) {
m_JIT.RemoveUnfinalizedSection(H);
}
@ -205,12 +205,11 @@ public:
#endif
}
void deregisterEHFrames(uint8_t *Addr, uint64_t LoadAddr,
size_t Size) override {
void deregisterEHFrames() override {
#ifdef LLVM_ON_WIN32
platform::DeRegisterEHFrames(Addr, Size);
#else
return getExeMM()->deregisterEHFrames(Addr, LoadAddr, Size);
return getExeMM()->deregisterEHFrames();
#endif
}
@ -294,9 +293,9 @@ IncrementalJIT::IncrementalJIT(IncrementalExecutor& exe,
}
llvm::orc::JITSymbol
llvm::JITSymbol
IncrementalJIT::getInjectedSymbols(const std::string& Name) const {
using JITSymbol = llvm::orc::JITSymbol;
using JITSymbol = llvm::JITSymbol;
auto SymMapI = m_SymbolMap.find(Name);
if (SymMapI != m_SymbolMap.end())
return JITSymbol(SymMapI->second, llvm::JITSymbolFlags::Exported);
@ -319,7 +318,7 @@ IncrementalJIT::lookupSymbol(llvm::StringRef Name, void *InAddr, bool Jit) {
#ifdef MANGLE_PREFIX
Key.insert(0, MANGLE_PREFIX);
#endif
m_SymbolMap[Key] = llvm::orc::TargetAddress(InAddr);
m_SymbolMap[Key] = llvm::JITTargetAddress(InAddr);
}
llvm::sys::DynamicLibrary::AddSymbol(Name, InAddr);
return std::make_pair(InAddr, true);
@ -327,16 +326,16 @@ IncrementalJIT::lookupSymbol(llvm::StringRef Name, void *InAddr, bool Jit) {
return std::make_pair(Addr, false);
}
llvm::orc::JITSymbol
llvm::JITSymbol
IncrementalJIT::getSymbolAddressWithoutMangling(const std::string& Name,
bool AlsoInProcess) {
if (auto Sym = getInjectedSymbols(Name))
return Sym;
if (AlsoInProcess) {
if (RuntimeDyld::SymbolInfo SymInfo = m_ExeMM->findSymbol(Name))
return llvm::orc::JITSymbol(SymInfo.getAddress(),
llvm::JITSymbolFlags::Exported);
if (llvm::JITSymbol SymInfo = m_ExeMM->findSymbol(Name))
return llvm::JITSymbol(SymInfo.getAddress(),
llvm::JITSymbolFlags::Exported);
#ifdef LLVM_ON_WIN32
// FIXME: DLSym symbol lookup can overlap m_ExeMM->findSymbol wasting time
// looking for a symbol in libs where it is already known not to exist.
@ -346,15 +345,15 @@ IncrementalJIT::getSymbolAddressWithoutMangling(const std::string& Name,
// An upside to doing it this way is RTLD_GLOBAL won't need to be used
// allowing libs with competing symbols to co-exists.
if (const void* Sym = platform::DLSym(Name))
return llvm::orc::JITSymbol(llvm::orc::TargetAddress(Sym),
llvm::JITSymbolFlags::Exported);
return llvm::JITSymbol(llvm::JITTargetAddress(Sym),
llvm::JITSymbolFlags::Exported);
#endif
}
if (auto Sym = m_LazyEmitLayer.findSymbol(Name, false))
return Sym;
return llvm::orc::JITSymbol(nullptr);
return llvm::JITSymbol(nullptr);
}
size_t IncrementalJIT::addModules(std::vector<llvm::Module*>&& modules) {
@ -368,14 +367,12 @@ size_t IncrementalJIT::addModules(std::vector<llvm::Module*>&& modules) {
auto Resolver = llvm::orc::createLambdaResolver(
[&](const std::string &S) {
if (auto Sym = getInjectedSymbols(S))
return RuntimeDyld::SymbolInfo((uint64_t)Sym.getAddress(),
Sym.getFlags());
return JITSymbol((uint64_t)Sym.getAddress(), Sym.getFlags());
return m_ExeMM->findSymbol(S);
},
[&](const std::string &Name) {
if (auto Sym = getSymbolAddressWithoutMangling(Name, true))
return RuntimeDyld::SymbolInfo(Sym.getAddress(),
Sym.getFlags());
return JITSymbol(Sym.getAddress(), Sym.getFlags());
const std::string* NameNP = &Name;
#ifdef MANGLE_PREFIX
@ -393,7 +390,7 @@ size_t IncrementalJIT::addModules(std::vector<llvm::Module*>&& modules) {
/// It is used to resolve symbols during module linking.
uint64_t addr = uint64_t(getParent().NotifyLazyFunctionCreators(*NameNP));
return RuntimeDyld::SymbolInfo(addr, llvm::JITSymbolFlags::Weak);
return JITSymbol(addr, llvm::JITSymbolFlags::Weak);
});
ModuleSetHandleT MSHandle

View File

@ -21,10 +21,11 @@
#include "llvm/IR/Mangler.h"
#include "llvm/IR/GlobalValue.h"
#include "llvm/ExecutionEngine/JITEventListener.h"
#include "llvm/ExecutionEngine/JITSymbol.h"
#include "llvm/ExecutionEngine/Orc/CompileUtils.h"
#include "llvm/ExecutionEngine/Orc/IRCompileLayer.h"
#include "llvm/ExecutionEngine/Orc/LazyEmittingLayer.h"
#include "llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h"
#include "llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h"
#include "llvm/ExecutionEngine/RTDyldMemoryManager.h"
#include "llvm/Target/TargetMachine.h"
@ -39,7 +40,7 @@ class IncrementalExecutor;
class IncrementalJIT {
public:
using SymbolMapT = llvm::StringMap<llvm::orc::TargetAddress>;
using SymbolMapT = llvm::StringMap<llvm::JITTargetAddress>;
private:
friend class Azog;
@ -58,7 +59,7 @@ private:
NotifyObjectLoadedT(IncrementalJIT &jit) : m_JIT(jit) {}
void operator()(llvm::orc::ObjectLinkingLayerBase::ObjSetHandleT H,
void operator()(llvm::orc::RTDyldObjectLinkingLayerBase::ObjSetHandleT H,
const ObjListT &Objects,
const LoadedObjInfoListT &Infos) const
{
@ -87,9 +88,9 @@ private:
continue;
auto Name = NameOrError.get();
if (m_JIT.m_SymbolMap.find(Name) == m_JIT.m_SymbolMap.end()) {
llvm::orc::JITSymbol Sym
llvm::JITSymbol Sym
= m_JIT.m_CompileLayer.findSymbolIn(H, Name, true);
if (llvm::orc::TargetAddress Addr = Sym.getAddress())
if (llvm::JITTargetAddress Addr = Sym.getAddress())
m_JIT.m_SymbolMap[Name] = Addr;
}
}
@ -101,9 +102,9 @@ private:
};
class RemovableObjectLinkingLayer:
public llvm::orc::ObjectLinkingLayer<NotifyObjectLoadedT> {
public llvm::orc::RTDyldObjectLinkingLayer<NotifyObjectLoadedT> {
public:
using Base_t = llvm::orc::ObjectLinkingLayer<NotifyObjectLoadedT>;
using Base_t = llvm::orc::RTDyldObjectLinkingLayer<NotifyObjectLoadedT>;
using NotifyLoadedFtor = NotifyObjectLoadedT;
using NotifyFinalizedFtor = Base_t::NotifyFinalizedFtor;
RemovableObjectLinkingLayer(SymbolMapT &SymMap,
@ -112,11 +113,11 @@ private:
Base_t(NotifyLoaded, NotifyFinalized), m_SymbolMap(SymMap)
{}
void removeObjectSet(llvm::orc::ObjectLinkingLayerBase::ObjSetHandleT H) {
void
removeObjectSet(llvm::orc::RTDyldObjectLinkingLayerBase::ObjSetHandleT H) {
struct AccessSymbolTable: public LinkedObjectSet {
const llvm::StringMap<llvm::RuntimeDyld::SymbolInfo>&
getSymbolTable() const
{
const llvm::StringMap<llvm::JITEvaluatedSymbol>&
getSymbolTable() const {
return SymbolTable;
}
};
@ -130,7 +131,7 @@ private:
if (iterSymMap->second == NameSym.second.getAddress())
m_SymbolMap.erase(iterSymMap);
}
llvm::orc::ObjectLinkingLayer<NotifyObjectLoadedT>::removeObjectSet(H);
llvm::orc::RTDyldObjectLinkingLayer<NotifyObjectLoadedT>::removeObjectSet(H);
}
private:
SymbolMapT& m_SymbolMap;
@ -179,7 +180,7 @@ private:
return MangledName.str();
}
llvm::orc::JITSymbol getInjectedSymbols(const std::string& Name) const;
llvm::JITSymbol getInjectedSymbols(const std::string& Name) const;
public:
IncrementalJIT(IncrementalExecutor& exe,
@ -199,7 +200,7 @@ public:
///\brief Get the address of a symbol from the JIT or the memory manager.
/// Use this to resolve symbols of known, target-specific names.
llvm::orc::JITSymbol getSymbolAddressWithoutMangling(const std::string& Name,
llvm::JITSymbol getSymbolAddressWithoutMangling(const std::string& Name,
bool AlsoInProcess);
size_t addModules(std::vector<llvm::Module*>&& modules);
@ -207,8 +208,8 @@ public:
IncrementalExecutor& getParent() const { return m_Parent; }
void
RemoveUnfinalizedSection(llvm::orc::ObjectLinkingLayerBase::ObjSetHandleT H) {
void RemoveUnfinalizedSection(
llvm::orc::RTDyldObjectLinkingLayerBase::ObjSetHandleT H) {
m_UnfinalizedSections.erase(H);
}

View File

@ -39,6 +39,7 @@
#include "clang/CodeGen/ModuleBuilder.h"
#include "clang/Frontend/CompilerInstance.h"
#include "clang/Lex/Preprocessor.h"
#include "clang/Lex/PreprocessorOptions.h"
#include "clang/Parse/Parser.h"
#include "clang/Sema/Sema.h"
#include "clang/Sema/SemaDiagnostic.h"

View File

@ -488,7 +488,8 @@ namespace cling {
if (what.equals("asttree")) {
std::unique_ptr<clang::ASTConsumer> printer =
clang::CreateASTDumper(filter, true /*DumpDecls*/,
false /*DumpLookups*/ );
false /*Deserialize*/,
false /*DumpLookups*/);
printer->HandleTranslationUnit(getSema().getASTContext());
} else if (what.equals("ast"))
getSema().getASTContext().PrintStats();
@ -654,6 +655,7 @@ namespace cling {
SourceLocation fileNameLoc;
PP.LookupFile(fileNameLoc, headerFile, isAngled, FromDir, FromFile, CurDir,
/*SearchPath*/0, /*RelativePath*/ 0, &suggestedModule,
0 /*IsMapped*/,
/*SkipCache*/false, /*OpenFile*/ false, /*CacheFail*/ false);
if (!suggestedModule)
return Interpreter::kFailure;
@ -1188,7 +1190,7 @@ namespace cling {
SourceLocation fileNameLoc;
FE = PP.LookupFile(fileNameLoc, canonicalFile, isAngled, FromDir, FromFile,
CurDir, /*SearchPath*/0, /*RelativePath*/ 0,
/*suggestedModule*/0, /*SkipCache*/false,
/*suggestedModule*/0, 0 /*IsMapped*/, /*SkipCache*/false,
/*OpenFile*/ false, /*CacheFail*/ false);
if (FE)
return FE->getName();

View File

@ -687,7 +687,7 @@ namespace cling {
//
// Now try to parse the name as a type.
//
if (P.TryAnnotateTypeOrScopeToken(false, false)) {
if (P.TryAnnotateTypeOrScopeToken()) {
// error path
return 0;
}
@ -741,7 +741,7 @@ namespace cling {
//
// Now try to parse the name as a type.
//
if (P.TryAnnotateTypeOrScopeToken(false, false)) {
if (P.TryAnnotateTypeOrScopeToken()) {
// error path
return 0;
}
@ -1268,6 +1268,7 @@ namespace cling {
if (P.ParseUnqualifiedId(SS, /*EnteringContext*/false,
/*AllowDestructorName*/true,
/*AllowConstructorName*/true,
/*AllowDeductionGuide*/ false,
ParsedType(), TemplateKWLoc,
FuncId)) {
// Failed parse, cleanup.

View File

@ -323,8 +323,7 @@ namespace {
/*allocTypeInfo*/ETSI,
/*arraySize*/0,
/*directInitRange*/E->getSourceRange(),
/*initializer*/E,
/*mayContainAuto*/false
/*initializer*/E
);
// Handle possible cleanups:
Call = m_Sema->ActOnFinishFullExpr(Call.get());

View File

@ -290,7 +290,7 @@ namespace utils {
if (mightHaveChanged) {
QualType QT
= Ctx.getTemplateSpecializationType(TST->getTemplateName(),
desArgs.data(), desArgs.size(),
desArgs,
TST->getCanonicalTypeInternal());
return QT.getTypePtr();
}
@ -323,9 +323,7 @@ namespace utils {
if (mightHaveChanged) {
TemplateName TN(TSTdecl->getSpecializedTemplate());
QualType QT
= Ctx.getTemplateSpecializationType(TN,
desArgs.data(),
desArgs.size(),
= Ctx.getTemplateSpecializationType(TN, desArgs,
TSTRecord->getCanonicalTypeInternal());
return QT.getTypePtr();
}
@ -1316,8 +1314,7 @@ namespace utils {
if (mightHaveChanged) {
Qualifiers qualifiers = QT.getLocalQualifiers();
QT = Ctx.getTemplateSpecializationType(TST->getTemplateName(),
desArgs.data(),
desArgs.size(),
desArgs,
TST->getCanonicalTypeInternal());
QT = Ctx.getQualifiedType(QT, qualifiers);
}
@ -1389,8 +1386,7 @@ namespace utils {
if (mightHaveChanged) {
Qualifiers qualifiers = QT.getLocalQualifiers();
TemplateName TN(TSTdecl->getSpecializedTemplate());
QT = Ctx.getTemplateSpecializationType(TN, desArgs.data(),
desArgs.size(),
QT = Ctx.getTemplateSpecializationType(TN, desArgs,
TSTRecord->getCanonicalTypeInternal());
QT = Ctx.getQualifiedType(QT, qualifiers);
}

View File

@ -292,14 +292,14 @@ const clang::FunctionDecl* G_d1_proto = lookup.findFunctionProto(G, "G_d<int>",
printf("G_d1_args: 0x%lx\n", (unsigned long) G_d1_args);
//CHECK: G_d1_args: 0x{{[1-9a-f][0-9a-f]*$}}
G_d1_args->print(cling::outs());
//CHECK-NEXT: void G_d(int v) {
//CHECK-NEXT: template<> void G_d<int>(int v) {
//CHECK-NEXT: int x = v;
//CHECK-NEXT: }
printf("G_d1_proto: 0x%lx\n", (unsigned long) G_d1_proto);
//CHECK: G_d1_proto: 0x{{[1-9a-f][0-9a-f]*$}}
G_d1_proto->print(cling::outs());
//CHECK-NEXT: void G_d(int v) {
//CHECK-NEXT: template<> void G_d<int>(int v) {
//CHECK-NEXT: int x = v;
//CHECK-NEXT: }
@ -309,14 +309,14 @@ const clang::FunctionDecl* G_d2_proto = lookup.findFunctionProto(G, "G_d<double>
printf("G_d2_args: 0x%lx\n", (unsigned long) G_d2_args);
//CHECK: G_d2_args: 0x{{[1-9a-f][0-9a-f]*$}}
G_d2_args->print(cling::outs());
//CHECK-NEXT: void G_d(double v) {
//CHECK-NEXT: template<> void G_d<double>(double v) {
//CHECK-NEXT: double x = v;
//CHECK-NEXT: }
printf("G_d2_proto: 0x%lx\n", (unsigned long) G_d2_proto);
//CHECK: G_d2_proto: 0x{{[1-9a-f][0-9a-f]*$}}
G_d2_proto->print(cling::outs());
//CHECK-NEXT: void G_d(double v) {
//CHECK-NEXT: template<> void G_d<double>(double v) {
//CHECK-NEXT: double x = v;
//CHECK-NEXT: }
@ -447,14 +447,14 @@ const clang::FunctionDecl* H_d1_proto = lookup.findFunctionProto(namespace_N, "H
printf("H_d1_args: 0x%lx\n", (unsigned long) H_d1_args);
//CHECK: H_d1_args: 0x{{[1-9a-f][0-9a-f]*$}}
H_d1_args->print(cling::outs());
//CHECK-NEXT: void H_d(int v) {
//CHECK-NEXT: template<> void H_d<int>(int v) {
//CHECK-NEXT: int x = v;
//CHECK-NEXT: }
printf("H_d1_proto: 0x%lx\n", (unsigned long) H_d1_proto);
//CHECK: H_d1_proto: 0x{{[1-9a-f][0-9a-f]*$}}
H_d1_proto->print(cling::outs());
//CHECK-NEXT: void H_d(int v) {
//CHECK-NEXT: template<> void H_d<int>(int v) {
//CHECK-NEXT: int x = v;
//CHECK-NEXT: }
@ -464,14 +464,14 @@ const clang::FunctionDecl* H_d2_proto = lookup.findFunctionProto(namespace_N, "H
printf("H_d2_args: 0x%lx\n", (unsigned long) H_d2_args);
//CHECK: H_d2_args: 0x{{[1-9a-f][0-9a-f]*$}}
H_d2_args->print(cling::outs());
//CHECK-NEXT: void H_d(double v) {
//CHECK-NEXT: template<> void H_d<double>(double v) {
//CHECK-NEXT: double x = v;
//CHECK-NEXT: }
printf("H_d2_proto: 0x%lx\n", (unsigned long) H_d2_proto);
//CHECK: H_d2_proto: 0x{{[1-9a-f][0-9a-f]*$}}
H_d2_proto->print(cling::outs());
//CHECK-NEXT: void H_d(double v) {
//CHECK-NEXT: template<> void H_d<double>(double v) {
//CHECK-NEXT: double x = v;
//CHECK-NEXT: }
@ -602,14 +602,14 @@ const clang::FunctionDecl* func_A_k1_proto = lookup.findFunctionProto(class_A, "
printf("func_A_k1_args: 0x%lx\n", (unsigned long) func_A_k1_args);
//CHECK: func_A_k1_args: 0x{{[1-9a-f][0-9a-f]*$}}
func_A_k1_args->print(cling::outs());
//CHECK-NEXT: void A_k(int v) {
//CHECK-NEXT: template<> void A_k<int>(int v) {
//CHECK-NEXT: int x = v;
//CHECK-NEXT: }
printf("func_A_k1_proto: 0x%lx\n", (unsigned long) func_A_k1_proto);
//CHECK: func_A_k1_proto: 0x{{[1-9a-f][0-9a-f]*$}}
func_A_k1_proto->print(cling::outs());
//CHECK-NEXT: void A_k(int v) {
//CHECK-NEXT: template<> void A_k<int>(int v) {
//CHECK-NEXT: int x = v;
//CHECK-NEXT: }
@ -619,14 +619,14 @@ const clang::FunctionDecl* func_A_k2_proto = lookup.findFunctionProto(class_A, "
printf("func_A_k2_args: 0x%lx\n", (unsigned long) func_A_k2_args);
//CHECK: func_A_k2_args: 0x{{[1-9a-f][0-9a-f]*$}}
func_A_k2_args->print(cling::outs());
//CHECK-NEXT: void A_k(double v) {
//CHECK-NEXT: template<> void A_k<double>(double v) {
//CHECK-NEXT: double x = v;
//CHECK-NEXT: }
printf("func_A_k2_proto: 0x%lx\n", (unsigned long) func_A_k2_proto);
//CHECK: func_A_k2_proto: 0x{{[1-9a-f][0-9a-f]*$}}
func_A_k2_proto->print(cling::outs());
//CHECK-NEXT: void A_k(double v) {
//CHECK-NEXT: template<> void A_k<double>(double v) {
//CHECK-NEXT: double x = v;
//CHECK-NEXT: }
@ -850,14 +850,14 @@ const clang::FunctionDecl* func_B_k1_proto = lookup.findFunctionProto(class_A, "
printf("func_B_k1_args: 0x%lx\n", (unsigned long) func_B_k1_args);
//CHECK: func_B_k1_args: 0x{{[1-9a-f][0-9a-f]*$}}
func_B_k1_args->print(cling::outs());
//CHECK-NEXT: void B_k(int v) {
//CHECK-NEXT: template<> void B_k<int>(int v) {
//CHECK-NEXT: int x = v;
//CHECK-NEXT: }
printf("func_B_k1_proto: 0x%lx\n", (unsigned long) func_B_k1_proto);
//CHECK: func_B_k1_proto: 0x{{[1-9a-f][0-9a-f]*$}}
func_B_k1_proto->print(cling::outs());
//CHECK-NEXT: void B_k(int v) {
//CHECK-NEXT: template<> void B_k<int>(int v) {
//CHECK-NEXT: int x = v;
//CHECK-NEXT: }
@ -867,14 +867,14 @@ const clang::FunctionDecl* func_B_k2_proto = lookup.findFunctionProto(class_A, "
printf("func_B_k2_args: 0x%lx\n", (unsigned long) func_B_k2_args);
//CHECK: func_B_k2_args: 0x{{[1-9a-f][0-9a-f]*$}}
func_B_k2_args->print(cling::outs());
//CHECK-NEXT: void B_k(double v) {
//CHECK-NEXT: template<> void B_k<double>(double v) {
//CHECK-NEXT: double x = v;
//CHECK-NEXT: }
printf("func_B_k2_proto: 0x%lx\n", (unsigned long) func_B_k2_proto);
//CHECK: func_B_k2_proto: 0x{{[1-9a-f][0-9a-f]*$}}
func_B_k2_proto->print(cling::outs());
//CHECK-NEXT: void B_k(double v) {
//CHECK-NEXT: template<> void B_k<double>(double v) {
//CHECK-NEXT: double x = v;
//CHECK-NEXT: }
@ -1057,7 +1057,7 @@ const clang::FunctionDecl* func_B_ctr4_proto = lookup.findFunctionProto(class_B,
dumpDecl("func_B_ctr4_args", func_B_ctr4_args);
//CHECK: func_B_ctr4_args: 0x{{[1-9a-f][0-9a-f]*$}}
//CHECK-NEXT: func_B_ctr4_args name: B::B<char>
//CHECK-NEXT: B(char *v) : m_B_i(0), m_B_d(0.), m_B_ip(0) {
//CHECK-NEXT: template<> B<char>(char *v) : m_B_i(0), m_B_d(0.), m_B_ip(0) {
//CHECK-NEXT: this->m_B_i = (long)(char *)v;
//CHECK-NEXT: this->m_B_d = 1.;
//CHECK-NEXT: }
@ -1065,7 +1065,7 @@ dumpDecl("func_B_ctr4_args", func_B_ctr4_args);
dumpDecl("func_B_ctr4_proto", func_B_ctr4_proto);
//CHECK: func_B_ctr4_proto: 0x{{[1-9a-f][0-9a-f]*$}}
//CHECK-NEXT: func_B_ctr4_proto name: B::B<char>
//CHECK-NEXT: B(char *v) : m_B_i(0), m_B_d(0.), m_B_ip(0) {
//CHECK-NEXT: template<> B<char>(char *v) : m_B_i(0), m_B_d(0.), m_B_ip(0) {
//CHECK-NEXT: this->m_B_i = (long)(char *)v;
//CHECK-NEXT: this->m_B_d = 1.;
//CHECK-NEXT: }
@ -1304,7 +1304,7 @@ const clang::FunctionDecl* func_B_k1_name = lookup.findAnyFunction(class_A, "B_k
printf("func_B_k1_name: 0x%lx\n", (unsigned long) func_B_k1_name);
//CHECK: func_B_k1_name: 0x{{[1-9a-f][0-9a-f]*$}}
func_B_k1_name->print(cling::outs());
//CHECK-NEXT: void B_k(float v) {
//CHECK-NEXT: template<> void B_k<float>(float v) {
//CHECK-NEXT: float x = v;
//CHECK-NEXT: }
@ -1313,7 +1313,7 @@ const clang::FunctionDecl* func_B_k1_name_2 = lookup.findAnyFunction(class_A, "B
printf("func_B_k1_name_2: 0x%lx\n", (unsigned long) func_B_k1_name_2);
//CHECK: func_B_k1_name_2: 0x{{[1-9a-f][0-9a-f]*$}}
func_B_k1_name_2->print(cling::outs());
//CHECK-NEXT: void B_k(int v) {
//CHECK-NEXT: template<> void B_k<int>(int v) {
//CHECK-NEXT: int x = v;
//CHECK-NEXT: }