/// \brief Retrieve a pointer to the external AST source associated
/// with this AST context, if any.
ExternalASTSource *getExternalSource() const {
- return ExternalSource.getPtr();
+ return ExternalSource.get();
}
/// \brief Attach an AST mutation listener to the AST context.
uint64_t getID() const {
/// FIXME: Document the requirements this imposes on matcher
/// implementations (no new() implementation_ during a Matches()).
- return reinterpret_cast<uint64_t>(Implementation.getPtr());
+ return reinterpret_cast<uint64_t>(Implementation.get());
}
/// \brief Allows the conversion of a \c Matcher<Type> to a \c
}
void resetAndLeakFileManager() {
- BuryPointer(FileMgr.getPtr());
+ BuryPointer(FileMgr.get());
FileMgr.resetWithoutRelease();
}
}
void resetAndLeakSourceManager() {
- BuryPointer(SourceMgr.getPtr());
+ BuryPointer(SourceMgr.get());
SourceMgr.resetWithoutRelease();
}
}
void resetAndLeakPreprocessor() {
- BuryPointer(PP.getPtr());
+ BuryPointer(PP.get());
PP.resetWithoutRelease();
}
}
void resetAndLeakASTContext() {
- BuryPointer(Context.getPtr());
+ BuryPointer(Context.get());
Context.resetWithoutRelease();
}
CompilerInvocationBase(const CompilerInvocationBase &X);
- LangOptions *getLangOpts() { return LangOpts.getPtr(); }
- const LangOptions *getLangOpts() const { return LangOpts.getPtr(); }
+ LangOptions *getLangOpts() { return LangOpts.get(); }
+ const LangOptions *getLangOpts() const { return LangOpts.get(); }
- TargetOptions &getTargetOpts() { return *TargetOpts.getPtr(); }
+ TargetOptions &getTargetOpts() { return *TargetOpts.get(); }
const TargetOptions &getTargetOpts() const {
- return *TargetOpts.getPtr();
+ return *TargetOpts.get();
}
DiagnosticOptions &getDiagnosticOpts() const { return *DiagnosticOpts; }
CallEventRef(const CallEventRef &Orig) : IntrusiveRefCntPtr<const T>(Orig) {}
CallEventRef<T> cloneWithState(ProgramStateRef State) const {
- return this->getPtr()->template cloneWithState<T>(State);
+ return this->get()->template cloneWithState<T>(State);
}
// Allow implicit conversions to a superclass type, since CallEventRef
// behaves like a pointer-to-const.
template <typename SuperT>
operator CallEventRef<SuperT> () const {
- return this->getPtr();
+ return this->get();
}
};
static SimpleType
getSimplifiedValue(clang::ento::CallEventRef<T> Val) {
- return Val.getPtr();
+ return Val.get();
}
};
}
const ProgramStateRef &state,
bool IsSink) {
ID.Add(Loc);
- ID.AddPointer(state.getPtr());
+ ID.AddPointer(state.get());
ID.AddBoolean(IsSink);
}
// perform this operation here because we explicitly request that the
// compiler instance *not* free these buffers for each invocation of the
// parser.
- if (Invocation.getPtr() && OwnsRemappedFileBuffers) {
+ if (Invocation.get() && OwnsRemappedFileBuffers) {
PreprocessorOptions &PPOpts = Invocation->getPreprocessorOpts();
for (PreprocessorOptions::remapped_file_buffer_iterator
FB = PPOpts.remapped_file_buffer_begin(),
void ASTUnit::ConfigureDiags(IntrusiveRefCntPtr<DiagnosticsEngine> &Diags,
const char **ArgBegin, const char **ArgEnd,
ASTUnit &AST, bool CaptureDiagnostics) {
- if (!Diags.getPtr()) {
+ if (!Diags.get()) {
// No diagnostics engine was provided, so create our own diagnostics object
// with the default options.
DiagnosticConsumer *Client = nullptr;
ASTUnitCleanup(AST.get());
llvm::CrashRecoveryContextCleanupRegistrar<DiagnosticsEngine,
llvm::CrashRecoveryContextReleaseRefCleanup<DiagnosticsEngine> >
- DiagCleanup(Diags.getPtr());
+ DiagCleanup(Diags.get());
ConfigureDiags(Diags, nullptr, nullptr, *AST, CaptureDiagnostics);
IntrusiveRefCntPtr<CompilerInvocation>
CCInvocation(new CompilerInvocation(*Invocation));
- Clang->setInvocation(CCInvocation.getPtr());
+ Clang->setInvocation(CCInvocation.get());
OriginalSourceFile = Clang->getFrontendOpts().Inputs[0].getFile();
// Set up diagnostics, capturing any diagnostics that would
ASTUnitCleanup(OwnAST.get());
llvm::CrashRecoveryContextCleanupRegistrar<DiagnosticsEngine,
llvm::CrashRecoveryContextReleaseRefCleanup<DiagnosticsEngine> >
- DiagCleanup(Diags.getPtr());
+ DiagCleanup(Diags.get());
// We'll manage file buffers ourselves.
CI->getPreprocessorOpts().RetainRemappedFileBuffers = true;
ASTUnitCleanup(AST.get());
llvm::CrashRecoveryContextCleanupRegistrar<DiagnosticsEngine,
llvm::CrashRecoveryContextReleaseRefCleanup<DiagnosticsEngine> >
- DiagCleanup(Diags.getPtr());
+ DiagCleanup(Diags.get());
if (AST->LoadFromCompilerInvocation(PrecompilePreamble))
return nullptr;
bool AllowPCHWithCompilerErrors, bool SkipFunctionBodies,
bool UserFilesAreVolatile, bool ForSerialization,
std::unique_ptr<ASTUnit> *ErrAST) {
- if (!Diags.getPtr()) {
+ if (!Diags.get()) {
// No diagnostics engine was provided, so create our own diagnostics object
// with the default options.
Diags = CompilerInstance::createDiagnostics(new DiagnosticOptions());
std::unique_ptr<CompilerInstance> Clang(new CompilerInstance());
Clang->setInvocation(CInvok.release());
- Clang->setDiagnostics(Diags.getPtr());
+ Clang->setDiagnostics(Diags.get());
Clang->setTarget(TargetInfo::CreateTargetInfo(Clang->getDiagnostics(),
&Clang->getTargetOpts()));
Clang->createFileManager();
AllowPCHWithCompilerErrors, getPreprocessor(), getASTContext(),
DeserializationListener, OwnDeserializationListener, Preamble,
getFrontendOpts().UseGlobalModuleIndex);
- ModuleManager = static_cast<ASTReader*>(Source.getPtr());
+ ModuleManager = static_cast<ASTReader*>(Source.get());
getASTContext().setExternalSource(Source);
}
IntrusiveRefCntPtr<vfs::FileSystem> FS =
vfs::getVFSFromYAML(Buffer.release(), /*DiagHandler*/nullptr);
- if (!FS.getPtr()) {
+ if (!FS.get()) {
Diags.Report(diag::err_invalid_vfs_overlay) << File;
return IntrusiveRefCntPtr<vfs::FileSystem>();
}
CompilerInvocation *
clang::createInvocationFromCommandLine(ArrayRef<const char *> ArgList,
IntrusiveRefCntPtr<DiagnosticsEngine> Diags) {
- if (!Diags.getPtr()) {
+ if (!Diags.get()) {
// No diagnostics engine was provided, so create our own diagnostics object
// with the default options.
Diags = CompilerInstance::createDiagnostics(new DiagnosticOptions);
std::string FixItInsertionLine = buildFixItInsertionLine(LineNo,
sourceColMap,
Hints, SM,
- DiagOpts.getPtr());
+ DiagOpts.get());
// If the source line is too long for our terminal, select only the
// "interesting" source region within that line.
SimpleFormatContext(LangOptions Options)
: DiagOpts(new DiagnosticOptions()),
Diagnostics(new DiagnosticsEngine(new DiagnosticIDs,
- DiagOpts.getPtr())),
+ DiagOpts.get())),
Files((FileSystemOptions())),
Sources(*Diagnostics, Files),
Rewrite(Sources, Options) {
DiagnosticsEngine &ExistingDiags = PP.getDiagnostics();
IntrusiveRefCntPtr<DiagnosticIDs> DiagIDs(ExistingDiags.getDiagnosticIDs());
IntrusiveRefCntPtr<DiagnosticsEngine> Diags(
- new DiagnosticsEngine(DiagIDs, DiagOpts.getPtr()));
+ new DiagnosticsEngine(DiagIDs, DiagOpts.get()));
// This should never fail, because we would have processed these options
// before writing them to an ASTFile.
ProcessWarningOptions(*Diags, *DiagOpts, /*Report*/false);
os << "Array access";
const ArraySubscriptExpr *AE = cast<ArraySubscriptExpr>(S);
AddDerefSource(os, Ranges, AE->getBase()->IgnoreParenCasts(),
- State.getPtr(), N->getLocationContext());
+ State.get(), N->getLocationContext());
os << " results in a null pointer dereference";
break;
}
os << "Dereference of null pointer";
const UnaryOperator *U = cast<UnaryOperator>(S);
AddDerefSource(os, Ranges, U->getSubExpr()->IgnoreParens(),
- State.getPtr(), N->getLocationContext(), true);
+ State.get(), N->getLocationContext(), true);
break;
}
case Stmt::MemberExprClass: {
os << "Access to field '" << M->getMemberNameInfo()
<< "' results in a dereference of a null pointer";
AddDerefSource(os, Ranges, M->getBase()->IgnoreParenCasts(),
- State.getPtr(), N->getLocationContext(), true);
+ State.get(), N->getLocationContext(), true);
}
break;
}
os << "Access to instance variable '" << *IV->getDecl()
<< "' results in a dereference of a null pointer";
AddDerefSource(os, Ranges, IV->getBase()->IgnoreParenCasts(),
- State.getPtr(), N->getLocationContext(), true);
+ State.get(), N->getLocationContext(), true);
break;
}
default:
break;
if (PathDiagnosticEventPiece *nextEvent =
- dyn_cast<PathDiagnosticEventPiece>(path.front().getPtr())) {
+ dyn_cast<PathDiagnosticEventPiece>(path.front().get())) {
PathDiagnosticEventPiece *event =
cast<PathDiagnosticEventPiece>(piece);
// Check to see if we should keep one of the two pieces. If we
if (Optional<PostStmt> PS = P.getAs<PostStmt>()) {
if (const Expr *Ex = PS->getStmtAs<Expr>())
reversePropagateIntererstingSymbols(*PDB.getBugReport(), IE,
- N->getState().getPtr(), Ex,
+ N->getState().get(), Ex,
N->getLocationContext());
}
const Stmt *S = CE->getCalleeContext()->getCallSite();
if (const Expr *Ex = dyn_cast_or_null<Expr>(S)) {
reversePropagateIntererstingSymbols(*PDB.getBugReport(), IE,
- N->getState().getPtr(), Ex,
+ N->getState().get(), Ex,
N->getLocationContext());
}
const LocationContext *CalleeCtx = PDB.LC;
if (CallerCtx != CalleeCtx) {
reversePropagateInterestingSymbols(*PDB.getBugReport(), IE,
- N->getState().getPtr(),
+ N->getState().get(),
CalleeCtx, CallerCtx);
}
}
PathDiagnosticCallPiece *C;
if (VisitedEntireCall) {
- PathDiagnosticPiece *P = PD.getActivePath().front().getPtr();
+ PathDiagnosticPiece *P = PD.getActivePath().front().get();
C = cast<PathDiagnosticCallPiece>(P);
} else {
const Decl *Caller = CE->getLocationContext()->getDecl();
// Propagate the interesting symbols accordingly.
if (const Expr *Ex = dyn_cast_or_null<Expr>(S)) {
reversePropagateIntererstingSymbols(*PDB.getBugReport(), IE,
- N->getState().getPtr(), Ex,
+ N->getState().get(), Ex,
N->getLocationContext());
}
// interesting symbols correctly.
if (const Expr *Ex = PS->getStmtAs<Expr>())
reversePropagateIntererstingSymbols(*PDB.getBugReport(), IE,
- N->getState().getPtr(), Ex,
+ N->getState().get(), Ex,
N->getLocationContext());
// Add an edge. If this is an ObjCForCollectionStmt do
const LocationContext *CalleeCtx = PDB.LC;
if (CallerCtx != CalleeCtx) {
reversePropagateInterestingSymbols(*PDB.getBugReport(), IE,
- N->getState().getPtr(),
+ N->getState().get(),
CalleeCtx, CallerCtx);
}
}
for (PathPieces::const_iterator I = path.begin(), E = path.end();
I!=E; ++I) {
- PathDiagnosticPiece *piece = I->getPtr();
+ PathDiagnosticPiece *piece = I->get();
// Recursively compact calls.
if (PathDiagnosticCallPiece *call=dyn_cast<PathDiagnosticCallPiece>(piece)){
if (quotes) {
Out << '\'';
const LocationContext *LCtx = N->getLocationContext();
- const ProgramState *state = N->getState().getPtr();
+ const ProgramState *state = N->getState().get();
if (const MemRegion *R = state->getLValue(cast<VarDecl>(DR->getDecl()),
LCtx).getAsRegion()) {
if (report.isInteresting(R))
prunable = false;
else {
- const ProgramState *state = N->getState().getPtr();
+ const ProgramState *state = N->getState().get();
SVal V = state->getSVal(R);
if (report.isInteresting(V))
prunable = false;
if (const DeclRefExpr *DR = dyn_cast<DeclRefExpr>(CondVarExpr)) {
if (const VarDecl *VD = dyn_cast<VarDecl>(DR->getDecl())) {
- const ProgramState *state = N->getState().getPtr();
+ const ProgramState *state = N->getState().get();
if (const MemRegion *R = state->getLValue(VD, LCtx).getAsRegion()) {
if (report.isInteresting(R))
event->setPrunable(false);
PathDiagnosticEventPiece *event =
new PathDiagnosticEventPiece(Loc, Out.str());
- const ProgramState *state = N->getState().getPtr();
+ const ProgramState *state = N->getState().get();
if (const MemRegion *R = state->getLValue(VD, LCtx).getAsRegion()) {
if (report.isInteresting(R))
event->setPrunable(false);
}
ProgramStateRef state = N->getState();
- Out << "\\|StateID: " << (const void*) state.getPtr()
+ Out << "\\|StateID: " << (const void*) state.get()
<< " NodeID: " << (const void*) N << "\\|";
state->printDOT(Out);
void PathPieces::flattenTo(PathPieces &Primary, PathPieces &Current,
bool ShouldFlattenMacros) const {
for (PathPieces::const_iterator I = begin(), E = end(); I != E; ++I) {
- PathDiagnosticPiece *Piece = I->getPtr();
+ PathDiagnosticPiece *Piece = I->get();
switch (Piece->getKind()) {
case PathDiagnosticPiece::Call: {
if (path.empty())
return;
- PathDiagnosticPiece *LastP = path.back().getPtr();
+ PathDiagnosticPiece *LastP = path.back().get();
assert(LastP);
const SourceManager &SMgr = LastP->getLocation().getManager();
for (PathPieces::const_iterator I = path.begin(), E = path.end(); I != E;
++I) {
- const PathDiagnosticPiece *piece = I->getPtr();
+ const PathDiagnosticPiece *piece = I->get();
FullSourceLoc L = piece->getLocation().asLocation().getExpansionLoc();
if (FID.isInvalid()) {
static void compute_path_size(const PathPieces &pieces, unsigned &size) {
for (PathPieces::const_iterator it = pieces.begin(),
et = pieces.end(); it != et; ++it) {
- const PathDiagnosticPiece *piece = it->getPtr();
+ const PathDiagnosticPiece *piece = it->get();
if (const PathDiagnosticCallPiece *cp =
dyn_cast<PathDiagnosticCallPiece>(piece)) {
compute_path_size(cp->path, size);
for (PathPieces::const_iterator I = path.begin(), E = path.end(); I != E;
++I) {
- const PathDiagnosticPiece *piece = I->getPtr();
+ const PathDiagnosticPiece *piece = I->get();
AddFID(FM, Fids, *SM, piece->getLocation().asLocation());
ArrayRef<SourceRange> Ranges = piece->getRanges();
for (ArrayRef<SourceRange>::iterator I = Ranges.begin(),
default:
#define ANALYSIS_DIAGNOSTICS(NAME, CMDFLAG, DESC, CREATEFN) \
case PD_##NAME: \
- CREATEFN(*Opts.getPtr(), PathConsumers, OutDir, PP); \
+ CREATEFN(*Opts.get(), PathConsumers, OutDir, PP); \
break;
#include "clang/StaticAnalyzer/Core/Analyses.def"
}
llvm::IntrusiveRefCntPtr<FileManager> Files(
new FileManager(FileSystemOptions()));
ToolInvocation Invocation(getSyntaxOnlyToolArgs(Args, FileNameRef), ToolAction,
- Files.getPtr());
+ Files.get());
SmallString<1024> CodeStorage;
Invocation.mapVirtualFile(FileNameRef,
DEBUG({
llvm::dbgs() << "Processing: " << Command.first << ".\n";
});
- ToolInvocation Invocation(std::move(CommandLine), Action, Files.getPtr());
+ ToolInvocation Invocation(std::move(CommandLine), Action, Files.get());
Invocation.setDiagnosticConsumer(DiagConsumer);
for (const auto &MappedFile : MappedFileContents) {
Invocation.mapVirtualFile(MappedFile.first, MappedFile.second);
// Recover resources if we crash before exiting this function.
llvm::CrashRecoveryContextCleanupRegistrar<DiagnosticsEngine,
llvm::CrashRecoveryContextReleaseRefCleanup<DiagnosticsEngine> >
- DiagCleanup(Diags.getPtr());
+ DiagCleanup(Diags.get());
std::unique_ptr<std::vector<ASTUnit::RemappedFile>> RemappedFiles(
new std::vector<ASTUnit::RemappedFile>());
// How much memory is used for caching global code completion results?
unsigned long completionBytes = 0;
if (GlobalCodeCompletionAllocator *completionAllocator =
- astUnit->getCachedCompletionAllocator().getPtr()) {
+ astUnit->getCachedCompletionAllocator().get()) {
completionBytes = completionAllocator->getTotalMemory();
}
createCXTUResourceUsageEntry(*entries,
// Recover resources if we crash before exiting this function.
llvm::CrashRecoveryContextCleanupRegistrar<DiagnosticsEngine,
llvm::CrashRecoveryContextReleaseRefCleanup<DiagnosticsEngine> >
- DiagCleanup(Diags.getPtr());
+ DiagCleanup(Diags.get());
std::unique_ptr<std::vector<const char *>> Args(
new std::vector<const char *>());
// Recover resources if we crash before exiting this function.
llvm::CrashRecoveryContextCleanupRegistrar<CompilerInvocation,
llvm::CrashRecoveryContextReleaseRefCleanup<CompilerInvocation> >
- CInvokCleanup(CInvok.getPtr());
+ CInvokCleanup(CInvok.get());
if (CInvok->getFrontendOpts().Inputs.empty())
return;
if (index_options & CXIndexOpt_SuppressWarnings)
CInvok->getDiagnosticOpts().IgnoreWarnings = true;
- ASTUnit *Unit = ASTUnit::create(CInvok.getPtr(), Diags,
+ ASTUnit *Unit = ASTUnit::create(CInvok.get(), Diags,
CaptureDiagnostics,
/*UserFilesAreVolatile=*/true);
if (!Unit) {
PPOpts.DetailedRecord = false;
DiagnosticErrorTrap DiagTrap(*Diags);
- bool Success = ASTUnit::LoadFromCompilerInvocationAction(CInvok.getPtr(), Diags,
+ bool Success = ASTUnit::LoadFromCompilerInvocationAction(CInvok.get(), Diags,
IndexAction.get(),
Unit,
Persistent,
TEST_F(VFSFromYAMLTest, BasicVFSFromYAML) {
IntrusiveRefCntPtr<vfs::FileSystem> FS;
FS = getFromYAMLString("");
- EXPECT_EQ(nullptr, FS.getPtr());
+ EXPECT_EQ(nullptr, FS.get());
FS = getFromYAMLString("[]");
- EXPECT_EQ(nullptr, FS.getPtr());
+ EXPECT_EQ(nullptr, FS.get());
FS = getFromYAMLString("'string'");
- EXPECT_EQ(nullptr, FS.getPtr());
+ EXPECT_EQ(nullptr, FS.get());
EXPECT_EQ(3, NumDiagnostics);
}
"]\n"
"}",
Lower);
- ASSERT_TRUE(FS.getPtr() != nullptr);
+ ASSERT_TRUE(FS.get() != nullptr);
IntrusiveRefCntPtr<vfs::OverlayFileSystem> O(
new vfs::OverlayFileSystem(Lower));
" ]\n"
"}]}",
Lower);
- ASSERT_TRUE(FS.getPtr() != nullptr);
+ ASSERT_TRUE(FS.get() != nullptr);
IntrusiveRefCntPtr<vfs::OverlayFileSystem> O(
new vfs::OverlayFileSystem(Lower));
" ]\n"
"}]}",
Lower);
- ASSERT_TRUE(FS.getPtr() != nullptr);
+ ASSERT_TRUE(FS.get() != nullptr);
IntrusiveRefCntPtr<vfs::OverlayFileSystem> O(
new vfs::OverlayFileSystem(Lower));
// invalid YAML at top-level
IntrusiveRefCntPtr<vfs::FileSystem> FS = getFromYAMLString("{]", Lower);
- EXPECT_EQ(nullptr, FS.getPtr());
+ EXPECT_EQ(nullptr, FS.get());
// invalid YAML in roots
FS = getFromYAMLString("{ 'roots':[}", Lower);
// invalid YAML in directory
FS = getFromYAMLString(
"{ 'roots':[ { 'name': 'foo', 'type': 'directory', 'contents': [}",
Lower);
- EXPECT_EQ(nullptr, FS.getPtr());
+ EXPECT_EQ(nullptr, FS.get());
// invalid configuration
FS = getFromYAMLString("{ 'knobular': 'true', 'roots':[] }", Lower);
- EXPECT_EQ(nullptr, FS.getPtr());
+ EXPECT_EQ(nullptr, FS.get());
FS = getFromYAMLString("{ 'case-sensitive': 'maybe', 'roots':[] }", Lower);
- EXPECT_EQ(nullptr, FS.getPtr());
+ EXPECT_EQ(nullptr, FS.get());
// invalid roots
FS = getFromYAMLString("{ 'roots':'' }", Lower);
- EXPECT_EQ(nullptr, FS.getPtr());
+ EXPECT_EQ(nullptr, FS.get());
FS = getFromYAMLString("{ 'roots':{} }", Lower);
- EXPECT_EQ(nullptr, FS.getPtr());
+ EXPECT_EQ(nullptr, FS.get());
// invalid entries
FS = getFromYAMLString(
"{ 'roots':[ { 'type': 'other', 'name': 'me', 'contents': '' }", Lower);
- EXPECT_EQ(nullptr, FS.getPtr());
+ EXPECT_EQ(nullptr, FS.get());
FS = getFromYAMLString("{ 'roots':[ { 'type': 'file', 'name': [], "
"'external-contents': 'other' }",
Lower);
- EXPECT_EQ(nullptr, FS.getPtr());
+ EXPECT_EQ(nullptr, FS.get());
FS = getFromYAMLString(
"{ 'roots':[ { 'type': 'file', 'name': 'me', 'external-contents': [] }",
Lower);
- EXPECT_EQ(nullptr, FS.getPtr());
+ EXPECT_EQ(nullptr, FS.get());
FS = getFromYAMLString(
"{ 'roots':[ { 'type': 'file', 'name': 'me', 'external-contents': {} }",
Lower);
- EXPECT_EQ(nullptr, FS.getPtr());
+ EXPECT_EQ(nullptr, FS.get());
FS = getFromYAMLString(
"{ 'roots':[ { 'type': 'directory', 'name': 'me', 'contents': {} }",
Lower);
- EXPECT_EQ(nullptr, FS.getPtr());
+ EXPECT_EQ(nullptr, FS.get());
FS = getFromYAMLString(
"{ 'roots':[ { 'type': 'directory', 'name': 'me', 'contents': '' }",
Lower);
- EXPECT_EQ(nullptr, FS.getPtr());
+ EXPECT_EQ(nullptr, FS.get());
FS = getFromYAMLString(
"{ 'roots':[ { 'thingy': 'directory', 'name': 'me', 'contents': [] }",
Lower);
- EXPECT_EQ(nullptr, FS.getPtr());
+ EXPECT_EQ(nullptr, FS.get());
// missing mandatory fields
FS = getFromYAMLString("{ 'roots':[ { 'type': 'file', 'name': 'me' }", Lower);
- EXPECT_EQ(nullptr, FS.getPtr());
+ EXPECT_EQ(nullptr, FS.get());
FS = getFromYAMLString(
"{ 'roots':[ { 'type': 'file', 'external-contents': 'other' }", Lower);
- EXPECT_EQ(nullptr, FS.getPtr());
+ EXPECT_EQ(nullptr, FS.get());
FS = getFromYAMLString("{ 'roots':[ { 'name': 'me', 'contents': [] }", Lower);
- EXPECT_EQ(nullptr, FS.getPtr());
+ EXPECT_EQ(nullptr, FS.get());
// duplicate keys
FS = getFromYAMLString("{ 'roots':[], 'roots':[] }", Lower);
- EXPECT_EQ(nullptr, FS.getPtr());
+ EXPECT_EQ(nullptr, FS.get());
FS = getFromYAMLString(
"{ 'case-sensitive':'true', 'case-sensitive':'true', 'roots':[] }",
Lower);
- EXPECT_EQ(nullptr, FS.getPtr());
+ EXPECT_EQ(nullptr, FS.get());
FS =
getFromYAMLString("{ 'roots':[{'name':'me', 'name':'you', 'type':'file', "
"'external-contents':'blah' } ] }",
Lower);
- EXPECT_EQ(nullptr, FS.getPtr());
+ EXPECT_EQ(nullptr, FS.get());
// missing version
FS = getFromYAMLRawString("{ 'roots':[] }", Lower);
- EXPECT_EQ(nullptr, FS.getPtr());
+ EXPECT_EQ(nullptr, FS.get());
// bad version number
FS = getFromYAMLRawString("{ 'version':'foo', 'roots':[] }", Lower);
- EXPECT_EQ(nullptr, FS.getPtr());
+ EXPECT_EQ(nullptr, FS.get());
FS = getFromYAMLRawString("{ 'version':-1, 'roots':[] }", Lower);
- EXPECT_EQ(nullptr, FS.getPtr());
+ EXPECT_EQ(nullptr, FS.get());
FS = getFromYAMLRawString("{ 'version':100000, 'roots':[] }", Lower);
- EXPECT_EQ(nullptr, FS.getPtr());
+ EXPECT_EQ(nullptr, FS.get());
EXPECT_EQ(24, NumDiagnostics);
}
" 'external-contents': '//root/external/file'\n"
" }\n"
"] }", Lower);
- ASSERT_TRUE(nullptr != FS.getPtr());
+ ASSERT_TRUE(nullptr != FS.get());
// default true
EXPECT_EQ("//root/external/file", FS->status("//root/A")->getName());
" 'external-contents': '//root/external/file'\n"
" }\n"
"] }", Lower);
- ASSERT_TRUE(nullptr != FS.getPtr());
+ ASSERT_TRUE(nullptr != FS.get());
// default
EXPECT_EQ("//root/A", FS->status("//root/A")->getName());
" { 'type': 'file', 'name': '//root/path/to/file',\n"
" 'external-contents': '//root/other' }]\n"
"}", Lower);
- ASSERT_TRUE(nullptr != FS.getPtr());
+ ASSERT_TRUE(nullptr != FS.get());
EXPECT_FALSE(FS->status("//root/path/to/file").getError());
EXPECT_FALSE(FS->status("//root/path/to").getError());
EXPECT_FALSE(FS->status("//root/path").getError());
" 'contents': [ { 'type': 'file', 'name': 'file',\n"
" 'external-contents': '//root/other' }]}]\n"
"}", Lower);
- ASSERT_TRUE(nullptr != FS.getPtr());
+ ASSERT_TRUE(nullptr != FS.get());
EXPECT_FALSE(FS->status("//root/path/to/file").getError());
EXPECT_FALSE(FS->status("//root/path/to").getError());
EXPECT_FALSE(FS->status("//root/path").getError());
" 'contents': [ { 'type': 'file', 'name': 'path/to/file',\n"
" 'external-contents': '//root/other' }]}]\n"
"}", Lower);
- ASSERT_TRUE(nullptr != FS.getPtr());
+ ASSERT_TRUE(nullptr != FS.get());
EXPECT_FALSE(FS->status("//root/path/to/file").getError());
EXPECT_FALSE(FS->status("//root/path/to").getError());
EXPECT_FALSE(FS->status("//root/path").getError());
" 'contents': [ { 'type': 'file', 'name': 'file',\n"
" 'external-contents': '//root/other' }]}]\n"
"}", Lower);
- ASSERT_TRUE(nullptr != FS.getPtr());
+ ASSERT_TRUE(nullptr != FS.get());
EXPECT_FALSE(FS->status("//root/path/to/file").getError());
EXPECT_FALSE(FS->status("//root/path/to").getError());
EXPECT_FALSE(FS->status("//root/path").getError());
"]\n"
"}",
Lower);
- ASSERT_TRUE(FS.getPtr() != NULL);
+ ASSERT_TRUE(FS.get() != NULL);
IntrusiveRefCntPtr<vfs::OverlayFileSystem> O(
new vfs::OverlayFileSystem(Lower));
VoidModuleLoader ModLoader;
HeaderSearch HeaderInfo(new HeaderSearchOptions, SourceMgr, Diags, LangOpts,
- Target.getPtr());
+ Target.get());
Preprocessor PP(new PreprocessorOptions(), Diags, LangOpts, SourceMgr,
HeaderInfo, ModLoader, /*IILookup =*/nullptr,
/*OwnsHeaderSearch =*/false);
: FileMgr(FileMgrOpts),
DiagID(new DiagnosticIDs()),
DiagOpts(new DiagnosticOptions()),
- Diags(DiagID, DiagOpts.getPtr(), new IgnoringDiagConsumer()),
+ Diags(DiagID, DiagOpts.get(), new IgnoringDiagConsumer()),
SourceMgr(Diags, FileMgr) {
TargetOpts = new TargetOptions();
TargetOpts->Triple = "x86_64-apple-darwin11.1.0";
IntrusiveRefCntPtr<HeaderSearchOptions> HSOpts = new HeaderSearchOptions();
HeaderSearch HeaderInfo(HSOpts, SourceMgr, Diags, LangOpts,
- Target.getPtr());
+ Target.get());
AddFakeHeader(HeaderInfo, HeaderPath, SystemHeader);
IntrusiveRefCntPtr<PreprocessorOptions> PPOpts = new PreprocessorOptions();
VoidModuleLoader ModLoader;
HeaderSearch HeaderInfo(new HeaderSearchOptions, SourceMgr, Diags,
- OpenCLLangOpts, Target.getPtr());
+ OpenCLLangOpts, Target.get());
Preprocessor PP(new PreprocessorOptions(), Diags, OpenCLLangOpts, SourceMgr,
HeaderInfo, ModLoader, /*IILookup =*/nullptr,
VoidModuleLoader ModLoader;
HeaderSearch HeaderInfo(new HeaderSearchOptions, SourceMgr, Diags, LangOpts,
- Target.getPtr());
+ Target.get());
Preprocessor PP(new PreprocessorOptions(), Diags, LangOpts, SourceMgr,
HeaderInfo, ModLoader,
/*IILookup =*/nullptr,
Args.push_back("-fsyntax-only");
Args.push_back("test.cpp");
clang::tooling::ToolInvocation Invocation(Args, new SyntaxOnlyAction,
- Files.getPtr());
+ Files.get());
Invocation.mapVirtualFile("test.cpp", "#include <abc>\n");
Invocation.mapVirtualFile("def/abc", "\n");
EXPECT_TRUE(Invocation.run());
Args.push_back("-fsyntax-only");
Args.push_back("test.cpp");
clang::tooling::ToolInvocation Invocation(Args, new SyntaxOnlyAction,
- Files.getPtr());
+ Files.get());
Invocation.mapVirtualFile("test.cpp", "#include <abc>\n");
Invocation.mapVirtualFile("def/abc", "\n");
// Add a module.map file in the include directory of our header, so we trigger