// struct __Block_byref_1_X *__forwarding;
// unsigned int __flags;
// unsigned int __size;
- // void *__copy_helper; // as needed
- // void *__destroy_help // as needed
+ // void *__copy_helper; // as needed
+ // void *__destroy_help // as needed
// int X;
// } *
case CPointerTy:
return argTy->getAs<PointerType>() != NULL ||
- argTy->getAs<ObjCObjectPointerType>() != NULL;
+ argTy->getAs<ObjCObjectPointerType>() != NULL;
case ObjCPointerTy:
return argTy->getAs<ObjCObjectPointerType>() != NULL;
SizeType = UnsignedLong;
IntPtrType = SignedLong;
PtrDiffType = SignedLong;
- }
+ }
virtual void getTargetDefines(const LangOptions &Opts,
MacroBuilder &Builder) const {
X86_32TargetInfo::getTargetDefines(Opts, Builder);
public:
WalkAST(BugReporter &br) : BR(br),
- II_gets(0), II_getpw(0), II_mktemp(0),
- II_rand(), II_random(0), II_setid(),
+ II_gets(0), II_getpw(0), II_mktemp(0),
+ II_rand(), II_random(0), II_setid(),
CheckRand(isArc4RandomAvailable(BR.getContext())) {}
// Statement visitor methods.
// Issue a waring.
SourceRange R = CE->getCallee()->getSourceRange();
BR.EmitBasicReport("Potential insecure temporary file in call 'mktemp'",
- "Security",
- "Call to function 'mktemp' is insecure as it always "
- "creates or uses insecure temporary file. Use 'mkstemp' instead",
- CE->getLocStart(), &R, 1);
+ "Security",
+ "Call to function 'mktemp' is insecure as it always "
+ "creates or uses insecure temporary file. Use 'mkstemp' instead",
+ CE->getLocStart(), &R, 1);
}
//===----------------------------------------------------------------------===//
ExplodedNodeSet Tmp;
if (asLValue)
- VisitLValue(Ex, Pred, Tmp);
+ VisitLValue(Ex, Pred, Tmp);
else
- Visit(Ex, Pred, Tmp);
+ Visit(Ex, Pred, Tmp);
for (ExplodedNodeSet::iterator I=Tmp.begin(), E=Tmp.end(); I!=E; ++I) {
const GRState* state = GetState(*I);
report->addRange(range);
C.EmitReport(report);
-}
+}
void StackAddrLeakChecker::PreVisitReturnStmt(CheckerContext &C,
const ReturnStmt *RS) {
}
const GRState *StreamChecker::CheckDoubleClose(const CallExpr *CE,
- const GRState *state,
- CheckerContext &C) {
+ const GRState *state,
+ CheckerContext &C) {
SymbolRef Sym = state->getSVal(CE->getArg(0)).getAsSymbol();
assert(Sym);
ExplodedNode *N = C.GenerateSink();
if (N) {
if (!BT_doubleclose)
- BT_doubleclose = new BuiltinBug("Double fclose",
- "Try to close a file Descriptor already"
- " closed. Cause undefined behaviour.");
+ BT_doubleclose = new BuiltinBug("Double fclose",
+ "Try to close a file Descriptor already"
+ " closed. Cause undefined behaviour.");
BugReport *R = new BugReport(*BT_doubleclose,
- BT_doubleclose->getDescription(), N);
+ BT_doubleclose->getDescription(), N);
C.EmitReport(R);
}
return NULL;
void StreamChecker::EvalDeadSymbols(CheckerContext &C,SymbolReaper &SymReaper) {
for (SymbolReaper::dead_iterator I = SymReaper.dead_begin(),
- E = SymReaper.dead_end(); I != E; ++I) {
+ E = SymReaper.dead_end(); I != E; ++I) {
SymbolRef Sym = *I;
const GRState *state = C.getState();
const StreamState *SS = state->get<StreamState>(Sym);
if (SS->isOpened()) {
ExplodedNode *N = C.GenerateSink();
if (N) {
- if (!BT_ResourceLeak)
- BT_ResourceLeak = new BuiltinBug("Resource Leak",
- "Opened File never closed. Potential Resource leak.");
- BugReport *R = new BugReport(*BT_ResourceLeak,
- BT_ResourceLeak->getDescription(), N);
- C.EmitReport(R);
+ if (!BT_ResourceLeak)
+ BT_ResourceLeak = new BuiltinBug("Resource Leak",
+ "Opened File never closed. Potential Resource leak.");
+ BugReport *R = new BugReport(*BT_ResourceLeak,
+ BT_ResourceLeak->getDescription(), N);
+ C.EmitReport(R);
}
}
}
}
void StreamChecker::EvalEndPath(GREndPathNodeBuilder &B, void *tag,
- GRExprEngine &Eng) {
+ GRExprEngine &Eng) {
SaveAndRestore<bool> OldHasGen(B.HasGeneratedNode);
const GRState *state = B.getState();
typedef llvm::ImmutableMap<SymbolRef, StreamState> SymMap;
if (N) {
if (!BT_ResourceLeak)
BT_ResourceLeak = new BuiltinBug("Resource Leak",
- "Opened File never closed. Potential Resource leak.");
+ "Opened File never closed. Potential Resource leak.");
BugReport *R = new BugReport(*BT_ResourceLeak,
- BT_ResourceLeak->getDescription(), N);
+ BT_ResourceLeak->getDescription(), N);
Eng.getBugReporter().EmitReport(R);
}
}
}
llvm::DIType CGDebugInfo::CreateType(const VectorType *Ty,
- llvm::DIFile Unit) {
+ llvm::DIFile Unit) {
llvm::DIType ElementTy = getOrCreateType(Ty->getElementType(), Unit);
uint64_t NumElems = Ty->getNumElements();
if (NumElems > 0)
DebugFactory.CreateCompositeType(llvm::dwarf::DW_TAG_vector_type,
Unit, "", Unit,
0, Size, Align, 0, 0,
- ElementTy, SubscriptArray);
+ ElementTy, SubscriptArray);
}
llvm::DIType CGDebugInfo::CreateType(const ArrayType *Ty,
getContextDescriptor(dyn_cast<Decl>(NSDecl->getDeclContext()), Unit);
llvm::DINameSpace NS =
DebugFactory.CreateNameSpace(Context, NSDecl->getName(),
- llvm::DIFile(Unit), LineNo);
+ llvm::DIFile(Unit), LineNo);
NameSpaceCache[NSDecl] = llvm::WeakVH(NS);
return NS;
}
case Expr::DeclRefExprClass: {
ValueDecl *Decl = cast<DeclRefExpr>(E)->getDecl();
if (Decl->hasAttr<WeakRefAttr>())
- return CGM.GetWeakRefReference(Decl);
+ return CGM.GetWeakRefReference(Decl);
if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(Decl))
return CGM.GetAddrOfFunction(FD);
if (const VarDecl* VD = dyn_cast<VarDecl>(Decl)) {
// direct proper base. Each description is of the type:
//
// struct abi::__base_class_type_info {
- // public:
+ // public:
// const __class_type_info *__base_type;
// long __offset_flags;
//
case '=': // Will see this and the following in mult-alt constraints.
case '+':
break;
- case ',': // FIXME - Until the back-end properly supports
- return Result; // multiple alternative constraints, we stop here.
+ case ',': // FIXME - Until the back-end properly supports
+ return Result; // multiple alternative constraints, we stop here.
break;
case 'g':
Result += "imr";
mangleType(Proto->getResultType());
if (Proto->getNumArgs() == 0 && !Proto->isVariadic()) {
- // <builtin-type> ::= v # void
+ // <builtin-type> ::= v # void
Out << 'v';
return;
}
// <expression> ::= <unary operator-name> <expression>
// ::= <binary operator-name> <expression> <expression>
// ::= <trinary operator-name> <expression> <expression> <expression>
- // ::= cl <expression>* E # call
+ // ::= cl <expression>* E # call
// ::= cv <type> expression # conversion with one argument
// ::= cv <type> _ <expression>* E # conversion with a different number of arguments
- // ::= st <type> # sizeof (a type)
+ // ::= st <type> # sizeof (a type)
// ::= at <type> # alignof (a type)
// ::= <template-param>
// ::= <function-param>
AddPath("/boot/develop/headers/glibc", System, true, false, false);
AddPath("/boot/develop/headers/posix", System, true, false, false);
AddPath("/boot/develop/headers", System, true, false, false);
- break;
+ break;
case llvm::Triple::MinGW64:
case llvm::Triple::MinGW32:
AddPath("c:/mingw/include", System, true, false, false);
// Macros must be identical. This means all tokens and whitespace
// separation must be the same. C99 6.10.3.2.
if (!OtherMI->isAllowRedefinitionsWithoutWarning() &&
- !MI->isIdenticalTo(*OtherMI, *this)) {
+ !MI->isIdenticalTo(*OtherMI, *this)) {
Diag(MI->getDefinitionLoc(), diag::ext_pp_macro_redef)
<< MacroNameTok.getIdentifierInfo();
Diag(OtherMI->getDefinitionLoc(), diag::note_previous_definition);
CallsUndergoingInstantiation.back()->getCallee());
CXXMethodDecl *DepMethod = cast_or_null<CXXMethodDecl>(
CurMethod->getInstantiatedFromMemberFunction());
- if (DepMethod) {
+ if (DepMethod) {
Diag(R.getNameLoc(), diagnostic) << Name
<< FixItHint::CreateInsertion(R.getNameLoc(), "this->");
QualType DepThisType = DepMethod->getThisType(Context);
ULE->getQualifier(), ULE->getQualifierRange(), NULL,
R.getLookupNameInfo(), &TList);
CallsUndergoingInstantiation.back()->setCallee(DepExpr);
- } else {
+ } else {
// FIXME: we should be able to handle this case too. It is correct
// to add this-> here. This is a workaround for PR7947.
Diag(R.getNameLoc(), diagnostic) << Name;
- }
+ }
} else {
Diag(R.getNameLoc(), diagnostic) << Name;
}
// The string can be empty if the declaration has no name; e.g., it is
// the ParmDecl with no name for declaration of a function pointer type, e.g.:
- // void (*f)(void *);
+ // void (*f)(void *);
// In this case, don't generate a USR.
if (s.empty())
IgnoreResults = true;