Thanks for the the hints. I really appreciate them.
I have added ArrayRef ctor from "None" and replaced most ArrayRef<T>()
calls with "None". Attached are two patches, one for llvm and one for
clang. I had to change two unrelated enums because of scope.
Please review.
Thanks,
Robert
On Tue, 2013-04-30 at 10:55 -0700, David Blaikie wrote:
> A few comments:
>
> * use "empty()" instead of "size() == 0"
> * use "foo" instead of "ArrayRef<T>(&foo, 1)" (ArrayRef has an
> implicit ctor from T)
> * should we consider adding an ArrayRef implicit ctor from "None"?
> (see llvm/ADT/None.h and its use in llvm/ADT/Optional.h) Then you
> could replace all the "ArrayRef<T>()" calls with "None" (you might
> even want to do a sed replace on existing instances of this as a
> separate patch (a purely mechanical patch is easy to review/apply)).
> You could, maybe, even remove the default ctor for ArrayRef entirely
> (though there may be cases where we still want/need it to resolve
> ambiguities, I'm not sure - but temporarily removing it would help you
> track down all the places that could use "None" instead). This may
> need some consideration as to whether it improves or hinders
> readability.
>
> - Expr **Args = InitList ? &InitListAsExpr : 0;
> - unsigned NumArgs = InitList ? 1 : 0;
> + ArrayRef <Expr *> Args ( InitList ? &InitListAsExpr : 0 , InitList ? 1 :
> 0);
>
> You can drop the conditional in the first parameter:
>
> ArrayRef <Expr *> Args (&InitListAsExpr, InitList ? 1 : 0);
>
> Or possibly write this as:
>
> ArrayRef<Expr *> Args = InitList ? InitListAsExpr : None;
>
> If you take up the "None" suggestion above. That might then be simple
> enough to skip the local variable & just use the expression directly
> in the TryConstructorInitialization call below.
>
> * in some cases you have "ArrayRef<Expr *>(x, y)" or similar which
> could be replaced with "makeArrayRef(x, y)" & avoid having to name the
> Expr (or whatever other element) type
> *
>
>
>
> On Tue, Apr 30, 2013 at 5:23 AM, Robert Wilhelm <[email protected]>
> wrote:
> >
> > This patch switches to ArrayRef in SemaInit.cpp.
> > No functionality change.
> > Passes make test on x86_64-unknown-linux-gnu
> >
> > Please commit.
> >
> > Thanks,
> > Robert
> >
> > _______________________________________________
> > cfe-commits mailing list
> > [email protected]
> > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
> >
Index: include/llvm/ADT/ArrayRef.h
===================================================================
--- include/llvm/ADT/ArrayRef.h (revision 180839)
+++ include/llvm/ADT/ArrayRef.h (working copy)
@@ -10,6 +10,7 @@
#ifndef LLVM_ADT_ARRAYREF_H
#define LLVM_ADT_ARRAYREF_H
+#include "llvm/ADT/None.h"
#include "llvm/ADT/SmallVector.h"
#include <vector>
@@ -49,6 +50,9 @@
/// Construct an empty ArrayRef.
/*implicit*/ ArrayRef() : Data(0), Length(0) {}
+ /// Construct an empty ArrayRef from None.
+ ArrayRef(NoneType) : Data(0), Length(0) {}
+
/// Construct an ArrayRef from a single element.
/*implicit*/ ArrayRef(const T &OneElt)
: Data(&OneElt), Length(1) {}
Index: lib/AsmParser/LLParser.cpp
===================================================================
--- lib/AsmParser/LLParser.cpp (revision 180839)
+++ lib/AsmParser/LLParser.cpp (working copy)
@@ -528,7 +528,7 @@
if (Result) return false;
// Otherwise, create MDNode forward reference.
- MDNode *FwdNode = MDNode::getTemporary(Context, ArrayRef<Value*>());
+ MDNode *FwdNode = MDNode::getTemporary(Context, None);
ForwardRefMDNodes[MID] = std::make_pair(FwdNode, Lex.getLoc());
if (NumberedMetadata.size() <= MID)
Index: lib/Bitcode/Reader/BitcodeReader.cpp
===================================================================
--- lib/Bitcode/Reader/BitcodeReader.cpp (revision 180839)
+++ lib/Bitcode/Reader/BitcodeReader.cpp (working copy)
@@ -405,7 +405,7 @@
}
// Create and return a placeholder, which will later be RAUW'd.
- Value *V = MDNode::getTemporary(Context, ArrayRef<Value*>());
+ Value *V = MDNode::getTemporary(Context, None);
MDValuePtrs[Idx] = V;
return V;
}
Index: lib/CodeGen/SelectionDAG/SelectionDAG.cpp
===================================================================
--- lib/CodeGen/SelectionDAG/SelectionDAG.cpp (revision 180839)
+++ lib/CodeGen/SelectionDAG/SelectionDAG.cpp (working copy)
@@ -5252,7 +5252,7 @@
MachineSDNode *
SelectionDAG::getMachineNode(unsigned Opcode, DebugLoc dl, EVT VT) {
SDVTList VTs = getVTList(VT);
- return getMachineNode(Opcode, dl, VTs, ArrayRef<SDValue>());
+ return getMachineNode(Opcode, dl, VTs, None);
}
MachineSDNode *
@@ -5288,7 +5288,7 @@
MachineSDNode *
SelectionDAG::getMachineNode(unsigned Opcode, DebugLoc dl, EVT VT1, EVT VT2) {
SDVTList VTs = getVTList(VT1, VT2);
- return getMachineNode(Opcode, dl, VTs, ArrayRef<SDValue>());
+ return getMachineNode(Opcode, dl, VTs, None);
}
MachineSDNode *
Index: lib/CodeGen/ShrinkWrapping.cpp
===================================================================
--- lib/CodeGen/ShrinkWrapping.cpp (revision 180839)
+++ lib/CodeGen/ShrinkWrapping.cpp (working copy)
@@ -70,14 +70,14 @@
// Debugging level for shrink wrapping.
enum ShrinkWrapDebugLevel {
- None, BasicInfo, Iterations, Details
+ Disabled, BasicInfo, Iterations, Details
};
static cl::opt<enum ShrinkWrapDebugLevel>
ShrinkWrapDebugging("shrink-wrap-dbg", cl::Hidden,
cl::desc("Print shrink wrapping debugging information"),
cl::values(
- clEnumVal(None , "disable debug output"),
+ clEnumVal(Disabled , "disable debug output"),
clEnumVal(BasicInfo , "print basic DF sets"),
clEnumVal(Iterations, "print SR sets for each iteration"),
clEnumVal(Details , "print all DF sets"),
Index: lib/IR/PassManager.cpp
===================================================================
--- lib/IR/PassManager.cpp (revision 180839)
+++ lib/IR/PassManager.cpp (working copy)
@@ -42,14 +42,14 @@
// Different debug levels that can be enabled...
enum PassDebugLevel {
- None, Arguments, Structure, Executions, Details
+ Disabled, Arguments, Structure, Executions, Details
};
static cl::opt<enum PassDebugLevel>
PassDebugging("debug-pass", cl::Hidden,
cl::desc("Print PassManager debugging information"),
cl::values(
- clEnumVal(None , "disable debug output"),
+ clEnumVal(Disabled , "disable debug output"),
clEnumVal(Arguments , "print pass arguments to pass to 'opt'"),
clEnumVal(Structure , "print pass structure before run()"),
clEnumVal(Executions, "print pass name before it is executed"),
Index: lib/IR/Type.cpp
===================================================================
--- lib/IR/Type.cpp (revision 180839)
+++ lib/IR/Type.cpp (working copy)
@@ -380,7 +380,7 @@
}
FunctionType *FunctionType::get(Type *Result, bool isVarArg) {
- return get(Result, ArrayRef<Type *>(), isVarArg);
+ return get(Result, None, isVarArg);
}
/// isValidReturnType - Return true if the specified type is valid as a return
@@ -499,7 +499,7 @@
}
StructType *StructType::get(LLVMContext &Context, bool isPacked) {
- return get(Context, llvm::ArrayRef<Type*>(), isPacked);
+ return get(Context, None, isPacked);
}
StructType *StructType::get(Type *type, ...) {
Index: lib/MC/MCParser/AsmParser.cpp
===================================================================
--- lib/MC/MCParser/AsmParser.cpp (revision 180839)
+++ lib/MC/MCParser/AsmParser.cpp (working copy)
@@ -201,9 +201,9 @@
}
virtual bool Warning(SMLoc L, const Twine &Msg,
- ArrayRef<SMRange> Ranges = ArrayRef<SMRange>());
+ ArrayRef<SMRange> Ranges = None);
virtual bool Error(SMLoc L, const Twine &Msg,
- ArrayRef<SMRange> Ranges = ArrayRef<SMRange>());
+ ArrayRef<SMRange> Ranges = None);
virtual const AsmToken &Lex();
@@ -286,7 +286,7 @@
void PrintMacroInstantiations();
void PrintMessage(SMLoc Loc, SourceMgr::DiagKind Kind, const Twine &Msg,
- ArrayRef<SMRange> Ranges = ArrayRef<SMRange>()) const {
+ ArrayRef<SMRange> Ranges = None) const {
SrcMgr.PrintMessage(Loc, Kind, Msg, Ranges);
}
static void DiagHandler(const SMDiagnostic &Diag, void *Context);
Index: lib/Support/YAMLParser.cpp
===================================================================
--- lib/Support/YAMLParser.cpp (revision 180839)
+++ lib/Support/YAMLParser.cpp (working copy)
@@ -260,7 +260,7 @@
Token getNext();
void printError(SMLoc Loc, SourceMgr::DiagKind Kind, const Twine &Message,
- ArrayRef<SMRange> Ranges = ArrayRef<SMRange>()) {
+ ArrayRef<SMRange> Ranges = None) {
SM.PrintMessage(Loc, Kind, Message, Ranges);
}
Index: lib/Target/ARM/AsmParser/ARMAsmParser.cpp
===================================================================
--- lib/Target/ARM/AsmParser/ARMAsmParser.cpp (revision 180839)
+++ lib/Target/ARM/AsmParser/ARMAsmParser.cpp (working copy)
@@ -86,11 +86,11 @@
MCAsmLexer &getLexer() const { return Parser.getLexer(); }
bool Warning(SMLoc L, const Twine &Msg,
- ArrayRef<SMRange> Ranges = ArrayRef<SMRange>()) {
+ ArrayRef<SMRange> Ranges = None) {
return Parser.Warning(L, Msg, Ranges);
}
bool Error(SMLoc L, const Twine &Msg,
- ArrayRef<SMRange> Ranges = ArrayRef<SMRange>()) {
+ ArrayRef<SMRange> Ranges = None) {
return Parser.Error(L, Msg, Ranges);
}
Index: lib/Target/X86/AsmParser/X86AsmParser.cpp
===================================================================
--- lib/Target/X86/AsmParser/X86AsmParser.cpp (revision 180839)
+++ lib/Target/X86/AsmParser/X86AsmParser.cpp (working copy)
@@ -477,7 +477,7 @@
MCAsmLexer &getLexer() const { return Parser.getLexer(); }
bool Error(SMLoc L, const Twine &Msg,
- ArrayRef<SMRange> Ranges = ArrayRef<SMRange>(),
+ ArrayRef<SMRange> Ranges = None,
bool MatchingInlineAsm = false) {
if (MatchingInlineAsm) return true;
return Parser.Error(L, Msg, Ranges);
@@ -2200,7 +2200,7 @@
assert(!Operands.empty() && "Unexpect empty operand list!");
X86Operand *Op = static_cast<X86Operand*>(Operands[0]);
assert(Op->isToken() && "Leading operand should always be a mnemonic!");
- ArrayRef<SMRange> EmptyRanges = ArrayRef<SMRange>();
+ ArrayRef<SMRange> EmptyRanges = None;
// First, handle aliases that expand to multiple instructions.
// FIXME: This should be replaced with a real .td file alias mechanism.
Index: lib/Transforms/InstCombine/InstructionCombining.cpp
===================================================================
--- lib/Transforms/InstCombine/InstructionCombining.cpp (revision 180839)
+++ lib/Transforms/InstCombine/InstructionCombining.cpp (working copy)
@@ -1484,7 +1484,7 @@
Module *M = II->getParent()->getParent()->getParent();
Function *F = Intrinsic::getDeclaration(M, Intrinsic::donothing);
InvokeInst::Create(F, II->getNormalDest(), II->getUnwindDest(),
- ArrayRef<Value *>(), "", II->getParent());
+ None, "", II->getParent());
}
return EraseInstFromFunction(MI);
}
Index: lib/Transforms/ObjCARC/ObjCARCOpts.cpp
===================================================================
--- lib/Transforms/ObjCARC/ObjCARCOpts.cpp (revision 180839)
+++ lib/Transforms/ObjCARC/ObjCARCOpts.cpp (working copy)
@@ -1473,7 +1473,7 @@
CallInst::Create(getReleaseCallee(F.getParent()),
Call->getArgOperand(0), "", Call);
NewCall->setMetadata(ImpreciseReleaseMDKind,
- MDNode::get(C, ArrayRef<Value *>()));
+ MDNode::get(C, None));
DEBUG(dbgs() << "Replacing autorelease{,RV}(x) with objc_release(x) "
"since x is otherwise unused.\nOld: " << *Call << "\nNew: "
Index: lib/Transforms/Utils/ValueMapper.cpp
===================================================================
--- lib/Transforms/Utils/ValueMapper.cpp (revision 180839)
+++ lib/Transforms/Utils/ValueMapper.cpp (working copy)
@@ -57,7 +57,7 @@
return VM[V] = const_cast<Value*>(V);
// Create a dummy node in case we have a metadata cycle.
- MDNode *Dummy = MDNode::getTemporary(V->getContext(), ArrayRef<Value*>());
+ MDNode *Dummy = MDNode::getTemporary(V->getContext(), None);
VM[V] = Dummy;
// Check all operands to see if any need to be remapped.
Index: lib/Transforms/Vectorize/LoopVectorize.cpp
===================================================================
--- lib/Transforms/Vectorize/LoopVectorize.cpp (revision 180839)
+++ lib/Transforms/Vectorize/LoopVectorize.cpp (working copy)
@@ -1231,7 +1231,7 @@
// Mark the old scalar loop with metadata that tells us not to vectorize this
// loop again if we run into it.
- MDNode *MD = MDNode::get(OldBasicBlock->getContext(), ArrayRef<Value*>());
+ MDNode *MD = MDNode::get(OldBasicBlock->getContext(), None);
OldBasicBlock->getTerminator()->setMetadata(AlreadyVectorizedMDName, MD);
// Some loops have a single integer induction variable, while other loops
Index: lib/AST/CommentParser.cpp
===================================================================
--- lib/AST/CommentParser.cpp (revision 180853)
+++ lib/AST/CommentParser.cpp (working copy)
@@ -330,7 +330,7 @@
// Block command ahead. We can't nest block commands, so pretend that this
// command has an empty argument.
ParagraphComment *Paragraph = S.actOnParagraphComment(
- ArrayRef<InlineContentComment *>());
+ None);
if (PC) {
S.actOnParamCommandFinish(PC, Paragraph);
return PC;
@@ -372,7 +372,7 @@
ParagraphComment *Paragraph;
if (EmptyParagraph)
- Paragraph = S.actOnParagraphComment(ArrayRef<InlineContentComment *>());
+ Paragraph = S.actOnParagraphComment(None);
else {
BlockContentComment *Block = parseParagraphOrBlockCommand();
// Since we have checked for a block command, we should have parsed a
Index: lib/AST/Decl.cpp
===================================================================
--- lib/AST/Decl.cpp (revision 180853)
+++ lib/AST/Decl.cpp (working copy)
@@ -3420,7 +3420,7 @@
ArrayRef<SourceLocation> ImportDecl::getIdentifierLocs() const {
if (!ImportedAndComplete.getInt())
- return ArrayRef<SourceLocation>();
+ return None;
const SourceLocation *StoredLocs
= reinterpret_cast<const SourceLocation *>(this + 1);
Index: lib/AST/DeclObjC.cpp
===================================================================
--- lib/AST/DeclObjC.cpp (revision 180853)
+++ lib/AST/DeclObjC.cpp (working copy)
@@ -604,12 +604,12 @@
assert((!SelLocs.empty() || isImplicit()) &&
"No selector locs for non-implicit method");
if (isImplicit())
- return setParamsAndSelLocs(C, Params, ArrayRef<SourceLocation>());
+ return setParamsAndSelLocs(C, Params, llvm::None);
SelLocsKind = hasStandardSelectorLocs(getSelector(), SelLocs, Params,
DeclEndLoc);
if (SelLocsKind != SelLoc_NonStandard)
- return setParamsAndSelLocs(C, Params, ArrayRef<SourceLocation>());
+ return setParamsAndSelLocs(C, Params, llvm::None);
setParamsAndSelLocs(C, Params, SelLocs);
}
Index: lib/AST/ExprCXX.cpp
===================================================================
--- lib/AST/ExprCXX.cpp (revision 180853)
+++ lib/AST/ExprCXX.cpp (working copy)
@@ -179,7 +179,7 @@
PseudoDestructorTypeStorage DestroyedType)
: Expr(CXXPseudoDestructorExprClass,
Context.getPointerType(Context.getFunctionType(Context.VoidTy,
- ArrayRef<QualType>(),
+ None,
FunctionProtoType::ExtProtoInfo())),
VK_RValue, OK_Ordinary,
/*isTypeDependent=*/(Base->isTypeDependent() ||
Index: lib/Analysis/BodyFarm.cpp
===================================================================
--- lib/Analysis/BodyFarm.cpp (revision 180853)
+++ lib/Analysis/BodyFarm.cpp (working copy)
@@ -194,7 +194,7 @@
// (1) Create the call.
DeclRefExpr *DR = M.makeDeclRefExpr(Block);
ImplicitCastExpr *ICE = M.makeLvalueToRvalue(DR, Ty);
- CallExpr *CE = new (C) CallExpr(C, ICE, ArrayRef<Expr*>(), C.VoidTy,
+ CallExpr *CE = new (C) CallExpr(C, ICE, None, C.VoidTy,
VK_RValue, SourceLocation());
// (2) Create the assignment to the predicate.
@@ -257,7 +257,7 @@
ASTMaker M(C);
DeclRefExpr *DR = M.makeDeclRefExpr(PV);
ImplicitCastExpr *ICE = M.makeLvalueToRvalue(DR, Ty);
- CallExpr *CE = new (C) CallExpr(C, ICE, ArrayRef<Expr*>(), C.VoidTy,
+ CallExpr *CE = new (C) CallExpr(C, ICE, None, C.VoidTy,
VK_RValue, SourceLocation());
return CE;
}
Index: lib/CodeGen/CGCall.cpp
===================================================================
--- lib/CodeGen/CGCall.cpp (revision 180853)
+++ lib/CodeGen/CGCall.cpp (working copy)
@@ -77,7 +77,7 @@
// When translating an unprototyped function type, always use a
// variadic type.
return arrangeLLVMFunctionInfo(FTNP->getResultType().getUnqualifiedType(),
- ArrayRef<CanQualType>(),
+ None,
FTNP->getExtInfo(),
RequiredArgs(0));
}
@@ -258,7 +258,7 @@
if (isa<FunctionNoProtoType>(FTy)) {
CanQual<FunctionNoProtoType> noProto = FTy.getAs<FunctionNoProtoType>();
return arrangeLLVMFunctionInfo(noProto->getResultType(),
- ArrayRef<CanQualType>(),
+ None,
noProto->getExtInfo(),
RequiredArgs::All);
}
@@ -420,7 +420,7 @@
}
const CGFunctionInfo &CodeGenTypes::arrangeNullaryFunction() {
- return arrangeLLVMFunctionInfo(getContext().VoidTy, ArrayRef<CanQualType>(),
+ return arrangeLLVMFunctionInfo(getContext().VoidTy, None,
FunctionType::ExtInfo(), RequiredArgs::All);
}
Index: lib/Frontend/DiagnosticRenderer.cpp
===================================================================
--- lib/Frontend/DiagnosticRenderer.cpp (revision 180853)
+++ lib/Frontend/DiagnosticRenderer.cpp (working copy)
@@ -464,7 +464,7 @@
Message << "expanded from macro '" << MacroName << "'";
emitDiagnostic(SpellingLoc, DiagnosticsEngine::Note,
Message.str(),
- SpellingRanges, ArrayRef<FixItHint>(), &SM);
+ SpellingRanges, None, &SM);
}
DiagnosticNoteRenderer::~DiagnosticNoteRenderer() {}
Index: lib/Parse/ParseExpr.cpp
===================================================================
--- lib/Parse/ParseExpr.cpp (revision 180853)
+++ lib/Parse/ParseExpr.cpp (working copy)
@@ -1414,8 +1414,7 @@
CommaLocsTy CommaLocs;
if (Tok.is(tok::code_completion)) {
- Actions.CodeCompleteCall(getCurScope(), LHS.get(),
- ArrayRef<Expr *>());
+ Actions.CodeCompleteCall(getCurScope(), LHS.get(), None);
cutOffParsing();
return ExprError();
}
Index: lib/Sema/SemaChecking.cpp
===================================================================
--- lib/Sema/SemaChecking.cpp (revision 180853)
+++ lib/Sema/SemaChecking.cpp (working copy)
@@ -2009,7 +2009,7 @@
PartialDiagnostic PDiag,
SourceLocation StringLoc,
bool IsStringLocation, Range StringRange,
- ArrayRef<FixItHint> Fixit = ArrayRef<FixItHint>());
+ ArrayRef<FixItHint> Fixit = None);
protected:
bool HandleInvalidConversionSpecifier(unsigned argIndex, SourceLocation Loc,
@@ -2036,7 +2036,7 @@
template <typename Range>
void EmitFormatDiagnostic(PartialDiagnostic PDiag, SourceLocation StringLoc,
bool IsStringLocation, Range StringRange,
- ArrayRef<FixItHint> Fixit = ArrayRef<FixItHint>());
+ ArrayRef<FixItHint> Fixit = None);
void CheckPositionalAndNonpositionalArgs(
const analyze_format_string::FormatSpecifier *FS);
Index: lib/Sema/SemaDecl.cpp
===================================================================
--- lib/Sema/SemaDecl.cpp (revision 180853)
+++ lib/Sema/SemaDecl.cpp (working copy)
@@ -6552,7 +6552,7 @@
EPI.ExtInfo = FT->getExtInfo();
QualType R = Context.getFunctionType(FT->getResultType(),
- ArrayRef<QualType>(),
+ None,
EPI);
NewFD->setType(R);
}
Index: lib/Sema/SemaDeclCXX.cpp
===================================================================
--- lib/Sema/SemaDeclCXX.cpp (revision 180853)
+++ lib/Sema/SemaDeclCXX.cpp (working copy)
@@ -4595,7 +4595,7 @@
FunctionProtoType::ExtProtoInfo EPI;
computeImplicitExceptionSpec(*this, MD->getLocation(), MD).getEPI(EPI);
const FunctionProtoType *ImplicitType = cast<FunctionProtoType>(
- Context.getFunctionType(Context.VoidTy, ArrayRef<QualType>(), EPI));
+ Context.getFunctionType(Context.VoidTy, None, EPI));
// Ensure that it matches.
CheckEquivalentExceptionSpec(
@@ -6030,7 +6030,7 @@
EPI.Variadic = false;
EPI.TypeQuals = 0;
EPI.RefQualifier = RQ_None;
- return Context.getFunctionType(Context.VoidTy, ArrayRef<QualType>(), EPI);
+ return Context.getFunctionType(Context.VoidTy, None, EPI);
}
/// CheckConversionDeclarator - Called by ActOnDeclarator to check the
@@ -6111,7 +6111,7 @@
// of the errors above fired) and with the conversion type as the
// return type.
if (D.isInvalidType())
- R = Context.getFunctionType(ConvType, ArrayRef<QualType>(),
+ R = Context.getFunctionType(ConvType, None,
Proto->getExtProtoInfo());
// C++0x explicit conversion operators.
@@ -7812,7 +7812,7 @@
EPI.ExceptionSpecType = EST_Unevaluated;
EPI.ExceptionSpecDecl = DefaultCon;
DefaultCon->setType(Context.getFunctionType(Context.VoidTy,
- ArrayRef<QualType>(),
+ None,
EPI));
// We don't need to use SpecialMemberIsTrivial here; triviality for default
@@ -8278,7 +8278,7 @@
EPI.ExceptionSpecType = EST_Unevaluated;
EPI.ExceptionSpecDecl = Destructor;
Destructor->setType(Context.getFunctionType(Context.VoidTy,
- ArrayRef<QualType>(),
+ None,
EPI));
AddOverriddenMethods(ClassDecl, Destructor);
@@ -8384,7 +8384,7 @@
EPI.ExceptionSpecType = EST_Unevaluated;
EPI.ExceptionSpecDecl = Destructor;
Destructor->setType(Context.getFunctionType(Context.VoidTy,
- ArrayRef<QualType>(),
+ None,
EPI));
// FIXME: If the destructor has a body that could throw, and the newly created
Index: lib/Sema/SemaExpr.cpp
===================================================================
--- lib/Sema/SemaExpr.cpp (revision 180853)
+++ lib/Sema/SemaExpr.cpp (working copy)
@@ -2916,7 +2916,7 @@
TemplateArgumentLocInfo ArgInfo;
ExplicitArgs.addArgument(TemplateArgumentLoc(Arg, ArgInfo));
}
- return BuildLiteralOperatorCall(R, OpNameInfo, ArrayRef<Expr*>(),
+ return BuildLiteralOperatorCall(R, OpNameInfo, None,
Tok.getLocation(), &ExplicitArgs);
}
@@ -9734,7 +9734,7 @@
FunctionProtoType::ExtProtoInfo EPI;
EPI.HasTrailingReturn = false;
EPI.TypeQuals |= DeclSpec::TQ_const;
- T = Context.getFunctionType(Context.DependentTy, ArrayRef<QualType>(), EPI);
+ T = Context.getFunctionType(Context.DependentTy, None, EPI);
Sig = Context.getTrivialTypeSourceInfo(T);
}
@@ -9913,7 +9913,7 @@
if (isa<FunctionNoProtoType>(FTy)) {
FunctionProtoType::ExtProtoInfo EPI;
EPI.ExtInfo = Ext;
- BlockTy = Context.getFunctionType(RetTy, ArrayRef<QualType>(), EPI);
+ BlockTy = Context.getFunctionType(RetTy, None, EPI);
// Otherwise, if we don't need to change anything about the function type,
// preserve its sugar structure.
@@ -9938,7 +9938,7 @@
} else {
FunctionProtoType::ExtProtoInfo EPI;
EPI.ExtInfo = FunctionType::ExtInfo().withNoReturn(NoReturn);
- BlockTy = Context.getFunctionType(RetTy, ArrayRef<QualType>(), EPI);
+ BlockTy = Context.getFunctionType(RetTy, None, EPI);
}
DiagnoseUnusedParameters(BSI->TheDecl->param_begin(),
Index: lib/Sema/SemaExprObjC.cpp
===================================================================
--- lib/Sema/SemaExprObjC.cpp (revision 180853)
+++ lib/Sema/SemaExprObjC.cpp (working copy)
@@ -239,7 +239,7 @@
&CX.Idents.get("value"),
NumberType, /*TInfo=*/0, SC_None,
0);
- Method->setMethodParams(S.Context, value, ArrayRef<SourceLocation>());
+ Method->setMethodParams(S.Context, value, None);
}
if (!validateBoxingMethod(S, Loc, S.NSNumberDecl, Sel, Method))
@@ -490,7 +490,7 @@
Context.getPointerType(ConstCharType),
/*TInfo=*/0,
SC_None, 0);
- M->setMethodParams(Context, value, ArrayRef<SourceLocation>());
+ M->setMethodParams(Context, value, None);
BoxingMethod = M;
}
@@ -665,7 +665,7 @@
Context.UnsignedLongTy,
/*TInfo=*/0, SC_None, 0);
Params.push_back(cnt);
- Method->setMethodParams(Context, Params, ArrayRef<SourceLocation>());
+ Method->setMethodParams(Context, Params, None);
}
if (!validateBoxingMethod(*this, SR.getBegin(), NSArrayDecl, Sel, Method))
@@ -788,7 +788,7 @@
Context.UnsignedLongTy,
/*TInfo=*/0, SC_None, 0);
Params.push_back(cnt);
- Method->setMethodParams(Context, Params, ArrayRef<SourceLocation>());
+ Method->setMethodParams(Context, Params, None);
}
if (!validateBoxingMethod(*this, SR.getBegin(), NSDictionaryDecl, Sel,
Index: lib/Sema/SemaLambda.cpp
===================================================================
--- lib/Sema/SemaLambda.cpp (revision 180853)
+++ lib/Sema/SemaLambda.cpp (working copy)
@@ -453,7 +453,7 @@
EPI.HasTrailingReturn = true;
EPI.TypeQuals |= DeclSpec::TQ_const;
QualType MethodTy = Context.getFunctionType(Context.DependentTy,
- ArrayRef<QualType>(),
+ None,
EPI);
MethodTyInfo = Context.getTrivialTypeSourceInfo(MethodTy);
ExplicitParams = false;
@@ -708,7 +708,7 @@
FunctionProtoType::ExtProtoInfo ExtInfo;
ExtInfo.TypeQuals = Qualifiers::Const;
QualType ConvTy =
- S.Context.getFunctionType(FunctionPtrTy, ArrayRef<QualType>(), ExtInfo);
+ S.Context.getFunctionType(FunctionPtrTy, None, ExtInfo);
SourceLocation Loc = IntroducerRange.getBegin();
DeclarationName Name
@@ -779,8 +779,7 @@
FunctionProtoType::ExtProtoInfo ExtInfo;
ExtInfo.TypeQuals = Qualifiers::Const;
- QualType ConvTy = S.Context.getFunctionType(BlockPtrTy, ArrayRef<QualType>(),
- ExtInfo);
+ QualType ConvTy = S.Context.getFunctionType(BlockPtrTy, None, ExtInfo);
SourceLocation Loc = IntroducerRange.getBegin();
DeclarationName Name
Index: lib/Sema/SemaLookup.cpp
===================================================================
--- lib/Sema/SemaLookup.cpp (revision 180853)
+++ lib/Sema/SemaLookup.cpp (working copy)
@@ -731,7 +731,7 @@
EPI.NumExceptions = 0;
QualType ExpectedType
= R.getSema().Context.getFunctionType(R.getLookupName().getCXXNameType(),
- ArrayRef<QualType>(), EPI);
+ None, EPI);
// Perform template argument deduction against the type that we would
// expect the function to have.
Index: lib/Sema/SemaObjCProperty.cpp
===================================================================
--- lib/Sema/SemaObjCProperty.cpp (revision 180853)
+++ lib/Sema/SemaObjCProperty.cpp (working copy)
@@ -2007,8 +2007,7 @@
/*TInfo=*/0,
SC_None,
0);
- SetterMethod->setMethodParams(Context, Argument,
- ArrayRef<SourceLocation>());
+ SetterMethod->setMethodParams(Context, Argument, None);
AddPropertyAttrs(*this, SetterMethod, property);
Index: lib/Sema/SemaOverload.cpp
===================================================================
--- lib/Sema/SemaOverload.cpp (revision 180853)
+++ lib/Sema/SemaOverload.cpp (working copy)
@@ -11280,7 +11280,7 @@
for (LookupResult::iterator Oper = R.begin(), OperEnd = R.end();
Oper != OperEnd; ++Oper) {
AddMethodCandidate(Oper.getPair(), Base->getType(), Base->Classify(Context),
- ArrayRef<Expr *>(), CandidateSet,
+ None, CandidateSet,
/*SuppressUserConversions=*/false);
}
Index: lib/Sema/SemaPseudoObject.cpp
===================================================================
--- lib/Sema/SemaPseudoObject.cpp (revision 180853)
+++ lib/Sema/SemaPseudoObject.cpp (working copy)
@@ -1118,8 +1118,7 @@
/*TInfo=*/0,
SC_None,
0);
- AtIndexGetter->setMethodParams(S.Context, Argument,
- ArrayRef<SourceLocation>());
+ AtIndexGetter->setMethodParams(S.Context, Argument, None);
}
if (!AtIndexGetter) {
@@ -1243,7 +1242,7 @@
SC_None,
0);
Params.push_back(key);
- AtIndexSetter->setMethodParams(S.Context, Params, ArrayRef<SourceLocation>());
+ AtIndexSetter->setMethodParams(S.Context, Params, None);
}
if (!AtIndexSetter) {
Index: utils/TableGen/ClangDiagnosticsEmitter.cpp
===================================================================
--- utils/TableGen/ClangDiagnosticsEmitter.cpp (revision 180839)
+++ utils/TableGen/ClangDiagnosticsEmitter.cpp (working copy)
@@ -245,7 +245,7 @@
SourceMgr::DK_Error,
Twine("group '") + Name +
"' is referred to anonymously",
- ArrayRef<SMRange>(),
+ None,
InGroupRange.isValid() ? FixIt
: ArrayRef<SMFixIt>());
SrcMgr.PrintMessage((*I)->ExplicitDef->getLoc().front(),
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits