[llvm-branch-commits] [cfe-branch] r148690 - in /cfe/branches/tooling: ./ include/clang/ include/clang/ARCMigrate/ include/clang/AST/ include/clang/Basic/ include/clang/Driver/ include/clang/Frontend/ include/clang/Sema/ lib/ARCMigrate/ lib/AST/ lib/Analysis/ lib/Basic/ lib/CodeGen/ lib/Driver/ lib/Frontend/ lib/Index/ lib/Lex/ lib/Parse/ lib/Rewrite/ lib/Sema/ lib/StaticAnalyzer/Checkers/ lib/StaticAnalyzer/Core/ runtime/libcxx/ test/ARCMT/ test/Analysis/ test/CodeGen/ test/CodeGenCXX/ test/Coverage/ test/Driver/ test/Fronte...
Manuel Klimek
klimek at google.com
Mon Jan 23 00:39:39 PST 2012
Author: klimek
Date: Mon Jan 23 02:39:37 2012
New Revision: 148690
URL: http://llvm.org/viewvc/llvm-project?rev=148690&view=rev
Log:
Merging from mainline.
Added:
cfe/branches/tooling/include/clang/Sema/CMakeLists.txt
- copied unchanged from r148688, cfe/trunk/include/clang/Sema/CMakeLists.txt
cfe/branches/tooling/include/clang/Sema/Makefile
- copied unchanged from r148688, cfe/trunk/include/clang/Sema/Makefile
cfe/branches/tooling/test/Analysis/taint-tester.m
- copied unchanged from r148688, cfe/trunk/test/Analysis/taint-tester.m
cfe/branches/tooling/test/CodeGenCXX/debug-info-context.cpp
- copied unchanged from r148688, cfe/trunk/test/CodeGenCXX/debug-info-context.cpp
cfe/branches/tooling/test/Sema/switch-enum.c
- copied unchanged from r148688, cfe/trunk/test/Sema/switch-enum.c
cfe/branches/tooling/test/Sema/vla-2.c
- copied unchanged from r148688, cfe/trunk/test/Sema/vla-2.c
Modified:
cfe/branches/tooling/ (props changed)
cfe/branches/tooling/include/clang/ARCMigrate/ARCMT.h
cfe/branches/tooling/include/clang/AST/Attr.h
cfe/branches/tooling/include/clang/AST/Type.h
cfe/branches/tooling/include/clang/Basic/Attr.td
cfe/branches/tooling/include/clang/Basic/Builtins.def
cfe/branches/tooling/include/clang/Basic/DiagnosticGroups.td
cfe/branches/tooling/include/clang/Basic/DiagnosticSemaKinds.td
cfe/branches/tooling/include/clang/CMakeLists.txt
cfe/branches/tooling/include/clang/Driver/Options.td
cfe/branches/tooling/include/clang/Frontend/FrontendAction.h
cfe/branches/tooling/include/clang/Frontend/FrontendOptions.h
cfe/branches/tooling/include/clang/Makefile
cfe/branches/tooling/include/clang/Sema/Sema.h
cfe/branches/tooling/include/clang/Sema/Template.h
cfe/branches/tooling/lib/ARCMigrate/ARCMT.cpp
cfe/branches/tooling/lib/ARCMigrate/ARCMTActions.cpp
cfe/branches/tooling/lib/ARCMigrate/TransProperties.cpp
cfe/branches/tooling/lib/AST/ASTContext.cpp
cfe/branches/tooling/lib/AST/ASTImporter.cpp
cfe/branches/tooling/lib/AST/Decl.cpp
cfe/branches/tooling/lib/AST/DeclBase.cpp
cfe/branches/tooling/lib/AST/DeclarationName.cpp
cfe/branches/tooling/lib/AST/DumpXML.cpp
cfe/branches/tooling/lib/AST/Expr.cpp
cfe/branches/tooling/lib/AST/ExprClassification.cpp
cfe/branches/tooling/lib/AST/ExprConstant.cpp
cfe/branches/tooling/lib/AST/ItaniumMangle.cpp
cfe/branches/tooling/lib/AST/NestedNameSpecifier.cpp
cfe/branches/tooling/lib/AST/Stmt.cpp
cfe/branches/tooling/lib/AST/StmtProfile.cpp
cfe/branches/tooling/lib/AST/TemplateBase.cpp
cfe/branches/tooling/lib/AST/Type.cpp
cfe/branches/tooling/lib/AST/TypeLoc.cpp
cfe/branches/tooling/lib/AST/TypePrinter.cpp
cfe/branches/tooling/lib/Analysis/CFG.cpp
cfe/branches/tooling/lib/Analysis/CocoaConventions.cpp
cfe/branches/tooling/lib/Analysis/FormatString.cpp
cfe/branches/tooling/lib/Analysis/ScanfFormatString.cpp
cfe/branches/tooling/lib/Analysis/ThreadSafety.cpp
cfe/branches/tooling/lib/Basic/Targets.cpp
cfe/branches/tooling/lib/CodeGen/CGBuiltin.cpp
cfe/branches/tooling/lib/CodeGen/CGCall.cpp
cfe/branches/tooling/lib/CodeGen/CGCleanup.cpp
cfe/branches/tooling/lib/CodeGen/CGDebugInfo.cpp
cfe/branches/tooling/lib/CodeGen/CGDebugInfo.h
cfe/branches/tooling/lib/CodeGen/CGException.cpp
cfe/branches/tooling/lib/CodeGen/CGExpr.cpp
cfe/branches/tooling/lib/CodeGen/CGExprAgg.cpp
cfe/branches/tooling/lib/CodeGen/CGExprComplex.cpp
cfe/branches/tooling/lib/CodeGen/CGExprScalar.cpp
cfe/branches/tooling/lib/CodeGen/CGObjC.cpp
cfe/branches/tooling/lib/CodeGen/CGObjCMac.cpp
cfe/branches/tooling/lib/CodeGen/CGRTTI.cpp
cfe/branches/tooling/lib/CodeGen/CodeGenModule.cpp
cfe/branches/tooling/lib/CodeGen/CodeGenModule.h
cfe/branches/tooling/lib/CodeGen/CodeGenTypes.cpp
cfe/branches/tooling/lib/CodeGen/TargetInfo.cpp
cfe/branches/tooling/lib/Driver/Driver.cpp
cfe/branches/tooling/lib/Driver/Tools.cpp
cfe/branches/tooling/lib/Frontend/ASTMerge.cpp
cfe/branches/tooling/lib/Frontend/ASTUnit.cpp
cfe/branches/tooling/lib/Frontend/ChainedIncludesSource.cpp
cfe/branches/tooling/lib/Frontend/CompilerInstance.cpp
cfe/branches/tooling/lib/Frontend/CompilerInvocation.cpp
cfe/branches/tooling/lib/Frontend/FrontendAction.cpp
cfe/branches/tooling/lib/Frontend/FrontendActions.cpp
cfe/branches/tooling/lib/Frontend/InitHeaderSearch.cpp
cfe/branches/tooling/lib/Frontend/VerifyDiagnosticConsumer.cpp
cfe/branches/tooling/lib/Index/ASTLocation.cpp
cfe/branches/tooling/lib/Lex/Lexer.cpp
cfe/branches/tooling/lib/Parse/ParseDecl.cpp
cfe/branches/tooling/lib/Parse/ParseDeclCXX.cpp
cfe/branches/tooling/lib/Parse/ParseExpr.cpp
cfe/branches/tooling/lib/Parse/ParseExprCXX.cpp
cfe/branches/tooling/lib/Parse/ParsePragma.cpp
cfe/branches/tooling/lib/Rewrite/HTMLRewrite.cpp
cfe/branches/tooling/lib/Sema/AnalysisBasedWarnings.cpp
cfe/branches/tooling/lib/Sema/CMakeLists.txt
cfe/branches/tooling/lib/Sema/SemaAccess.cpp
cfe/branches/tooling/lib/Sema/SemaAttr.cpp
cfe/branches/tooling/lib/Sema/SemaChecking.cpp
cfe/branches/tooling/lib/Sema/SemaCodeComplete.cpp
cfe/branches/tooling/lib/Sema/SemaDecl.cpp
cfe/branches/tooling/lib/Sema/SemaDeclAttr.cpp
cfe/branches/tooling/lib/Sema/SemaDeclCXX.cpp
cfe/branches/tooling/lib/Sema/SemaExpr.cpp
cfe/branches/tooling/lib/Sema/SemaExprCXX.cpp
cfe/branches/tooling/lib/Sema/SemaLookup.cpp
cfe/branches/tooling/lib/Sema/SemaStmt.cpp
cfe/branches/tooling/lib/Sema/SemaTemplateDeduction.cpp
cfe/branches/tooling/lib/Sema/SemaTemplateInstantiate.cpp
cfe/branches/tooling/lib/Sema/SemaTemplateInstantiateDecl.cpp
cfe/branches/tooling/lib/Sema/SemaTemplateVariadic.cpp
cfe/branches/tooling/lib/Sema/SemaType.cpp
cfe/branches/tooling/lib/StaticAnalyzer/Checkers/ArrayBoundCheckerV2.cpp
cfe/branches/tooling/lib/StaticAnalyzer/Checkers/DivZeroChecker.cpp
cfe/branches/tooling/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp
cfe/branches/tooling/lib/StaticAnalyzer/Checkers/PthreadLockChecker.cpp
cfe/branches/tooling/lib/StaticAnalyzer/Checkers/VLASizeChecker.cpp
cfe/branches/tooling/lib/StaticAnalyzer/Core/CheckerContext.cpp
cfe/branches/tooling/lib/StaticAnalyzer/Core/Environment.cpp
cfe/branches/tooling/lib/StaticAnalyzer/Core/ExprEngine.cpp
cfe/branches/tooling/lib/StaticAnalyzer/Core/SimpleConstraintManager.cpp
cfe/branches/tooling/runtime/libcxx/Makefile
cfe/branches/tooling/test/ARCMT/GC-no-arc-runtime.m.result
cfe/branches/tooling/test/ARCMT/GC.m
cfe/branches/tooling/test/ARCMT/GC.m.result
cfe/branches/tooling/test/ARCMT/assign-prop-with-arc-runtime.m.result
cfe/branches/tooling/test/ARCMT/driver-migrate.m
cfe/branches/tooling/test/ARCMT/releases-driver.m.result
cfe/branches/tooling/test/ARCMT/releases.m.result
cfe/branches/tooling/test/ARCMT/remove-dealloc-method.m.result
cfe/branches/tooling/test/ARCMT/remove-dealloc-zerouts.m.result
cfe/branches/tooling/test/ARCMT/retains.m.result
cfe/branches/tooling/test/Analysis/taint-generic.c
cfe/branches/tooling/test/CodeGen/2009-10-20-GlobalDebug.c
cfe/branches/tooling/test/CodeGen/char-literal.c
cfe/branches/tooling/test/CodeGen/frame-pointer-elim.c
cfe/branches/tooling/test/CodeGen/mips64-f128-literal.c
cfe/branches/tooling/test/CodeGen/mips64-padding-arg.c
cfe/branches/tooling/test/CodeGen/mmx-inline-asm.c
cfe/branches/tooling/test/CodeGen/mmx-shift-with-immediate.c
cfe/branches/tooling/test/CodeGenCXX/apple-kext-guard-variable.cpp
cfe/branches/tooling/test/CodeGenCXX/cxx-apple-kext.cpp
cfe/branches/tooling/test/Coverage/targets.c
cfe/branches/tooling/test/Driver/Wp-args.c
cfe/branches/tooling/test/Driver/Xarch.c
cfe/branches/tooling/test/Driver/Xlinker-args.c
cfe/branches/tooling/test/Driver/analyze.c
cfe/branches/tooling/test/Driver/apple-kext-i386.cpp
cfe/branches/tooling/test/Driver/apple-kext-mkernel.c
cfe/branches/tooling/test/Driver/arc.c
cfe/branches/tooling/test/Driver/arch.c
cfe/branches/tooling/test/Driver/arm-darwin-builtin.c
cfe/branches/tooling/test/Driver/arm-mfpu.c
cfe/branches/tooling/test/Driver/ast.c
cfe/branches/tooling/test/Driver/bindings.c
cfe/branches/tooling/test/Driver/cc-log-diagnostics.c
cfe/branches/tooling/test/Driver/ccc-host-triple-no-integrated-as.c
cfe/branches/tooling/test/Driver/cfi.c
cfe/branches/tooling/test/Driver/clang-translation.c
cfe/branches/tooling/test/Driver/darwin-as.c
cfe/branches/tooling/test/Driver/darwin-cc.c
cfe/branches/tooling/test/Driver/darwin-debug-flags.c
cfe/branches/tooling/test/Driver/darwin-dsymutil.c
cfe/branches/tooling/test/Driver/darwin-iphone-defaults.m
cfe/branches/tooling/test/Driver/darwin-ld.c
cfe/branches/tooling/test/Driver/darwin-objc-defaults.m
cfe/branches/tooling/test/Driver/darwin-objc-gc.m
cfe/branches/tooling/test/Driver/darwin-objc-options.m
cfe/branches/tooling/test/Driver/darwin-verify-debug.c
cfe/branches/tooling/test/Driver/darwin-version.c
cfe/branches/tooling/test/Driver/darwin-xarch.c
cfe/branches/tooling/test/Driver/default-toolchain.c
cfe/branches/tooling/test/Driver/dragonfly.c
cfe/branches/tooling/test/Driver/exceptions.m
cfe/branches/tooling/test/Driver/flags.c
cfe/branches/tooling/test/Driver/frame-pointer.c
cfe/branches/tooling/test/Driver/freebsd.c
cfe/branches/tooling/test/Driver/gcc_forward.c
cfe/branches/tooling/test/Driver/gnu-runtime.m
cfe/branches/tooling/test/Driver/ios-simulator-arcruntime.c
cfe/branches/tooling/test/Driver/le32-unknown-nacl.cpp
cfe/branches/tooling/test/Driver/linux-header-search.cpp
cfe/branches/tooling/test/Driver/linux-ld.c
cfe/branches/tooling/test/Driver/mno-global-merge.c
cfe/branches/tooling/test/Driver/nostdlib.c
cfe/branches/tooling/test/Driver/nostdlibinc.c
cfe/branches/tooling/test/Driver/openbsd.c
cfe/branches/tooling/test/Driver/phases.c
cfe/branches/tooling/test/Driver/redzone.c
cfe/branches/tooling/test/Driver/rewrite-objc.m
cfe/branches/tooling/test/Driver/sysroot-flags.c
cfe/branches/tooling/test/Driver/sysroot.c
cfe/branches/tooling/test/Driver/unknown-gcc-arch.c
cfe/branches/tooling/test/Driver/x86_features.c
cfe/branches/tooling/test/Frontend/darwin-version.c
cfe/branches/tooling/test/Headers/c89.c
cfe/branches/tooling/test/Index/annotate-tokens.m
cfe/branches/tooling/test/Index/complete-macros.c
cfe/branches/tooling/test/Index/get-cursor.m
cfe/branches/tooling/test/Index/invalid-rdar-8236270.cpp
cfe/branches/tooling/test/Index/retain-target-options.c
cfe/branches/tooling/test/Index/usrs.m
cfe/branches/tooling/test/Misc/diag-format.c
cfe/branches/tooling/test/PCH/reloc.c
cfe/branches/tooling/test/Parser/cxx-class.cpp
cfe/branches/tooling/test/Preprocessor/pic.c
cfe/branches/tooling/test/Preprocessor/x86_target_features.c
cfe/branches/tooling/test/Sema/block-printf-attribute-1.c
cfe/branches/tooling/test/Sema/format-strings-c90.c
cfe/branches/tooling/test/Sema/format-strings-int-typedefs.c
cfe/branches/tooling/test/Sema/format-strings-scanf.c
cfe/branches/tooling/test/Sema/format-strings-size_t.c
cfe/branches/tooling/test/Sema/format-strings.c
cfe/branches/tooling/test/Sema/i-c-e.c
cfe/branches/tooling/test/Sema/no-format-y2k-turnsoff-format.c
cfe/branches/tooling/test/Sema/switch.c
cfe/branches/tooling/test/Sema/warn-unreachable.c
cfe/branches/tooling/test/SemaCXX/MicrosoftCompatibility.cpp
cfe/branches/tooling/test/SemaCXX/MicrosoftExtensions.cpp
cfe/branches/tooling/test/SemaCXX/format-strings-0x.cpp
cfe/branches/tooling/test/SemaCXX/gnu-case-ranges.cpp
cfe/branches/tooling/test/SemaCXX/microsoft-cxx0x.cpp
cfe/branches/tooling/test/SemaCXX/return-noreturn.cpp
cfe/branches/tooling/test/SemaCXX/switch.cpp
cfe/branches/tooling/test/SemaCXX/vararg-non-pod.cpp
cfe/branches/tooling/test/SemaCXX/warn-thread-safety-analysis.cpp
cfe/branches/tooling/test/SemaCXX/warn-unreachable.cpp (props changed)
cfe/branches/tooling/test/SemaObjC/format-strings-objc.m
cfe/branches/tooling/tools/arcmt-test/arcmt-test.cpp
cfe/branches/tooling/tools/driver/driver.cpp
cfe/branches/tooling/tools/libclang/CIndexCodeCompletion.cpp
cfe/branches/tooling/tools/libclang/Indexing.cpp
cfe/branches/tooling/unittests/Frontend/FrontendActionTest.cpp
cfe/branches/tooling/unittests/Lex/LexerTest.cpp
cfe/branches/tooling/utils/TableGen/ClangAttrEmitter.cpp
cfe/branches/tooling/utils/TableGen/ClangAttrEmitter.h
cfe/branches/tooling/utils/TableGen/TableGen.cpp
cfe/branches/tooling/utils/analyzer/SATestBuild.py
Propchange: cfe/branches/tooling/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Jan 23 02:39:37 2012
@@ -1,3 +1,3 @@
/cfe/branches/type-system-rewrite:134693-134817
-/cfe/trunk:146581-148539
+/cfe/trunk:146581-148688
/cfe/trunk/test/SemaTemplate:126920
Modified: cfe/branches/tooling/include/clang/ARCMigrate/ARCMT.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/include/clang/ARCMigrate/ARCMT.h?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/include/clang/ARCMigrate/ARCMT.h (original)
+++ cfe/branches/tooling/include/clang/ARCMigrate/ARCMT.h Mon Jan 23 02:39:37 2012
@@ -37,7 +37,7 @@
///
/// \returns false if no error is produced, true otherwise.
bool checkForManualIssues(CompilerInvocation &CI,
- StringRef Filename, InputKind Kind,
+ const FrontendInputFile &Input,
DiagnosticConsumer *DiagClient,
bool emitPremigrationARCErrors = false,
StringRef plistOut = StringRef());
@@ -47,7 +47,7 @@
///
/// \returns false if no error is produced, true otherwise.
bool applyTransformations(CompilerInvocation &origCI,
- StringRef Filename, InputKind Kind,
+ const FrontendInputFile &Input,
DiagnosticConsumer *DiagClient);
/// \brief Applies automatic modifications and produces temporary files
@@ -62,7 +62,7 @@
///
/// \returns false if no error is produced, true otherwise.
bool migrateWithTemporaryFiles(CompilerInvocation &origCI,
- StringRef Filename, InputKind Kind,
+ const FrontendInputFile &Input,
DiagnosticConsumer *DiagClient,
StringRef outputDir,
bool emitPremigrationARCErrors,
Modified: cfe/branches/tooling/include/clang/AST/Attr.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/include/clang/AST/Attr.h?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/include/clang/AST/Attr.h (original)
+++ cfe/branches/tooling/include/clang/AST/Attr.h Mon Jan 23 02:39:37 2012
@@ -104,6 +104,8 @@
// Clone this attribute.
virtual Attr* clone(ASTContext &C) const = 0;
+ virtual bool isLateParsed() const { return false; }
+
// Pretty print this attribute.
virtual void printPretty(llvm::raw_ostream &OS, ASTContext &C) const = 0;
Modified: cfe/branches/tooling/include/clang/AST/Type.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/include/clang/AST/Type.h?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/include/clang/AST/Type.h (original)
+++ cfe/branches/tooling/include/clang/AST/Type.h Mon Jan 23 02:39:37 2012
@@ -639,6 +639,14 @@
QualType withVolatile() const {
return withFastQualifiers(Qualifiers::Volatile);
}
+
+ /// Add the restrict qualifier to this QualType.
+ void addRestrict() {
+ addFastQualifiers(Qualifiers::Restrict);
+ }
+ QualType withRestrict() const {
+ return withFastQualifiers(Qualifiers::Restrict);
+ }
QualType withCVRQualifiers(unsigned CVR) const {
return withFastQualifiers(CVR);
Modified: cfe/branches/tooling/include/clang/Basic/Attr.td
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/include/clang/Basic/Attr.td?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/include/clang/Basic/Attr.td (original)
+++ cfe/branches/tooling/include/clang/Basic/Attr.td Mon Jan 23 02:39:37 2012
@@ -93,6 +93,8 @@
list<string> Namespaces = [];
// Set to true for attributes with arguments which require delayed parsing.
bit LateParsed = 0;
+ // Set to true for attributes which must be instantiated within templates
+ bit TemplateDependent = 0;
// Any additional text that should be included verbatim in the class.
code AdditionalMembers = [{}];
}
@@ -601,36 +603,42 @@
let Spellings = ["guarded_by"];
let Args = [ExprArgument<"Arg">];
let LateParsed = 1;
+ let TemplateDependent = 1;
}
def PtGuardedBy : InheritableAttr {
let Spellings = ["pt_guarded_by"];
let Args = [ExprArgument<"Arg">];
let LateParsed = 1;
+ let TemplateDependent = 1;
}
def AcquiredAfter : InheritableAttr {
let Spellings = ["acquired_after"];
let Args = [VariadicExprArgument<"Args">];
let LateParsed = 1;
+ let TemplateDependent = 1;
}
def AcquiredBefore : InheritableAttr {
let Spellings = ["acquired_before"];
let Args = [VariadicExprArgument<"Args">];
let LateParsed = 1;
+ let TemplateDependent = 1;
}
def ExclusiveLockFunction : InheritableAttr {
let Spellings = ["exclusive_lock_function"];
let Args = [VariadicExprArgument<"Args">];
let LateParsed = 1;
+ let TemplateDependent = 1;
}
def SharedLockFunction : InheritableAttr {
let Spellings = ["shared_lock_function"];
let Args = [VariadicExprArgument<"Args">];
let LateParsed = 1;
+ let TemplateDependent = 1;
}
// The first argument is an integer or boolean value specifying the return value
@@ -639,6 +647,7 @@
let Spellings = ["exclusive_trylock_function"];
let Args = [ExprArgument<"SuccessValue">, VariadicExprArgument<"Args">];
let LateParsed = 1;
+ let TemplateDependent = 1;
}
// The first argument is an integer or boolean value specifying the return value
@@ -647,34 +656,40 @@
let Spellings = ["shared_trylock_function"];
let Args = [ExprArgument<"SuccessValue">, VariadicExprArgument<"Args">];
let LateParsed = 1;
+ let TemplateDependent = 1;
}
def UnlockFunction : InheritableAttr {
let Spellings = ["unlock_function"];
let Args = [VariadicExprArgument<"Args">];
let LateParsed = 1;
+ let TemplateDependent = 1;
}
def LockReturned : InheritableAttr {
let Spellings = ["lock_returned"];
let Args = [ExprArgument<"Arg">];
let LateParsed = 1;
+ let TemplateDependent = 1;
}
def LocksExcluded : InheritableAttr {
let Spellings = ["locks_excluded"];
let Args = [VariadicExprArgument<"Args">];
let LateParsed = 1;
+ let TemplateDependent = 1;
}
def ExclusiveLocksRequired : InheritableAttr {
let Spellings = ["exclusive_locks_required"];
let Args = [VariadicExprArgument<"Args">];
let LateParsed = 1;
+ let TemplateDependent = 1;
}
def SharedLocksRequired : InheritableAttr {
let Spellings = ["shared_locks_required"];
let Args = [VariadicExprArgument<"Args">];
let LateParsed = 1;
+ let TemplateDependent = 1;
}
Modified: cfe/branches/tooling/include/clang/Basic/Builtins.def
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/include/clang/Basic/Builtins.def?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/include/clang/Basic/Builtins.def (original)
+++ cfe/branches/tooling/include/clang/Basic/Builtins.def Mon Jan 23 02:39:37 2012
@@ -662,12 +662,12 @@
LIBBUILTIN(vfprintf, "i.", "fP:1:", "stdio.h", ALL_LANGUAGES)
LIBBUILTIN(vsnprintf, "ic*zcC*a", "fP:2:", "stdio.h", ALL_LANGUAGES)
LIBBUILTIN(vsprintf, "ic*cC*a", "fP:1:", "stdio.h", ALL_LANGUAGES)
-LIBBUILTIN(scanf, "icC*.", "fs:0:", "stdio.h", ALL_LANGUAGES)
-LIBBUILTIN(fscanf, "iP*cC*.", "fs:1:", "stdio.h", ALL_LANGUAGES)
-LIBBUILTIN(sscanf, "icC*cC*.", "fs:1:", "stdio.h", ALL_LANGUAGES)
-LIBBUILTIN(vscanf, "icC*a", "fS:0:", "stdio.h", ALL_LANGUAGES)
-LIBBUILTIN(vfscanf, "iP*cC*a", "fS:1:", "stdio.h", ALL_LANGUAGES)
-LIBBUILTIN(vsscanf, "icC*cC*a", "fS:1:", "stdio.h", ALL_LANGUAGES)
+LIBBUILTIN(scanf, "icC*R.", "fs:0:", "stdio.h", ALL_LANGUAGES)
+LIBBUILTIN(fscanf, "iP*RcC*R.", "fs:1:", "stdio.h", ALL_LANGUAGES)
+LIBBUILTIN(sscanf, "icC*RcC*R.", "fs:1:", "stdio.h", ALL_LANGUAGES)
+LIBBUILTIN(vscanf, "icC*Ra", "fS:0:", "stdio.h", ALL_LANGUAGES)
+LIBBUILTIN(vfscanf, "iP*RcC*Ra", "fS:1:", "stdio.h", ALL_LANGUAGES)
+LIBBUILTIN(vsscanf, "icC*RcC*Ra", "fS:1:", "stdio.h", ALL_LANGUAGES)
// C99
LIBBUILTIN(longjmp, "vJi", "fr", "setjmp.h", ALL_LANGUAGES)
Modified: cfe/branches/tooling/include/clang/Basic/DiagnosticGroups.td
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/include/clang/Basic/DiagnosticGroups.td?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/include/clang/Basic/DiagnosticGroups.td (original)
+++ cfe/branches/tooling/include/clang/Basic/DiagnosticGroups.td Mon Jan 23 02:39:37 2012
@@ -179,7 +179,8 @@
def StrictSelector : DiagGroup<"strict-selector-match">;
def MethodDuplicate : DiagGroup<"duplicate-method-match">;
def SwitchEnum : DiagGroup<"switch-enum">;
-def Switch : DiagGroup<"switch", [SwitchEnum]>;
+def SwitchRedundantDefault : DiagGroup<"switch-redundant-default">;
+def Switch : DiagGroup<"switch", [SwitchRedundantDefault]>;
def Trigraphs : DiagGroup<"trigraphs">;
def : DiagGroup<"type-limits">;
Modified: cfe/branches/tooling/include/clang/Basic/DiagnosticSemaKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/include/clang/Basic/DiagnosticSemaKinds.td?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/branches/tooling/include/clang/Basic/DiagnosticSemaKinds.td Mon Jan 23 02:39:37 2012
@@ -4053,6 +4053,9 @@
def err_pseudo_dtor_base_not_scalar : Error<
"object expression of non-scalar type %0 cannot be used in a "
"pseudo-destructor expression">;
+def ext_pseudo_dtor_on_void : ExtWarn<
+ "pseudo-destructors on type void are a Microsoft extension">,
+ InGroup<Microsoft>;
def err_pseudo_dtor_type_mismatch : Error<
"the type of object expression (%0) does not match the type being destroyed "
"(%1) in pseudo-destructor expression">;
@@ -4791,7 +4794,7 @@
"zero field width in scanf format string is unused">,
InGroup<Format>;
def warn_printf_conversion_argument_type_mismatch : Warning<
- "conversion specifies type %0 but the argument has type %1">,
+ "format specifies type %0 but the argument has type %1">,
InGroup<Format>;
def warn_printf_positional_arg_exceeds_data_args : Warning <
"data argument position '%0' exceeds the number of data arguments (%1)">,
@@ -4945,20 +4948,37 @@
def warn_case_empty_range : Warning<"empty case range specified">;
def warn_missing_case_for_condition :
Warning<"no case matching constant switch condition '%0'">;
+
+def warn_def_missing_case1 : Warning<
+ "enumeration value %0 not handled in switch">,
+ InGroup<SwitchEnum>, DefaultIgnore;
+def warn_def_missing_case2 : Warning<
+ "enumeration values %0 and %1 not handled in switch">,
+ InGroup<SwitchEnum>, DefaultIgnore;
+def warn_def_missing_case3 : Warning<
+ "enumeration values %0, %1, and %2 not handled in switch">,
+ InGroup<SwitchEnum>, DefaultIgnore;
+def warn_def_missing_cases : Warning<
+ "%0 enumeration values not handled in switch: %1, %2, %3...">,
+ InGroup<SwitchEnum>, DefaultIgnore;
+
def warn_missing_case1 : Warning<"enumeration value %0 not handled in switch">,
- InGroup<DiagGroup<"switch-enum"> >;
+ InGroup<Switch>;
def warn_missing_case2 : Warning<
"enumeration values %0 and %1 not handled in switch">,
- InGroup<DiagGroup<"switch-enum"> >;
+ InGroup<Switch>;
def warn_missing_case3 : Warning<
"enumeration values %0, %1, and %2 not handled in switch">,
- InGroup<DiagGroup<"switch-enum"> >;
+ InGroup<Switch>;
def warn_missing_cases : Warning<
"%0 enumeration values not handled in switch: %1, %2, %3...">,
- InGroup<DiagGroup<"switch-enum"> >;
+ InGroup<Switch>;
+def warn_unreachable_default : Warning<
+ "default is unreachable as all enumeration values are accounted for">,
+ InGroup<SwitchRedundantDefault>;
def warn_not_in_enum : Warning<"case value not in enumerated type %0">,
- InGroup<DiagGroup<"switch-enum"> >;
+ InGroup<Switch>;
def err_typecheck_statement_requires_scalar : Error<
"statement requires expression of scalar type (%0 invalid)">;
def err_typecheck_statement_requires_integer : Error<
Modified: cfe/branches/tooling/include/clang/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/include/clang/CMakeLists.txt?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/include/clang/CMakeLists.txt (original)
+++ cfe/branches/tooling/include/clang/CMakeLists.txt Mon Jan 23 02:39:37 2012
@@ -3,4 +3,5 @@
add_subdirectory(Driver)
add_subdirectory(Lex)
add_subdirectory(Parse)
+add_subdirectory(Sema)
add_subdirectory(Serialization)
Modified: cfe/branches/tooling/include/clang/Driver/Options.td
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/include/clang/Driver/Options.td?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/include/clang/Driver/Options.td (original)
+++ cfe/branches/tooling/include/clang/Driver/Options.td Mon Jan 23 02:39:37 2012
@@ -101,8 +101,6 @@
HelpText<"Use pretokenized headers for precompiled headers">;
class CCCDebugOpt : Group<ccc_debug_Group>, Flags<[DriverOption, HelpHidden]>;
-def ccc_host_triple : Separate<"-ccc-host-triple">, CCCDebugOpt,
- HelpText<"Simulate running on the given target">;
def ccc_install_dir : Separate<"-ccc-install-dir">, CCCDebugOpt,
HelpText<"Simulate installation in the given directory">;
def ccc_print_options : Flag<"-ccc-print-options">, CCCDebugOpt,
@@ -756,6 +754,10 @@
def sub__library : JoinedOrSeparate<"-sub_library">;
def sub__umbrella : JoinedOrSeparate<"-sub_umbrella">;
def s : Flag<"-s">;
+def target : Separate<"-target">,
+ HelpText<"Generate code for the given target">;
+// We should deprecate the use of -ccc-host-triple, and then remove.
+def ccc_host_triple : Flag<"-ccc-host-triple">, Alias<target>;
def time : Flag<"-time">,
HelpText<"Time individual commands">;
def traditional_cpp : Flag<"-traditional-cpp">;
Modified: cfe/branches/tooling/include/clang/Frontend/FrontendAction.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/include/clang/Frontend/FrontendAction.h?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/include/clang/Frontend/FrontendAction.h (original)
+++ cfe/branches/tooling/include/clang/Frontend/FrontendAction.h Mon Jan 23 02:39:37 2012
@@ -12,6 +12,7 @@
#include "clang/Basic/LLVM.h"
#include "clang/Basic/LangOptions.h"
+#include "clang/Frontend/FrontendOptions.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/OwningPtr.h"
#include <string>
@@ -23,29 +24,10 @@
class ASTUnit;
class CompilerInstance;
-enum InputKind {
- IK_None,
- IK_Asm,
- IK_C,
- IK_CXX,
- IK_ObjC,
- IK_ObjCXX,
- IK_PreprocessedC,
- IK_PreprocessedCXX,
- IK_PreprocessedObjC,
- IK_PreprocessedObjCXX,
- IK_OpenCL,
- IK_CUDA,
- IK_AST,
- IK_LLVM_IR
-};
-
-
/// FrontendAction - Abstract base class for actions which can be performed by
/// the frontend.
class FrontendAction {
- std::string CurrentFile;
- InputKind CurrentFileKind;
+ FrontendInputFile CurrentInput;
llvm::OwningPtr<ASTUnit> CurrentASTUnit;
CompilerInstance *Instance;
friend class ASTMergeAction;
@@ -127,18 +109,22 @@
/// @{
bool isCurrentFileAST() const {
- assert(!CurrentFile.empty() && "No current file!");
+ assert(!CurrentInput.File.empty() && "No current file!");
return CurrentASTUnit != 0;
}
+ const FrontendInputFile &getCurrentInput() const {
+ return CurrentInput;
+ }
+
const std::string &getCurrentFile() const {
- assert(!CurrentFile.empty() && "No current file!");
- return CurrentFile;
+ assert(!CurrentInput.File.empty() && "No current file!");
+ return CurrentInput.File;
}
InputKind getCurrentFileKind() const {
- assert(!CurrentFile.empty() && "No current file!");
- return CurrentFileKind;
+ assert(!CurrentInput.File.empty() && "No current file!");
+ return CurrentInput.Kind;
}
ASTUnit &getCurrentASTUnit() const {
@@ -150,7 +136,7 @@
return CurrentASTUnit.take();
}
- void setCurrentFile(StringRef Value, InputKind Kind, ASTUnit *AST = 0);
+ void setCurrentInput(const FrontendInputFile &CurrentInput, ASTUnit *AST = 0);
/// @}
/// @name Supported Modes
@@ -189,10 +175,7 @@
/// action may store and use this object up until the matching EndSourceFile
/// action.
///
- /// \param Filename - The input filename, which will be made available to
- /// clients via \see getCurrentFile().
- ///
- /// \param InputKind - The type of input. Some input kinds are handled
+ /// \param Input - The input filename and kind. Some input kinds are handled
/// specially, for example AST inputs, since the AST file itself contains
/// several objects which would normally be owned by the
/// CompilerInstance. When processing AST input files, these objects should
@@ -202,8 +185,7 @@
///
/// \return True on success; the compilation of this file should be aborted
/// and neither Execute nor EndSourceFile should be called.
- bool BeginSourceFile(CompilerInstance &CI, StringRef Filename,
- InputKind Kind);
+ bool BeginSourceFile(CompilerInstance &CI, const FrontendInputFile &Input);
/// Execute - Set the source managers main input file, and run the action.
void Execute();
Modified: cfe/branches/tooling/include/clang/Frontend/FrontendOptions.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/include/clang/Frontend/FrontendOptions.h?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/include/clang/Frontend/FrontendOptions.h (original)
+++ cfe/branches/tooling/include/clang/Frontend/FrontendOptions.h Mon Jan 23 02:39:37 2012
@@ -11,7 +11,6 @@
#define LLVM_CLANG_FRONTEND_FRONTENDOPTIONS_H
#include "clang/Frontend/CommandLineSourceLoc.h"
-#include "clang/Frontend/FrontendAction.h"
#include "llvm/ADT/StringRef.h"
#include <string>
#include <vector>
@@ -51,6 +50,37 @@
};
}
+enum InputKind {
+ IK_None,
+ IK_Asm,
+ IK_C,
+ IK_CXX,
+ IK_ObjC,
+ IK_ObjCXX,
+ IK_PreprocessedC,
+ IK_PreprocessedCXX,
+ IK_PreprocessedObjC,
+ IK_PreprocessedObjCXX,
+ IK_OpenCL,
+ IK_CUDA,
+ IK_AST,
+ IK_LLVM_IR
+};
+
+
+/// \brief An input file for the front end.
+struct FrontendInputFile {
+ /// \brief The file name, or "-" to read from standard input.
+ std::string File;
+
+ /// \brief The kind of input, e.g., C source, AST file, LLVM IR.
+ InputKind Kind;
+
+ FrontendInputFile() : Kind(IK_None) { }
+ FrontendInputFile(StringRef File, InputKind Kind)
+ : File(File.str()), Kind(Kind) { }
+};
+
/// FrontendOptions - Options for controlling the behavior of the frontend.
class FrontendOptions {
public:
@@ -86,7 +116,7 @@
std::string ARCMTMigrateReportOut;
/// The input files and their types.
- std::vector<std::pair<InputKind, std::string> > Inputs;
+ std::vector<FrontendInputFile> Inputs;
/// The output file, if any.
std::string OutputFile;
Modified: cfe/branches/tooling/include/clang/Makefile
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/include/clang/Makefile?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/include/clang/Makefile (original)
+++ cfe/branches/tooling/include/clang/Makefile Mon Jan 23 02:39:37 2012
@@ -1,5 +1,5 @@
CLANG_LEVEL := ../..
-DIRS := AST Basic Driver Lex Parse Serialization
+DIRS := AST Basic Driver Lex Parse Sema Serialization
include $(CLANG_LEVEL)/Makefile
Modified: cfe/branches/tooling/include/clang/Sema/Sema.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/include/clang/Sema/Sema.h?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/include/clang/Sema/Sema.h (original)
+++ cfe/branches/tooling/include/clang/Sema/Sema.h Mon Jan 23 02:39:37 2012
@@ -521,9 +521,9 @@
/// run time.
Unevaluated,
- /// \brief The current expression and its subexpressions occur within a
- /// constant expression. Such a context is not potentially-evaluated in
- /// C++98, but is potentially-evaluated in C++11.
+ /// \brief The current context is "potentially evaluated" in C++11 terms,
+ /// but the expression is evaluated at compile-time (like the values of
+ /// cases in a switch statment).
ConstantEvaluated,
/// \brief The current expression is potentially evaluated at run time,
@@ -2256,6 +2256,7 @@
void DiscardCleanupsInEvaluationContext();
ExprResult TranformToPotentiallyEvaluated(Expr *E);
+ ExprResult HandleExprEvaluationContextForTypeof(Expr *E);
void MarkDeclarationReferenced(SourceLocation Loc, Decl *D);
void MarkDeclarationsReferencedInType(SourceLocation Loc, QualType T);
@@ -5131,8 +5132,22 @@
TemplateSpecializationKind TSK,
bool Complain = true);
+ struct LateInstantiatedAttribute {
+ const Attr *TmplAttr;
+ LocalInstantiationScope *Scope;
+ Decl *NewDecl;
+
+ LateInstantiatedAttribute(const Attr *A, LocalInstantiationScope *S,
+ Decl *D)
+ : TmplAttr(A), Scope(S), NewDecl(D)
+ { }
+ };
+ typedef SmallVector<LateInstantiatedAttribute, 16> LateInstantiatedAttrVec;
+
void InstantiateAttrs(const MultiLevelTemplateArgumentList &TemplateArgs,
- const Decl *Pattern, Decl *Inst);
+ const Decl *Pattern, Decl *Inst,
+ LateInstantiatedAttrVec *LateAttrs = 0,
+ LocalInstantiationScope *OuterMostScope = 0);
bool
InstantiateClassTemplateSpecialization(SourceLocation PointOfInstantiation,
@@ -5538,7 +5553,7 @@
SourceLocation PragmaLoc);
/// ActOnPragmaVisibility - Called on well formed #pragma GCC visibility... .
- void ActOnPragmaVisibility(bool IsPush, const IdentifierInfo* VisType,
+ void ActOnPragmaVisibility(const IdentifierInfo* VisType,
SourceLocation PragmaLoc);
NamedDecl *DeclClonePragmaWeak(NamedDecl *ND, IdentifierInfo *II,
Modified: cfe/branches/tooling/include/clang/Sema/Template.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/include/clang/Sema/Template.h?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/include/clang/Sema/Template.h (original)
+++ cfe/branches/tooling/include/clang/Sema/Template.h Mon Jan 23 02:39:37 2012
@@ -268,6 +268,50 @@
Exited = true;
}
+ /// \brief Clone this scope, and all outer scopes, down to the given
+ /// outermost scope.
+ LocalInstantiationScope *cloneScopes(LocalInstantiationScope *Outermost) {
+ if (this == Outermost) return this;
+ LocalInstantiationScope *newScope =
+ new LocalInstantiationScope(SemaRef, CombineWithOuterScope);
+
+ newScope->Outer = 0;
+ if (Outer)
+ newScope->Outer = Outer->cloneScopes(Outermost);
+
+ newScope->PartiallySubstitutedPack = PartiallySubstitutedPack;
+ newScope->ArgsInPartiallySubstitutedPack = ArgsInPartiallySubstitutedPack;
+ newScope->NumArgsInPartiallySubstitutedPack =
+ NumArgsInPartiallySubstitutedPack;
+
+ for (LocalDeclsMap::iterator I = LocalDecls.begin(), E = LocalDecls.end();
+ I != E; ++I) {
+ const Decl *D = I->first;
+ llvm::PointerUnion<Decl *, DeclArgumentPack *> &Stored =
+ newScope->LocalDecls[D];
+ if (I->second.is<Decl *>()) {
+ Stored = I->second.get<Decl *>();
+ } else {
+ DeclArgumentPack *OldPack = I->second.get<DeclArgumentPack *>();
+ DeclArgumentPack *NewPack = new DeclArgumentPack(*OldPack);
+ Stored = NewPack;
+ newScope->ArgumentPacks.push_back(NewPack);
+ }
+ }
+ return newScope;
+ }
+
+ /// \brief deletes the given scope, and all otuer scopes, down to the
+ /// given outermost scope.
+ static void deleteScopes(LocalInstantiationScope *Scope,
+ LocalInstantiationScope *Outermost) {
+ while (Scope && Scope != Outermost) {
+ LocalInstantiationScope *Out = Scope->Outer;
+ delete Scope;
+ Scope = Out;
+ }
+ }
+
/// \brief Find the instantiation of the declaration D within the current
/// instantiation scope.
///
@@ -314,6 +358,8 @@
Sema::ArgumentPackSubstitutionIndexRAII SubstIndex;
DeclContext *Owner;
const MultiLevelTemplateArgumentList &TemplateArgs;
+ Sema::LateInstantiatedAttrVec* LateAttrs;
+ LocalInstantiationScope *StartingScope;
/// \brief A list of out-of-line class template partial
/// specializations that will need to be instantiated after the
@@ -326,7 +372,7 @@
TemplateDeclInstantiator(Sema &SemaRef, DeclContext *Owner,
const MultiLevelTemplateArgumentList &TemplateArgs)
: SemaRef(SemaRef), SubstIndex(SemaRef, -1), Owner(Owner),
- TemplateArgs(TemplateArgs) { }
+ TemplateArgs(TemplateArgs), LateAttrs(0), StartingScope(0) { }
// FIXME: Once we get closer to completion, replace these manually-written
// declarations with automatically-generated ones from
@@ -382,6 +428,21 @@
return 0;
}
+ // Enable late instantiation of attributes. Late instantiated attributes
+ // will be stored in LA.
+ void enableLateAttributeInstantiation(Sema::LateInstantiatedAttrVec *LA) {
+ LateAttrs = LA;
+ StartingScope = SemaRef.CurrentInstantiationScope;
+ }
+
+ // Disable late instantiation of attributes.
+ void disableLateAttributeInstantiation() {
+ LateAttrs = 0;
+ StartingScope = 0;
+ }
+
+ LocalInstantiationScope *getStartingScope() const { return StartingScope; }
+
typedef
SmallVectorImpl<std::pair<ClassTemplateDecl *,
ClassTemplatePartialSpecializationDecl *> >
Modified: cfe/branches/tooling/lib/ARCMigrate/ARCMT.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/ARCMigrate/ARCMT.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/ARCMigrate/ARCMT.cpp (original)
+++ cfe/branches/tooling/lib/ARCMigrate/ARCMT.cpp Mon Jan 23 02:39:37 2012
@@ -10,6 +10,7 @@
#include "Internals.h"
#include "clang/Frontend/ASTUnit.h"
#include "clang/Frontend/CompilerInstance.h"
+#include "clang/Frontend/FrontendAction.h"
#include "clang/Frontend/TextDiagnosticPrinter.h"
#include "clang/Frontend/Utils.h"
#include "clang/AST/ASTConsumer.h"
@@ -220,7 +221,7 @@
//===----------------------------------------------------------------------===//
bool arcmt::checkForManualIssues(CompilerInvocation &origCI,
- StringRef Filename, InputKind Kind,
+ const FrontendInputFile &Input,
DiagnosticConsumer *DiagClient,
bool emitPremigrationARCErrors,
StringRef plistOut) {
@@ -235,7 +236,7 @@
llvm::OwningPtr<CompilerInvocation> CInvok;
CInvok.reset(createInvocationForMigration(origCI));
CInvok->getFrontendOpts().Inputs.clear();
- CInvok->getFrontendOpts().Inputs.push_back(std::make_pair(Kind, Filename));
+ CInvok->getFrontendOpts().Inputs.push_back(Input);
CapturedDiagList capturedDiags;
@@ -311,7 +312,7 @@
//===----------------------------------------------------------------------===//
static bool applyTransforms(CompilerInvocation &origCI,
- StringRef Filename, InputKind Kind,
+ const FrontendInputFile &Input,
DiagnosticConsumer *DiagClient,
StringRef outputDir,
bool emitPremigrationARCErrors,
@@ -323,13 +324,13 @@
// Make sure checking is successful first.
CompilerInvocation CInvokForCheck(origCI);
- if (arcmt::checkForManualIssues(CInvokForCheck, Filename, Kind, DiagClient,
+ if (arcmt::checkForManualIssues(CInvokForCheck, Input, DiagClient,
emitPremigrationARCErrors, plistOut))
return true;
CompilerInvocation CInvok(origCI);
CInvok.getFrontendOpts().Inputs.clear();
- CInvok.getFrontendOpts().Inputs.push_back(std::make_pair(Kind, Filename));
+ CInvok.getFrontendOpts().Inputs.push_back(Input);
MigrationProcess migration(CInvok, DiagClient, outputDir);
@@ -357,20 +358,20 @@
}
bool arcmt::applyTransformations(CompilerInvocation &origCI,
- StringRef Filename, InputKind Kind,
+ const FrontendInputFile &Input,
DiagnosticConsumer *DiagClient) {
- return applyTransforms(origCI, Filename, Kind, DiagClient,
+ return applyTransforms(origCI, Input, DiagClient,
StringRef(), false, StringRef());
}
bool arcmt::migrateWithTemporaryFiles(CompilerInvocation &origCI,
- StringRef Filename, InputKind Kind,
+ const FrontendInputFile &Input,
DiagnosticConsumer *DiagClient,
StringRef outputDir,
bool emitPremigrationARCErrors,
StringRef plistOut) {
assert(!outputDir.empty() && "Expected output directory path");
- return applyTransforms(origCI, Filename, Kind, DiagClient,
+ return applyTransforms(origCI, Input, DiagClient,
outputDir, emitPremigrationARCErrors, plistOut);
}
Modified: cfe/branches/tooling/lib/ARCMigrate/ARCMTActions.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/ARCMigrate/ARCMTActions.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/ARCMigrate/ARCMTActions.cpp (original)
+++ cfe/branches/tooling/lib/ARCMigrate/ARCMTActions.cpp Mon Jan 23 02:39:37 2012
@@ -15,8 +15,7 @@
using namespace arcmt;
bool CheckAction::BeginInvocation(CompilerInstance &CI) {
- if (arcmt::checkForManualIssues(CI.getInvocation(), getCurrentFile(),
- getCurrentFileKind(),
+ if (arcmt::checkForManualIssues(CI.getInvocation(), getCurrentInput(),
CI.getDiagnostics().getClient()))
return false; // errors, stop the action.
@@ -29,8 +28,7 @@
: WrapperFrontendAction(WrappedAction) {}
bool ModifyAction::BeginInvocation(CompilerInstance &CI) {
- return !arcmt::applyTransformations(CI.getInvocation(),
- getCurrentFile(), getCurrentFileKind(),
+ return !arcmt::applyTransformations(CI.getInvocation(), getCurrentInput(),
CI.getDiagnostics().getClient());
}
@@ -39,12 +37,11 @@
bool MigrateAction::BeginInvocation(CompilerInstance &CI) {
if (arcmt::migrateWithTemporaryFiles(CI.getInvocation(),
- getCurrentFile(),
- getCurrentFileKind(),
- CI.getDiagnostics().getClient(),
- MigrateDir,
- EmitPremigrationARCErros,
- PlistOut))
+ getCurrentInput(),
+ CI.getDiagnostics().getClient(),
+ MigrateDir,
+ EmitPremigrationARCErros,
+ PlistOut))
return false; // errors, stop the action.
// We only want to see diagnostics emitted by migrateWithTemporaryFiles.
Modified: cfe/branches/tooling/lib/ARCMigrate/TransProperties.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/ARCMigrate/TransProperties.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/ARCMigrate/TransProperties.cpp (original)
+++ cfe/branches/tooling/lib/ARCMigrate/TransProperties.cpp Mon Jan 23 02:39:37 2012
@@ -50,7 +50,7 @@
enum PropActionKind {
PropAction_None,
- PropAction_RetainRemoved,
+ PropAction_RetainReplacedWithStrong,
PropAction_AssignRemoved,
PropAction_AssignRewritten,
PropAction_MaybeAddWeakOrUnsafe
@@ -161,9 +161,11 @@
switch (kind) {
case PropAction_None:
return;
- case PropAction_RetainRemoved:
- removeAttribute("retain", atLoc);
+ case PropAction_RetainReplacedWithStrong: {
+ StringRef toAttr = "strong";
+ MigrateCtx.rewritePropertyAttribute("retain", toAttr, atLoc);
return;
+ }
case PropAction_AssignRemoved:
return removeAssignForDefaultStrong(props, atLoc);
case PropAction_AssignRewritten:
@@ -193,16 +195,14 @@
if (propAttrs & ObjCPropertyDecl::OBJC_PR_retain) {
// strong is the default.
- return doPropAction(PropAction_RetainRemoved, props, atLoc);
+ return doPropAction(PropAction_RetainReplacedWithStrong, props, atLoc);
}
bool HasIvarAssignedAPlusOneObject = hasIvarAssignedAPlusOneObject(props);
if (propAttrs & ObjCPropertyDecl::OBJC_PR_assign) {
- if (HasIvarAssignedAPlusOneObject ||
- (Pass.isGCMigration() && !hasGCWeak(props, atLoc))) {
+ if (HasIvarAssignedAPlusOneObject)
return doPropAction(PropAction_AssignRemoved, props, atLoc);
- }
return doPropAction(PropAction_AssignRewritten, props, atLoc);
}
@@ -229,19 +229,23 @@
void rewriteAssign(PropsTy &props, SourceLocation atLoc) const {
bool canUseWeak = canApplyWeak(Pass.Ctx, getPropertyType(props),
/*AllowOnUnknownClass=*/Pass.isGCMigration());
+ const char *toWhich =
+ (Pass.isGCMigration() && !hasGCWeak(props, atLoc)) ? "strong" :
+ (canUseWeak ? "weak" : "unsafe_unretained");
- bool rewroteAttr = rewriteAttribute("assign",
- canUseWeak ? "weak" : "unsafe_unretained",
- atLoc);
+ bool rewroteAttr = rewriteAttribute("assign", toWhich, atLoc);
if (!rewroteAttr)
canUseWeak = false;
for (PropsTy::iterator I = props.begin(), E = props.end(); I != E; ++I) {
if (isUserDeclared(I->IvarD)) {
if (I->IvarD &&
- I->IvarD->getType().getObjCLifetime() != Qualifiers::OCL_Weak)
- Pass.TA.insert(I->IvarD->getLocation(),
- canUseWeak ? "__weak " : "__unsafe_unretained ");
+ I->IvarD->getType().getObjCLifetime() != Qualifiers::OCL_Weak) {
+ const char *toWhich =
+ (Pass.isGCMigration() && !hasGCWeak(props, atLoc)) ? "__strong " :
+ (canUseWeak ? "__weak " : "__unsafe_unretained ");
+ Pass.TA.insert(I->IvarD->getLocation(), toWhich);
+ }
}
if (I->ImplD)
Pass.TA.clearDiagnostic(diag::err_arc_assign_property_ownership,
Modified: cfe/branches/tooling/lib/AST/ASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/AST/ASTContext.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/AST/ASTContext.cpp (original)
+++ cfe/branches/tooling/lib/AST/ASTContext.cpp Mon Jan 23 02:39:37 2012
@@ -6468,6 +6468,9 @@
case 'D':
Type = Context.getVolatileType(Type);
break;
+ case 'R':
+ Type = Type.withRestrict();
+ break;
}
}
Modified: cfe/branches/tooling/lib/AST/ASTImporter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/AST/ASTImporter.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/AST/ASTImporter.cpp (original)
+++ cfe/branches/tooling/lib/AST/ASTImporter.cpp Mon Jan 23 02:39:37 2012
@@ -332,7 +332,6 @@
}
llvm_unreachable("Invalid template argument kind");
- return true;
}
/// \brief Determine structural equivalence for the common part of array
@@ -1357,8 +1356,8 @@
// wchar_t?
return Importer.getToContext().WCharTy;
}
-
- return QualType();
+
+ llvm_unreachable("Invalid BuiltinType Kind!");
}
QualType ASTNodeImporter::VisitComplexType(const ComplexType *T) {
@@ -1983,7 +1982,6 @@
}
llvm_unreachable("Invalid template argument kind");
- return TemplateArgument();
}
bool ASTNodeImporter::ImportTemplateArguments(const TemplateArgument *FromArgs,
@@ -4214,7 +4212,6 @@
}
llvm_unreachable("Invalid nested name specifier kind");
- return 0;
}
NestedNameSpecifierLoc ASTImporter::Import(NestedNameSpecifierLoc FromNNS) {
@@ -4309,7 +4306,6 @@
}
llvm_unreachable("Invalid template name kind");
- return TemplateName();
}
SourceLocation ASTImporter::Import(SourceLocation FromLoc) {
@@ -4453,8 +4449,7 @@
return DeclarationName::getUsingDirectiveName();
}
- // Silence bogus GCC warning
- return DeclarationName();
+ llvm_unreachable("Invalid DeclarationName Kind!");
}
IdentifierInfo *ASTImporter::Import(const IdentifierInfo *FromId) {
Modified: cfe/branches/tooling/lib/AST/Decl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/AST/Decl.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/AST/Decl.cpp (original)
+++ cfe/branches/tooling/lib/AST/Decl.cpp Mon Jan 23 02:39:37 2012
@@ -48,8 +48,6 @@
case VisibilityAttr::Protected:
return ProtectedVisibility;
}
-
- return DefaultVisibility;
}
// If we're on Mac OS X, an 'availability' for Mac OS X attribute
@@ -1141,7 +1139,6 @@
}
llvm_unreachable("Invalid storage class");
- return 0;
}
VarDecl *VarDecl::Create(ASTContext &C, DeclContext *DC,
Modified: cfe/branches/tooling/lib/AST/DeclBase.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/AST/DeclBase.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/AST/DeclBase.cpp (original)
+++ cfe/branches/tooling/lib/AST/DeclBase.cpp Mon Jan 23 02:39:37 2012
@@ -529,7 +529,7 @@
return 0;
}
- return 0;
+ llvm_unreachable("Invalid DeclKind!");
}
void Decl::setAttrs(const AttrVec &attrs) {
Modified: cfe/branches/tooling/lib/AST/DeclarationName.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/AST/DeclarationName.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/AST/DeclarationName.cpp (original)
+++ cfe/branches/tooling/lib/AST/DeclarationName.cpp Mon Jan 23 02:39:37 2012
@@ -125,8 +125,8 @@
case DeclarationName::CXXUsingDirective:
return 0;
}
-
- return 0;
+
+ llvm_unreachable("Invalid DeclarationName Kind!");
}
} // end namespace clang
@@ -189,7 +189,6 @@
return ObjCMultiArgSelector;
}
- break;
}
// Can't actually get here.
Modified: cfe/branches/tooling/lib/AST/DumpXML.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/AST/DumpXML.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/AST/DumpXML.cpp (original)
+++ cfe/branches/tooling/lib/AST/DumpXML.cpp Mon Jan 23 02:39:37 2012
@@ -165,7 +165,6 @@
}
llvm_unreachable("unknown type kind!");
- return "unknown_type";
}
struct XMLDumper : public XMLDeclVisitor<XMLDumper>,
Modified: cfe/branches/tooling/lib/AST/Expr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/AST/Expr.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/AST/Expr.cpp (original)
+++ cfe/branches/tooling/lib/AST/Expr.cpp Mon Jan 23 02:39:37 2012
@@ -124,7 +124,6 @@
#include "clang/AST/StmtNodes.inc"
}
llvm_unreachable("unknown statement kind");
- return SourceLocation();
}
//===----------------------------------------------------------------------===//
@@ -1213,7 +1212,6 @@
}
llvm_unreachable("Unhandled cast kind!");
- return 0;
}
Expr *CastExpr::getSubExprAsWritten() {
@@ -1255,7 +1253,6 @@
#include "clang/AST/StmtNodes.inc"
default:
llvm_unreachable("non-cast expressions not possible here");
- return 0;
}
}
@@ -1343,7 +1340,7 @@
case BO_Comma: return ",";
}
- return "";
+ llvm_unreachable("Invalid OpCode!");
}
BinaryOperatorKind
@@ -3015,7 +3012,7 @@
return getSuperLoc();
}
- return SourceLocation();
+ llvm_unreachable("Invalid ReceiverKind!");
}
Selector ObjCMessageExpr::getSelector() const {
@@ -3064,8 +3061,8 @@
case OBC_BridgeRetained:
return "__bridge_retained";
}
-
- return "__bridge";
+
+ llvm_unreachable("Invalid BridgeKind!");
}
bool ChooseExpr::isConditionTrue(const ASTContext &C) const {
Modified: cfe/branches/tooling/lib/AST/ExprClassification.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/AST/ExprClassification.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/AST/ExprClassification.cpp (original)
+++ cfe/branches/tooling/lib/AST/ExprClassification.cpp Mon Jan 23 02:39:37 2012
@@ -47,7 +47,6 @@
return Cl::CL_XValue;
}
llvm_unreachable("Invalid value category of implicit cast.");
- return Cl::CL_PRValue;
}
Cl Expr::ClassifyImpl(ASTContext &Ctx, SourceLocation *Loc) const {
@@ -99,7 +98,6 @@
#define EXPR(Kind, Base)
#include "clang/AST/StmtNodes.inc"
llvm_unreachable("cannot classify a statement");
- break;
// First come the expressions that are always lvalues, unconditionally.
case Expr::ObjCIsaExprClass:
@@ -371,7 +369,6 @@
}
llvm_unreachable("unhandled expression kind in classification");
- return Cl::CL_LValue;
}
/// ClassifyDecl - Return the classification of an expression referencing the
Modified: cfe/branches/tooling/lib/AST/ExprConstant.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/AST/ExprConstant.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/AST/ExprConstant.cpp (original)
+++ cfe/branches/tooling/lib/AST/ExprConstant.cpp Mon Jan 23 02:39:37 2012
@@ -3756,7 +3756,6 @@
return union_type_class;
else // FIXME: offset_type_class, method_type_class, & lang_type_class?
llvm_unreachable("CallExpr::isBuiltinClassifyType(): unimplemented type");
- return -1;
}
/// EvaluateBuiltinConstantPForLValue - Determine the result of
@@ -4385,7 +4384,6 @@
}
llvm_unreachable("unknown expr/type trait");
- return Error(E);
}
bool IntExprEvaluator::VisitOffsetOfExpr(const OffsetOfExpr *OOE) {
@@ -4427,7 +4425,6 @@
case OffsetOfExpr::OffsetOfNode::Identifier:
llvm_unreachable("dependent __builtin_offsetof");
- return Error(OOE);
case OffsetOfExpr::OffsetOfNode::Base: {
CXXBaseSpecifier *BaseSpec = ON.getBase();
@@ -4618,7 +4615,6 @@
}
llvm_unreachable("unknown cast resulting in integral value");
- return Error(E);
}
bool IntExprEvaluator::VisitUnaryReal(const UnaryOperator *E) {
@@ -4881,8 +4877,6 @@
return true;
}
}
-
- return Error(E);
}
//===----------------------------------------------------------------------===//
@@ -5092,7 +5086,6 @@
}
llvm_unreachable("unknown cast resulting in complex value");
- return Error(E);
}
bool ComplexExprEvaluator::VisitBinaryOperator(const BinaryOperator *E) {
@@ -5928,8 +5921,7 @@
}
}
- // Silence a GCC warning
- return ICEDiag(2, E->getLocStart());
+ llvm_unreachable("Invalid StmtClass!");
}
/// Evaluate an expression as a C++11 integral constant expression.
Modified: cfe/branches/tooling/lib/AST/ItaniumMangle.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/AST/ItaniumMangle.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/AST/ItaniumMangle.cpp (original)
+++ cfe/branches/tooling/lib/AST/ItaniumMangle.cpp Mon Jan 23 02:39:37 2012
@@ -1370,7 +1370,6 @@
case TemplateName::OverloadedTemplate:
llvm_unreachable("can't mangle an overloaded template name as a <type>");
- break;
case TemplateName::DependentTemplate: {
const DependentTemplateName *Dependent = TN.getAsDependentTemplateName();
@@ -1741,7 +1740,6 @@
#include "clang/AST/BuiltinTypes.def"
case BuiltinType::Dependent:
llvm_unreachable("mangling a placeholder type");
- break;
case BuiltinType::ObjCId: Out << "11objc_object"; break;
case BuiltinType::ObjCClass: Out << "10objc_class"; break;
case BuiltinType::ObjCSel: Out << "13objc_selector"; break;
@@ -2226,7 +2224,6 @@
case Expr::ParenListExprClass:
case Expr::CXXScalarValueInitExprClass:
llvm_unreachable("unexpected statement kind");
- break;
// FIXME: invent manglings for all these.
case Expr::BlockExprClass:
Modified: cfe/branches/tooling/lib/AST/NestedNameSpecifier.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/AST/NestedNameSpecifier.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/AST/NestedNameSpecifier.cpp (original)
+++ cfe/branches/tooling/lib/AST/NestedNameSpecifier.cpp Mon Jan 23 02:39:37 2012
@@ -130,7 +130,7 @@
return TypeSpecWithTemplate;
}
- return Global;
+ llvm_unreachable("Invalid NNS Kind!");
}
/// \brief Retrieve the namespace stored in this nested name
@@ -170,8 +170,7 @@
return getAsType()->isDependentType();
}
- // Necessary to suppress a GCC warning.
- return false;
+ llvm_unreachable("Invalid NNS Kind!");
}
/// \brief Whether this nested name specifier refers to a dependent
@@ -191,9 +190,8 @@
case TypeSpecWithTemplate:
return getAsType()->isInstantiationDependentType();
}
-
- // Necessary to suppress a GCC warning.
- return false;
+
+ llvm_unreachable("Invalid NNS Kind!");
}
bool NestedNameSpecifier::containsUnexpandedParameterPack() const {
@@ -211,8 +209,7 @@
return getAsType()->containsUnexpandedParameterPack();
}
- // Necessary to suppress a GCC warning.
- return false;
+ llvm_unreachable("Invalid NNS Kind!");
}
/// \brief Print this nested name specifier to the given output
@@ -382,8 +379,8 @@
LoadSourceLocation(Data, Offset + sizeof(void*)));
}
}
-
- return SourceRange();
+
+ llvm_unreachable("Invalid NNS Kind!");
}
TypeLoc NestedNameSpecifierLoc::getTypeLoc() const {
Modified: cfe/branches/tooling/lib/AST/Stmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/AST/Stmt.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/AST/Stmt.cpp (original)
+++ cfe/branches/tooling/lib/AST/Stmt.cpp Mon Jan 23 02:39:37 2012
@@ -164,7 +164,6 @@
#include "clang/AST/StmtNodes.inc"
}
llvm_unreachable("unknown statement kind!");
- return child_range();
}
SourceRange Stmt::getSourceRange() const {
@@ -177,7 +176,6 @@
#include "clang/AST/StmtNodes.inc"
}
llvm_unreachable("unknown statement kind!");
- return SourceRange();
}
void CompoundStmt::setStmts(ASTContext &C, Stmt **Stmts, unsigned NumStmts) {
Modified: cfe/branches/tooling/lib/AST/StmtProfile.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/AST/StmtProfile.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/AST/StmtProfile.cpp (original)
+++ cfe/branches/tooling/lib/AST/StmtProfile.cpp Mon Jan 23 02:39:37 2012
@@ -503,7 +503,6 @@
case OO_Conditional:
case NUM_OVERLOADED_OPERATORS:
llvm_unreachable("Invalid operator call kind");
- return Stmt::ArraySubscriptExprClass;
case OO_Plus:
if (S->getNumArgs() == 1) {
Modified: cfe/branches/tooling/lib/AST/TemplateBase.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/AST/TemplateBase.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/AST/TemplateBase.cpp (original)
+++ cfe/branches/tooling/lib/AST/TemplateBase.cpp Mon Jan 23 02:39:37 2012
@@ -100,7 +100,7 @@
return false;
}
- return false;
+ llvm_unreachable("Invalid TemplateArgument Kind!");
}
bool TemplateArgument::isInstantiationDependent() const {
@@ -137,8 +137,8 @@
return false;
}
-
- return false;
+
+ llvm_unreachable("Invalid TemplateArgument Kind!");
}
bool TemplateArgument::isPackExpansion() const {
@@ -159,8 +159,8 @@
case Expression:
return isa<PackExpansionExpr>(getAsExpr());
}
-
- return false;
+
+ llvm_unreachable("Invalid TemplateArgument Kind!");
}
bool TemplateArgument::containsUnexpandedParameterPack() const {
@@ -278,8 +278,7 @@
return true;
}
- // Suppress warnings.
- return false;
+ llvm_unreachable("Invalid TemplateArgument Kind!");
}
TemplateArgument TemplateArgument::getPackExpansionPattern() const {
@@ -302,8 +301,8 @@
case Template:
return TemplateArgument();
}
-
- return TemplateArgument();
+
+ llvm_unreachable("Invalid TemplateArgument Kind!");
}
void TemplateArgument::print(const PrintingPolicy &Policy,
@@ -412,8 +411,7 @@
return SourceRange();
}
- // Silence bonus gcc warning.
- return SourceRange();
+ llvm_unreachable("Invalid TemplateArgument Kind!");
}
TemplateArgumentLoc
@@ -474,8 +472,8 @@
case TemplateArgument::Null:
return TemplateArgumentLoc();
}
-
- return TemplateArgumentLoc();
+
+ llvm_unreachable("Invalid TemplateArgument Kind!");
}
const DiagnosticBuilder &clang::operator<<(const DiagnosticBuilder &DB,
@@ -525,8 +523,8 @@
return DB << OS.str();
}
}
-
- return DB;
+
+ llvm_unreachable("Invalid TemplateArgument Kind!");
}
const ASTTemplateArgumentListInfo *
Modified: cfe/branches/tooling/lib/AST/Type.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/AST/Type.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/AST/Type.cpp (original)
+++ cfe/branches/tooling/lib/AST/Type.cpp Mon Jan 23 02:39:37 2012
@@ -1364,7 +1364,6 @@
}
llvm_unreachable("Type specifier is not a tag type kind.");
- return TTK_Union;
}
ElaboratedTypeKeyword
@@ -1419,7 +1418,6 @@
}
llvm_unreachable("Unknown elaborated type keyword.");
- return "";
}
DependentTemplateSpecializationType::DependentTemplateSpecializationType(
@@ -1479,7 +1477,6 @@
}
llvm_unreachable("Invalid type class.");
- return 0;
}
const char *BuiltinType::getName(const PrintingPolicy &Policy) const {
@@ -1521,7 +1518,6 @@
}
llvm_unreachable("Invalid builtin type.");
- return 0;
}
QualType QualType::getNonLValueExprType(ASTContext &Context) const {
@@ -1544,7 +1540,6 @@
switch (CC) {
case CC_Default:
llvm_unreachable("no name for default cc");
- return "";
case CC_C: return "cdecl";
case CC_X86StdCall: return "stdcall";
@@ -1556,7 +1551,6 @@
}
llvm_unreachable("Invalid calling convention.");
- return "";
}
FunctionProtoType::FunctionProtoType(QualType result, const QualType *args,
Modified: cfe/branches/tooling/lib/AST/TypeLoc.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/AST/TypeLoc.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/AST/TypeLoc.cpp (original)
+++ cfe/branches/tooling/lib/AST/TypeLoc.cpp Mon Jan 23 02:39:37 2012
@@ -196,57 +196,54 @@
TypeSpecifierType BuiltinTypeLoc::getWrittenTypeSpec() const {
if (needsExtraLocalData())
return static_cast<TypeSpecifierType>(getWrittenBuiltinSpecs().Type);
- else {
- switch (getTypePtr()->getKind()) {
- case BuiltinType::Void:
- return TST_void;
- case BuiltinType::Bool:
- return TST_bool;
- case BuiltinType::Char_U:
- case BuiltinType::Char_S:
- return TST_char;
- case BuiltinType::Char16:
- return TST_char16;
- case BuiltinType::Char32:
- return TST_char32;
- case BuiltinType::WChar_S:
- case BuiltinType::WChar_U:
- return TST_wchar;
-
- case BuiltinType::UChar:
- case BuiltinType::UShort:
- case BuiltinType::UInt:
- case BuiltinType::ULong:
- case BuiltinType::ULongLong:
- case BuiltinType::UInt128:
- case BuiltinType::SChar:
- case BuiltinType::Short:
- case BuiltinType::Int:
- case BuiltinType::Long:
- case BuiltinType::LongLong:
- case BuiltinType::Int128:
- case BuiltinType::Half:
- case BuiltinType::Float:
- case BuiltinType::Double:
- case BuiltinType::LongDouble:
- llvm_unreachable("Builtin type needs extra local data!");
- // Fall through, if the impossible happens.
-
- case BuiltinType::NullPtr:
- case BuiltinType::Overload:
- case BuiltinType::Dependent:
- case BuiltinType::BoundMember:
- case BuiltinType::UnknownAny:
- case BuiltinType::ARCUnbridgedCast:
- case BuiltinType::PseudoObject:
- case BuiltinType::ObjCId:
- case BuiltinType::ObjCClass:
- case BuiltinType::ObjCSel:
- return TST_unspecified;
- }
+ switch (getTypePtr()->getKind()) {
+ case BuiltinType::Void:
+ return TST_void;
+ case BuiltinType::Bool:
+ return TST_bool;
+ case BuiltinType::Char_U:
+ case BuiltinType::Char_S:
+ return TST_char;
+ case BuiltinType::Char16:
+ return TST_char16;
+ case BuiltinType::Char32:
+ return TST_char32;
+ case BuiltinType::WChar_S:
+ case BuiltinType::WChar_U:
+ return TST_wchar;
+ case BuiltinType::UChar:
+ case BuiltinType::UShort:
+ case BuiltinType::UInt:
+ case BuiltinType::ULong:
+ case BuiltinType::ULongLong:
+ case BuiltinType::UInt128:
+ case BuiltinType::SChar:
+ case BuiltinType::Short:
+ case BuiltinType::Int:
+ case BuiltinType::Long:
+ case BuiltinType::LongLong:
+ case BuiltinType::Int128:
+ case BuiltinType::Half:
+ case BuiltinType::Float:
+ case BuiltinType::Double:
+ case BuiltinType::LongDouble:
+ llvm_unreachable("Builtin type needs extra local data!");
+ // Fall through, if the impossible happens.
+
+ case BuiltinType::NullPtr:
+ case BuiltinType::Overload:
+ case BuiltinType::Dependent:
+ case BuiltinType::BoundMember:
+ case BuiltinType::UnknownAny:
+ case BuiltinType::ARCUnbridgedCast:
+ case BuiltinType::PseudoObject:
+ case BuiltinType::ObjCId:
+ case BuiltinType::ObjCClass:
+ case BuiltinType::ObjCSel:
+ return TST_unspecified;
}
-
- return TST_unspecified;
+
+ llvm_unreachable("Invalid BuiltinType Kind!");
}
TypeLoc TypeLoc::IgnoreParensImpl(TypeLoc TL) {
Modified: cfe/branches/tooling/lib/AST/TypePrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/AST/TypePrinter.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/AST/TypePrinter.cpp (original)
+++ cfe/branches/tooling/lib/AST/TypePrinter.cpp Mon Jan 23 02:39:37 2012
@@ -934,7 +934,7 @@
case AttributedType::attr_objc_ownership:
S += "objc_ownership(";
switch (T->getEquivalentType().getObjCLifetime()) {
- case Qualifiers::OCL_None: llvm_unreachable("no ownership!"); break;
+ case Qualifiers::OCL_None: llvm_unreachable("no ownership!");
case Qualifiers::OCL_ExplicitNone: S += "none"; break;
case Qualifiers::OCL_Strong: S += "strong"; break;
case Qualifiers::OCL_Weak: S += "weak"; break;
Modified: cfe/branches/tooling/lib/Analysis/CFG.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Analysis/CFG.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Analysis/CFG.cpp (original)
+++ cfe/branches/tooling/lib/Analysis/CFG.cpp Mon Jan 23 02:39:37 2012
@@ -3090,7 +3090,6 @@
return 0;
}
llvm_unreachable("getKind() returned bogus value");
- return 0;
}
bool CFGImplicitDtor::isNoReturn(ASTContext &astContext) const {
Modified: cfe/branches/tooling/lib/Analysis/CocoaConventions.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Analysis/CocoaConventions.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Analysis/CocoaConventions.cpp (original)
+++ cfe/branches/tooling/lib/Analysis/CocoaConventions.cpp Mon Jan 23 02:39:37 2012
@@ -58,7 +58,6 @@
return CreateRule;
}
llvm_unreachable("unexpected naming convention");
- return NoConvention;
}
bool cocoa::isRefType(QualType RetTy, StringRef Prefix,
@@ -176,6 +175,4 @@
// If we matched a lowercase character, it isn't the end of the
// word. Keep scanning.
}
-
- return false;
}
Modified: cfe/branches/tooling/lib/Analysis/FormatString.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Analysis/FormatString.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Analysis/FormatString.cpp (original)
+++ cfe/branches/tooling/lib/Analysis/FormatString.cpp Mon Jan 23 02:39:37 2012
@@ -340,9 +340,7 @@
return argTy->getAs<ObjCObjectPointerType>() != NULL;
}
- // FIXME: Should be unreachable, but Clang is currently emitting
- // a warning.
- return false;
+ llvm_unreachable("Invalid ArgTypeResult Kind!");
}
QualType ArgTypeResult::getRepresentativeType(ASTContext &C) const {
@@ -369,9 +367,7 @@
}
}
- // FIXME: Should be unreachable, but Clang is currently emitting
- // a warning.
- return QualType();
+ llvm_unreachable("Invalid ArgTypeResult Kind!");
}
std::string ArgTypeResult::getRepresentativeTypeName(ASTContext &C) const {
@@ -535,6 +531,7 @@
case ConversionSpecifier::nArg:
case ConversionSpecifier::cArg:
case ConversionSpecifier::sArg:
+ case ConversionSpecifier::ScanListArg:
return true;
default:
return false;
@@ -577,5 +574,5 @@
return false;
}
}
- return false;
+ llvm_unreachable("Invalid LengthModifier Kind!");
}
Modified: cfe/branches/tooling/lib/Analysis/ScanfFormatString.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Analysis/ScanfFormatString.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Analysis/ScanfFormatString.cpp (original)
+++ cfe/branches/tooling/lib/Analysis/ScanfFormatString.cpp Mon Jan 23 02:39:37 2012
@@ -462,7 +462,7 @@
}
}
- return false; // Unreachable, but we still get a warning.
+ llvm_unreachable("Invalid ScanfArgTypeResult Kind!");
}
QualType ScanfArgTypeResult::getRepresentativeType(ASTContext &C) const {
@@ -479,7 +479,7 @@
return C.getPointerType(A.getRepresentativeType(C));
}
- return QualType(); // Not reachable.
+ llvm_unreachable("Invalid ScanfArgTypeResult Kind!");
}
std::string ScanfArgTypeResult::getRepresentativeTypeName(ASTContext& C) const {
Modified: cfe/branches/tooling/lib/Analysis/ThreadSafety.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Analysis/ThreadSafety.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Analysis/ThreadSafety.cpp (original)
+++ cfe/branches/tooling/lib/Analysis/ThreadSafety.cpp Mon Jan 23 02:39:37 2012
@@ -88,38 +88,46 @@
/// Recursive function that terminates on DeclRefExpr.
/// Note: this function merely creates a MutexID; it does not check to
/// ensure that the original expression is a valid mutex expression.
- void buildMutexID(Expr *Exp, Expr *Parent, int NumArgs,
- const NamedDecl **FunArgDecls, Expr **FunArgs) {
+ void buildMutexID(Expr *Exp, const NamedDecl *D, Expr *Parent,
+ unsigned NumArgs, Expr **FunArgs) {
if (!Exp) {
DeclSeq.clear();
return;
}
if (DeclRefExpr *DRE = dyn_cast<DeclRefExpr>(Exp)) {
- if (FunArgDecls) {
- // Substitute call arguments for references to function parameters
- for (int i = 0; i < NumArgs; ++i) {
- if (DRE->getDecl() == FunArgDecls[i]) {
- buildMutexID(FunArgs[i], 0, 0, 0, 0);
- return;
- }
+ NamedDecl *ND = cast<NamedDecl>(DRE->getDecl()->getCanonicalDecl());
+ ParmVarDecl *PV = dyn_cast_or_null<ParmVarDecl>(ND);
+ if (PV) {
+ FunctionDecl *FD =
+ cast<FunctionDecl>(PV->getDeclContext())->getCanonicalDecl();
+ unsigned i = PV->getFunctionScopeIndex();
+
+ if (FunArgs && FD == D->getCanonicalDecl()) {
+ // Substitute call arguments for references to function parameters
+ assert(i < NumArgs);
+ buildMutexID(FunArgs[i], D, 0, 0, 0);
+ return;
}
+ // Map the param back to the param of the original function declaration.
+ DeclSeq.push_back(FD->getParamDecl(i));
+ return;
}
- NamedDecl *ND = cast<NamedDecl>(DRE->getDecl()->getCanonicalDecl());
+ // Not a function parameter -- just store the reference.
DeclSeq.push_back(ND);
} else if (MemberExpr *ME = dyn_cast<MemberExpr>(Exp)) {
NamedDecl *ND = ME->getMemberDecl();
DeclSeq.push_back(ND);
- buildMutexID(ME->getBase(), Parent, NumArgs, FunArgDecls, FunArgs);
+ buildMutexID(ME->getBase(), D, Parent, NumArgs, FunArgs);
} else if (isa<CXXThisExpr>(Exp)) {
if (Parent)
- buildMutexID(Parent, 0, 0, 0, 0);
+ buildMutexID(Parent, D, 0, 0, 0);
else
return; // mutexID is still valid in this case
} else if (UnaryOperator *UOE = dyn_cast<UnaryOperator>(Exp))
- buildMutexID(UOE->getSubExpr(), Parent, NumArgs, FunArgDecls, FunArgs);
+ buildMutexID(UOE->getSubExpr(), D, Parent, NumArgs, FunArgs);
else if (CastExpr *CE = dyn_cast<CastExpr>(Exp))
- buildMutexID(CE->getSubExpr(), Parent, NumArgs, FunArgDecls, FunArgs);
+ buildMutexID(CE->getSubExpr(), D, Parent, NumArgs, FunArgs);
else
DeclSeq.clear(); // Mark as invalid lock expression.
}
@@ -133,11 +141,10 @@
Expr *Parent = 0;
unsigned NumArgs = 0;
Expr **FunArgs = 0;
- SmallVector<const NamedDecl*, 8> FunArgDecls;
// If we are processing a raw attribute expression, with no substitutions.
if (DeclExp == 0) {
- buildMutexID(MutexExp, 0, 0, 0, 0);
+ buildMutexID(MutexExp, D, 0, 0, 0);
return;
}
@@ -163,17 +170,11 @@
// If the attribute has no arguments, then assume the argument is "this".
if (MutexExp == 0) {
- buildMutexID(Parent, 0, 0, 0, 0);
+ buildMutexID(Parent, D, 0, 0, 0);
return;
}
- // FIXME: handle default arguments
- if (const FunctionDecl *FD = dyn_cast_or_null<FunctionDecl>(D)) {
- for (unsigned i = 0, ni = FD->getNumParams(); i < ni && i < NumArgs; ++i) {
- FunArgDecls.push_back(FD->getParamDecl(i));
- }
- }
- buildMutexID(MutexExp, Parent, NumArgs, &FunArgDecls.front(), FunArgs);
+ buildMutexID(MutexExp, D, Parent, NumArgs, FunArgs);
}
public:
Modified: cfe/branches/tooling/lib/Basic/Targets.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Basic/Targets.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Basic/Targets.cpp (original)
+++ cfe/branches/tooling/lib/Basic/Targets.cpp Mon Jan 23 02:39:37 2012
@@ -148,7 +148,7 @@
}
}
- // If -ccc-host-triple arch-pc-win32-macho option specified, we're
+ // If -target arch-pc-win32-macho option specified, we're
// generating code for Win32 ABI. No need to emit
// __ENVIRONMENT_XX_OS_VERSION_MIN_REQUIRED__.
if (PlatformName == "win32") {
Modified: cfe/branches/tooling/lib/CodeGen/CGBuiltin.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/CodeGen/CGBuiltin.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/CodeGen/CGBuiltin.cpp (original)
+++ cfe/branches/tooling/lib/CodeGen/CGBuiltin.cpp Mon Jan 23 02:39:37 2012
@@ -4577,5 +4577,4 @@
return Builder.CreateCall(F, Ops, "");
}
}
- return 0;
}
Modified: cfe/branches/tooling/lib/CodeGen/CGCall.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/CodeGen/CGCall.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/CodeGen/CGCall.cpp (original)
+++ cfe/branches/tooling/lib/CodeGen/CGCall.cpp Mon Jan 23 02:39:37 2012
@@ -733,8 +733,8 @@
const Decl *TargetDecl,
AttributeListType &PAL,
unsigned &CallingConv) {
- unsigned FuncAttrs = 0;
- unsigned RetAttrs = 0;
+ llvm::Attributes FuncAttrs;
+ llvm::Attributes RetAttrs;
CallingConv = FI.getEffectiveCallingConvention();
@@ -820,7 +820,7 @@
ie = FI.arg_end(); it != ie; ++it) {
QualType ParamType = it->type;
const ABIArgInfo &AI = it->info;
- unsigned Attributes = 0;
+ llvm::Attributes Attrs;
// 'restrict' -> 'noalias' is done in EmitFunctionProlog when we
// have the corresponding parameter variable. It doesn't make
@@ -828,9 +828,9 @@
switch (AI.getKind()) {
case ABIArgInfo::Extend:
if (ParamType->isSignedIntegerOrEnumerationType())
- Attributes |= llvm::Attribute::SExt;
+ Attrs |= llvm::Attribute::SExt;
else if (ParamType->isUnsignedIntegerOrEnumerationType())
- Attributes |= llvm::Attribute::ZExt;
+ Attrs |= llvm::Attribute::ZExt;
// FALL THROUGH
case ABIArgInfo::Direct:
if (RegParm > 0 &&
@@ -839,7 +839,7 @@
RegParm -=
(Context.getTypeSize(ParamType) + PointerWidth - 1) / PointerWidth;
if (RegParm >= 0)
- Attributes |= llvm::Attribute::InReg;
+ Attrs |= llvm::Attribute::InReg;
}
// FIXME: handle sseregparm someday...
@@ -853,9 +853,9 @@
case ABIArgInfo::Indirect:
if (AI.getIndirectByVal())
- Attributes |= llvm::Attribute::ByVal;
+ Attrs |= llvm::Attribute::ByVal;
- Attributes |=
+ Attrs |=
llvm::Attribute::constructAlignmentFromInt(AI.getIndirectAlign());
// byval disables readnone and readonly.
FuncAttrs &= ~(llvm::Attribute::ReadOnly |
@@ -877,8 +877,8 @@
}
}
- if (Attributes)
- PAL.push_back(llvm::AttributeWithIndex::get(Index, Attributes));
+ if (Attrs)
+ PAL.push_back(llvm::AttributeWithIndex::get(Index, Attrs));
++Index;
}
if (FuncAttrs)
Modified: cfe/branches/tooling/lib/CodeGen/CGCleanup.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/CodeGen/CGCleanup.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/CodeGen/CGCleanup.cpp (original)
+++ cfe/branches/tooling/lib/CodeGen/CGCleanup.cpp Mon Jan 23 02:39:37 2012
@@ -84,7 +84,6 @@
}
llvm_unreachable("bad saved r-value kind");
- return RValue();
}
/// Push an entry of the given size onto this protected-scope stack.
Modified: cfe/branches/tooling/lib/CodeGen/CGDebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/CodeGen/CGDebugInfo.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/branches/tooling/lib/CodeGen/CGDebugInfo.cpp Mon Jan 23 02:39:37 2012
@@ -479,6 +479,53 @@
Ty->getPointeeType(), Unit);
}
+// Walk up the context chain and create forward decls for record decls,
+// and normal descriptors for namespaces.
+llvm::DIDescriptor CGDebugInfo::createContextChain(const Decl *Context) {
+ if (!Context)
+ return TheCU;
+
+ // See if we already have the parent.
+ llvm::DenseMap<const Decl *, llvm::WeakVH>::iterator
+ I = RegionMap.find(Context);
+ if (I != RegionMap.end())
+ return llvm::DIDescriptor(dyn_cast_or_null<llvm::MDNode>(&*I->second));
+
+ // Check namespace.
+ if (const NamespaceDecl *NSDecl = dyn_cast<NamespaceDecl>(Context))
+ return llvm::DIDescriptor(getOrCreateNameSpace(NSDecl));
+
+ if (const RecordDecl *RD = dyn_cast<RecordDecl>(Context)) {
+ if (!RD->isDependentType()) {
+ llvm::DIFile DefUnit = getOrCreateFile(RD->getLocation());
+ unsigned Line = getLineNumber(RD->getLocation());
+ llvm::DIDescriptor FDContext =
+ createContextChain(cast<Decl>(RD->getDeclContext()));
+
+ const CXXRecordDecl *CXXDecl = dyn_cast<CXXRecordDecl>(RD);
+ llvm::DIType Ty = llvm::DIType();
+
+ if (CXXDecl)
+ Ty = DBuilder.createClassType(FDContext, RD->getName(), DefUnit,
+ Line, 0, 0, 0,
+ llvm::DIType::FlagFwdDecl,
+ llvm::DIType(), llvm::DIArray());
+ else if (RD->isStruct())
+ Ty = DBuilder.createStructType(FDContext, RD->getName(), DefUnit,
+ Line, 0, 0, llvm::DIType::FlagFwdDecl,
+ llvm::DIArray());
+ else if (RD->isUnion())
+ Ty = DBuilder.createUnionType(FDContext, RD->getName(), DefUnit,
+ Line, 0, 0, llvm::DIType::FlagFwdDecl,
+ llvm::DIArray());
+
+ RegionMap[Context] = llvm::WeakVH(Ty);
+ return llvm::DIDescriptor(Ty);
+ }
+ }
+ return TheCU;
+}
+
/// CreatePointeeType - Create Pointee type. If Pointee is a record
/// then emit record's fwd if debug info size reduction is enabled.
llvm::DIType CGDebugInfo::CreatePointeeType(QualType PointeeTy,
@@ -1073,8 +1120,12 @@
// its members. Finally, we create a descriptor for the complete type (which
// may refer to the forward decl if the struct is recursive) and replace all
// uses of the forward declaration with the final definition.
- llvm::DIDescriptor FDContext =
- getContextDescriptor(cast<Decl>(RD->getDeclContext()));
+
+ llvm::DIDescriptor FDContext;
+ if (CGM.getCodeGenOpts().LimitDebugInfo)
+ FDContext = createContextChain(cast<Decl>(RD->getDeclContext()));
+ else
+ FDContext = getContextDescriptor(cast<Decl>(RD->getDeclContext()));
// If this is just a forward declaration, construct an appropriately
// marked node and just return it.
@@ -1193,7 +1244,7 @@
// Now that we have a real decl for the struct, replace anything using the
// old decl with the new one. This will recursively update the debug info.
llvm::DIType(FwdDeclNode).replaceAllUsesWith(RealDecl);
- RegionMap[RD] = llvm::WeakVH(RealDecl);
+ RegionMap[Ty->getDecl()] = llvm::WeakVH(RealDecl);
return llvm::DIType(RealDecl);
}
@@ -1565,8 +1616,6 @@
if (T == LastT)
return T;
} while (true);
-
- return T;
}
/// getType - Get the type from the cache or return null type if it doesn't exist.
@@ -1677,7 +1726,6 @@
case Type::UnaryTransform:
case Type::Auto:
llvm_unreachable("type should have been unwrapped!");
- return llvm::DIType();
}
assert(Diag && "Fall through without a diagnostic?");
Modified: cfe/branches/tooling/lib/CodeGen/CGDebugInfo.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/CodeGen/CGDebugInfo.h?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/CodeGen/CGDebugInfo.h (original)
+++ cfe/branches/tooling/lib/CodeGen/CGDebugInfo.h Mon Jan 23 02:39:37 2012
@@ -232,6 +232,9 @@
/// getContextDescriptor - Get context info for the decl.
llvm::DIDescriptor getContextDescriptor(const Decl *Decl);
+ /// CreateContextChain - Create a set of decls for the context chain.
+ llvm::DIDescriptor createContextChain(const Decl *Decl);
+
/// getCurrentDirname - Return current directory name.
StringRef getCurrentDirname();
Modified: cfe/branches/tooling/lib/CodeGen/CGException.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/CodeGen/CGException.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/CodeGen/CGException.cpp (original)
+++ cfe/branches/tooling/lib/CodeGen/CGException.cpp Mon Jan 23 02:39:37 2012
@@ -636,8 +636,7 @@
return false;
}
- // Suppress warning.
- return false;
+ llvm_unreachable("Invalid EHScope Kind!");
}
llvm::BasicBlock *CodeGenFunction::getInvokeDestImpl() {
Modified: cfe/branches/tooling/lib/CodeGen/CGExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/CodeGen/CGExpr.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/CodeGen/CGExpr.cpp (original)
+++ cfe/branches/tooling/lib/CodeGen/CGExpr.cpp Mon Jan 23 02:39:37 2012
@@ -1381,6 +1381,13 @@
CharUnits Alignment = getContext().getDeclAlign(ND);
QualType T = E->getType();
+ // FIXME: We should be able to assert this for FunctionDecls as well!
+ // FIXME: We should be able to assert this for all DeclRefExprs, not just
+ // those with a valid source location.
+ assert((ND->isUsed(false) || !isa<VarDecl>(ND) ||
+ !E->getLocation().isValid()) &&
+ "Should not use decl without marking it used!");
+
if (ND->hasAttr<WeakRefAttr>()) {
const ValueDecl *VD = cast<ValueDecl>(ND);
llvm::Constant *Aliasee = CGM.GetWeakRefReference(VD);
@@ -1427,10 +1434,6 @@
return EmitFunctionDeclLValue(*this, E, fn);
llvm_unreachable("Unhandled DeclRefExpr");
-
- // an invalid LValue, but the assert will
- // ensure that this point is never reached.
- return LValue();
}
LValue CodeGenFunction::EmitBlockDeclRefLValue(const BlockDeclRefExpr *E) {
Modified: cfe/branches/tooling/lib/CodeGen/CGExprAgg.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/CodeGen/CGExprAgg.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/CodeGen/CGExprAgg.cpp (original)
+++ cfe/branches/tooling/lib/CodeGen/CGExprAgg.cpp Mon Jan 23 02:39:37 2012
@@ -349,7 +349,6 @@
case CK_LValueBitCast:
llvm_unreachable("should not be emitting lvalue bitcast as rvalue");
- break;
case CK_Dependent:
case CK_BitCast:
Modified: cfe/branches/tooling/lib/CodeGen/CGExprComplex.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/CodeGen/CGExprComplex.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/CodeGen/CGExprComplex.cpp (original)
+++ cfe/branches/tooling/lib/CodeGen/CGExprComplex.cpp Mon Jan 23 02:39:37 2012
@@ -817,7 +817,6 @@
default:
llvm_unreachable("unexpected complex compound assignment");
- Op = 0;
}
ComplexPairTy Val; // ignored
Modified: cfe/branches/tooling/lib/CodeGen/CGExprScalar.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/CodeGen/CGExprScalar.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/CodeGen/CGExprScalar.cpp (original)
+++ cfe/branches/tooling/lib/CodeGen/CGExprScalar.cpp Mon Jan 23 02:39:37 2012
@@ -1167,7 +1167,6 @@
case CK_ConstructorConversion:
case CK_ToUnion:
llvm_unreachable("scalar cast to non-scalar value");
- break;
case CK_LValueToRValue:
assert(CGF.getContext().hasSameUnqualifiedType(E->getType(), DestTy));
@@ -1247,7 +1246,6 @@
}
llvm_unreachable("unknown scalar cast");
- return 0;
}
Value *ScalarExprEmitter::VisitStmtExpr(const StmtExpr *E) {
@@ -1272,10 +1270,8 @@
switch (CGF.getContext().getLangOptions().getSignedOverflowBehavior()) {
case LangOptions::SOB_Undefined:
return Builder.CreateNSWAdd(InVal, NextVal, IsInc ? "inc" : "dec");
- break;
case LangOptions::SOB_Defined:
return Builder.CreateAdd(InVal, NextVal, IsInc ? "inc" : "dec");
- break;
case LangOptions::SOB_Trapping:
BinOpInfo BinOp;
BinOp.LHS = InVal;
@@ -1875,7 +1871,6 @@
break;
default:
llvm_unreachable("Unsupported operation for overflow detection");
- IID = 0;
}
OpID <<= 1;
OpID |= 1;
@@ -2175,36 +2170,28 @@
case BuiltinType::UChar:
return (IT == VCMPEQ) ? llvm::Intrinsic::ppc_altivec_vcmpequb_p :
llvm::Intrinsic::ppc_altivec_vcmpgtub_p;
- break;
case BuiltinType::Char_S:
case BuiltinType::SChar:
return (IT == VCMPEQ) ? llvm::Intrinsic::ppc_altivec_vcmpequb_p :
llvm::Intrinsic::ppc_altivec_vcmpgtsb_p;
- break;
case BuiltinType::UShort:
return (IT == VCMPEQ) ? llvm::Intrinsic::ppc_altivec_vcmpequh_p :
llvm::Intrinsic::ppc_altivec_vcmpgtuh_p;
- break;
case BuiltinType::Short:
return (IT == VCMPEQ) ? llvm::Intrinsic::ppc_altivec_vcmpequh_p :
llvm::Intrinsic::ppc_altivec_vcmpgtsh_p;
- break;
case BuiltinType::UInt:
case BuiltinType::ULong:
return (IT == VCMPEQ) ? llvm::Intrinsic::ppc_altivec_vcmpequw_p :
llvm::Intrinsic::ppc_altivec_vcmpgtuw_p;
- break;
case BuiltinType::Int:
case BuiltinType::Long:
return (IT == VCMPEQ) ? llvm::Intrinsic::ppc_altivec_vcmpequw_p :
llvm::Intrinsic::ppc_altivec_vcmpgtsw_p;
- break;
case BuiltinType::Float:
return (IT == VCMPEQ) ? llvm::Intrinsic::ppc_altivec_vcmpeqfp_p :
llvm::Intrinsic::ppc_altivec_vcmpgtfp_p;
- break;
}
- return llvm::Intrinsic::not_intrinsic;
}
Value *ScalarExprEmitter::EmitCompare(const BinaryOperator *E,unsigned UICmpOpc,
Modified: cfe/branches/tooling/lib/CodeGen/CGObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/CodeGen/CGObjC.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/CodeGen/CGObjC.cpp (original)
+++ cfe/branches/tooling/lib/CodeGen/CGObjC.cpp Mon Jan 23 02:39:37 2012
@@ -2086,7 +2086,6 @@
}
llvm_unreachable("impossible lifetime!");
- return TryEmitResult();
}
static TryEmitResult tryEmitARCRetainLoadOfScalar(CodeGenFunction &CGF,
Modified: cfe/branches/tooling/lib/CodeGen/CGObjCMac.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/CodeGen/CGObjCMac.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/CodeGen/CGObjCMac.cpp (original)
+++ cfe/branches/tooling/lib/CodeGen/CGObjCMac.cpp Mon Jan 23 02:39:37 2012
@@ -1516,7 +1516,6 @@
return CGM.GetAddrOfRTTIDescriptor(T, /*ForEH=*/true);
llvm_unreachable("asking for catch type for ObjC type in fragile runtime");
- return 0;
}
/// Generate a constant CFString object.
Modified: cfe/branches/tooling/lib/CodeGen/CGRTTI.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/CodeGen/CGRTTI.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/CodeGen/CGRTTI.cpp (original)
+++ cfe/branches/tooling/lib/CodeGen/CGRTTI.cpp Mon Jan 23 02:39:37 2012
@@ -207,9 +207,8 @@
case BuiltinType::ObjCSel:
llvm_unreachable("FIXME: Objective-C types are unsupported!");
}
-
- // Silent gcc.
- return false;
+
+ llvm_unreachable("Invalid BuiltinType Kind!");
}
static bool TypeInfoIsInStandardLibrary(const PointerType *PointerTy) {
@@ -345,7 +344,7 @@
return llvm::GlobalValue::LinkOnceODRLinkage;
}
- return llvm::GlobalValue::LinkOnceODRLinkage;
+ llvm_unreachable("Invalid linkage!");
}
// CanUseSingleInheritance - Return whether the given record decl has a "single,
Modified: cfe/branches/tooling/lib/CodeGen/CodeGenModule.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/CodeGen/CodeGenModule.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/CodeGen/CodeGenModule.cpp (original)
+++ cfe/branches/tooling/lib/CodeGen/CodeGenModule.cpp Mon Jan 23 02:39:37 2012
@@ -57,7 +57,6 @@
}
llvm_unreachable("invalid C++ ABI kind");
- return *CreateItaniumCXXABI(CGM);
}
@@ -1340,9 +1339,8 @@
case TSK_ExplicitInstantiationDefinition:
return llvm::GlobalVariable::WeakODRLinkage;
}
-
- // Silence GCC warning.
- return llvm::GlobalVariable::LinkOnceODRLinkage;
+
+ llvm_unreachable("Invalid TemplateSpecializationKind!");
}
CharUnits CodeGenModule::GetTargetTypeStoreSize(llvm::Type *Ty) const {
Modified: cfe/branches/tooling/lib/CodeGen/CodeGenModule.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/CodeGen/CodeGenModule.h?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/CodeGen/CodeGenModule.h (original)
+++ cfe/branches/tooling/lib/CodeGen/CodeGenModule.h Mon Jan 23 02:39:37 2012
@@ -469,7 +469,6 @@
case ProtectedVisibility: return llvm::GlobalValue::ProtectedVisibility;
}
llvm_unreachable("unknown visibility!");
- return llvm::GlobalValue::DefaultVisibility;
}
llvm::Constant *GetAddrOfGlobal(GlobalDecl GD) {
Modified: cfe/branches/tooling/lib/CodeGen/CodeGenTypes.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/CodeGen/CodeGenTypes.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/CodeGen/CodeGenTypes.cpp (original)
+++ cfe/branches/tooling/lib/CodeGen/CodeGenTypes.cpp Mon Jan 23 02:39:37 2012
@@ -305,7 +305,6 @@
#define NON_CANONICAL_UNLESS_DEPENDENT_TYPE(Class, Base) case Type::Class:
#include "clang/AST/TypeNodes.def"
llvm_unreachable("Non-canonical or dependent types aren't possible.");
- break;
case Type::Builtin: {
switch (cast<BuiltinType>(Ty)->getKind()) {
@@ -374,7 +373,6 @@
case BuiltinType::Id:
#include "clang/AST/BuiltinTypes.def"
llvm_unreachable("Unexpected placeholder builtin type!");
- break;
}
break;
}
Modified: cfe/branches/tooling/lib/CodeGen/TargetInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/CodeGen/TargetInfo.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/CodeGen/TargetInfo.cpp (original)
+++ cfe/branches/tooling/lib/CodeGen/TargetInfo.cpp Mon Jan 23 02:39:37 2012
@@ -2847,7 +2847,6 @@
llvm::Value *PTXABIInfo::EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
CodeGenFunction &CFG) const {
llvm_unreachable("PTX does not support varargs");
- return 0;
}
void PTXTargetCodeGenInfo::SetTargetAttributes(const Decl *D,
Modified: cfe/branches/tooling/lib/Driver/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Driver/Driver.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Driver/Driver.cpp (original)
+++ cfe/branches/tooling/lib/Driver/Driver.cpp Mon Jan 23 02:39:37 2012
@@ -306,7 +306,7 @@
}
// FIXME: We shouldn't overwrite the default host triple here, but we have
// nowhere else to put this currently.
- if (const Arg *A = Args->getLastArg(options::OPT_ccc_host_triple))
+ if (const Arg *A = Args->getLastArg(options::OPT_target))
DefaultTargetTriple = A->getValue(*Args);
if (const Arg *A = Args->getLastArg(options::OPT_ccc_install_dir))
Dir = InstalledDir = A->getValue(*Args);
Modified: cfe/branches/tooling/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Driver/Tools.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Driver/Tools.cpp (original)
+++ cfe/branches/tooling/lib/Driver/Tools.cpp Mon Jan 23 02:39:37 2012
@@ -36,13 +36,6 @@
#include "InputInfo.h"
#include "ToolChains.h"
-#ifdef __CYGWIN__
-#include <cygwin/version.h>
-#if defined(CYGWIN_VERSION_DLL_MAJOR) && CYGWIN_VERSION_DLL_MAJOR<1007
-#define IS_CYGWIN15 1
-#endif
-#endif
-
using namespace clang::driver;
using namespace clang::driver::tools;
using namespace clang;
@@ -2748,12 +2741,7 @@
if (!customGCCName.empty())
GCCName = customGCCName.c_str();
else if (D.CCCIsCXX) {
-#ifdef IS_CYGWIN15
- // FIXME: Detect the version of Cygwin at runtime?
- GCCName = "g++-4";
-#else
GCCName = "g++";
-#endif
} else
GCCName = "gcc";
Modified: cfe/branches/tooling/lib/Frontend/ASTMerge.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Frontend/ASTMerge.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Frontend/ASTMerge.cpp (original)
+++ cfe/branches/tooling/lib/Frontend/ASTMerge.cpp Mon Jan 23 02:39:37 2012
@@ -26,8 +26,7 @@
// FIXME: This is a hack. We need a better way to communicate the
// AST file, compiler instance, and file name than member variables
// of FrontendAction.
- AdaptedAction->setCurrentFile(getCurrentFile(), getCurrentFileKind(),
- takeCurrentASTUnit());
+ AdaptedAction->setCurrentInput(getCurrentInput(), takeCurrentASTUnit());
AdaptedAction->setCompilerInstance(&CI);
return AdaptedAction->BeginSourceFileAction(CI, Filename);
}
Modified: cfe/branches/tooling/lib/Frontend/ASTUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Frontend/ASTUnit.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Frontend/ASTUnit.cpp (original)
+++ cfe/branches/tooling/lib/Frontend/ASTUnit.cpp Mon Jan 23 02:39:37 2012
@@ -1003,7 +1003,7 @@
CCInvocation(new CompilerInvocation(*Invocation));
Clang->setInvocation(CCInvocation.getPtr());
- OriginalSourceFile = Clang->getFrontendOpts().Inputs[0].second;
+ OriginalSourceFile = Clang->getFrontendOpts().Inputs[0].File;
// Set up diagnostics, capturing any diagnostics that would
// otherwise be dropped.
@@ -1026,9 +1026,9 @@
assert(Clang->getFrontendOpts().Inputs.size() == 1 &&
"Invocation must have exactly one source file!");
- assert(Clang->getFrontendOpts().Inputs[0].first != IK_AST &&
+ assert(Clang->getFrontendOpts().Inputs[0].Kind != IK_AST &&
"FIXME: AST inputs not yet supported here!");
- assert(Clang->getFrontendOpts().Inputs[0].first != IK_LLVM_IR &&
+ assert(Clang->getFrontendOpts().Inputs[0].Kind != IK_LLVM_IR &&
"IR inputs not support here!");
// Configure the various subsystems.
@@ -1095,8 +1095,7 @@
llvm::CrashRecoveryContextCleanupRegistrar<TopLevelDeclTrackerAction>
ActCleanup(Act.get());
- if (!Act->BeginSourceFile(*Clang.get(), Clang->getFrontendOpts().Inputs[0].second,
- Clang->getFrontendOpts().Inputs[0].first))
+ if (!Act->BeginSourceFile(*Clang.get(), Clang->getFrontendOpts().Inputs[0]))
goto error;
if (OverrideMainBuffer) {
@@ -1182,7 +1181,7 @@
// command line (to another file) or directly through the compiler invocation
// (to a memory buffer).
llvm::MemoryBuffer *Buffer = 0;
- llvm::sys::PathWithStatus MainFilePath(FrontendOpts.Inputs[0].second);
+ llvm::sys::PathWithStatus MainFilePath(FrontendOpts.Inputs[0].File);
if (const llvm::sys::FileStatus *MainFileStatus = MainFilePath.getFileStatus()) {
// Check whether there is a file-file remapping of the main file
for (PreprocessorOptions::remapped_file_iterator
@@ -1232,7 +1231,7 @@
// If the main source file was not remapped, load it now.
if (!Buffer) {
- Buffer = getBufferForFile(FrontendOpts.Inputs[0].second);
+ Buffer = getBufferForFile(FrontendOpts.Inputs[0].File);
if (!Buffer)
return std::make_pair((llvm::MemoryBuffer*)0, std::make_pair(0, true));
@@ -1394,7 +1393,7 @@
// buffer size we reserved when creating the preamble.
return CreatePaddedMainFileBuffer(NewPreamble.first,
PreambleReservedSize,
- FrontendOpts.Inputs[0].second);
+ FrontendOpts.Inputs[0].File);
}
}
@@ -1447,7 +1446,7 @@
// Save the preamble text for later; we'll need to compare against it for
// subsequent reparses.
- StringRef MainFilename = PreambleInvocation->getFrontendOpts().Inputs[0].second;
+ StringRef MainFilename = PreambleInvocation->getFrontendOpts().Inputs[0].File;
Preamble.assign(FileMgr->getFile(MainFilename),
NewPreamble.first->getBufferStart(),
NewPreamble.first->getBufferStart()
@@ -1457,7 +1456,7 @@
delete PreambleBuffer;
PreambleBuffer
= llvm::MemoryBuffer::getNewUninitMemBuffer(PreambleReservedSize,
- FrontendOpts.Inputs[0].second);
+ FrontendOpts.Inputs[0].File);
memcpy(const_cast<char*>(PreambleBuffer->getBufferStart()),
NewPreamble.first->getBufferStart(), Preamble.size());
memset(const_cast<char*>(PreambleBuffer->getBufferStart()) + Preamble.size(),
@@ -1465,7 +1464,7 @@
const_cast<char*>(PreambleBuffer->getBufferEnd())[-1] = '\n';
// Remap the main source file to the preamble buffer.
- llvm::sys::PathWithStatus MainFilePath(FrontendOpts.Inputs[0].second);
+ llvm::sys::PathWithStatus MainFilePath(FrontendOpts.Inputs[0].File);
PreprocessorOpts.addRemappedFile(MainFilePath.str(), PreambleBuffer);
// Tell the compiler invocation to generate a temporary precompiled header.
@@ -1483,7 +1482,7 @@
CICleanup(Clang.get());
Clang->setInvocation(&*PreambleInvocation);
- OriginalSourceFile = Clang->getFrontendOpts().Inputs[0].second;
+ OriginalSourceFile = Clang->getFrontendOpts().Inputs[0].File;
// Set up diagnostics, capturing all of the diagnostics produced.
Clang->setDiagnostics(&getDiagnostics());
@@ -1509,9 +1508,9 @@
assert(Clang->getFrontendOpts().Inputs.size() == 1 &&
"Invocation must have exactly one source file!");
- assert(Clang->getFrontendOpts().Inputs[0].first != IK_AST &&
+ assert(Clang->getFrontendOpts().Inputs[0].Kind != IK_AST &&
"FIXME: AST inputs not yet supported here!");
- assert(Clang->getFrontendOpts().Inputs[0].first != IK_LLVM_IR &&
+ assert(Clang->getFrontendOpts().Inputs[0].Kind != IK_LLVM_IR &&
"IR inputs not support here!");
// Clear out old caches and data.
@@ -1530,8 +1529,7 @@
llvm::OwningPtr<PrecompilePreambleAction> Act;
Act.reset(new PrecompilePreambleAction(*this));
- if (!Act->BeginSourceFile(*Clang.get(), Clang->getFrontendOpts().Inputs[0].second,
- Clang->getFrontendOpts().Inputs[0].first)) {
+ if (!Act->BeginSourceFile(*Clang.get(), Clang->getFrontendOpts().Inputs[0])) {
llvm::sys::Path(FrontendOpts.OutputFile).eraseFromDisk();
Preamble.clear();
PreambleRebuildCounter = DefaultPreambleRebuildInterval;
@@ -1599,7 +1597,7 @@
return CreatePaddedMainFileBuffer(NewPreamble.first,
PreambleReservedSize,
- FrontendOpts.Inputs[0].second);
+ FrontendOpts.Inputs[0].File);
}
void ASTUnit::RealizeTopLevelDeclsFromPreamble() {
@@ -1618,7 +1616,7 @@
}
StringRef ASTUnit::getMainFileName() const {
- return Invocation->getFrontendOpts().Inputs[0].second;
+ return Invocation->getFrontendOpts().Inputs[0].File;
}
ASTUnit *ASTUnit::create(CompilerInvocation *CI,
@@ -1690,7 +1688,7 @@
CICleanup(Clang.get());
Clang->setInvocation(CI);
- AST->OriginalSourceFile = Clang->getFrontendOpts().Inputs[0].second;
+ AST->OriginalSourceFile = Clang->getFrontendOpts().Inputs[0].File;
// Set up diagnostics, capturing any diagnostics that would
// otherwise be dropped.
@@ -1711,9 +1709,9 @@
assert(Clang->getFrontendOpts().Inputs.size() == 1 &&
"Invocation must have exactly one source file!");
- assert(Clang->getFrontendOpts().Inputs[0].first != IK_AST &&
+ assert(Clang->getFrontendOpts().Inputs[0].Kind != IK_AST &&
"FIXME: AST inputs not yet supported here!");
- assert(Clang->getFrontendOpts().Inputs[0].first != IK_LLVM_IR &&
+ assert(Clang->getFrontendOpts().Inputs[0].Kind != IK_LLVM_IR &&
"IR inputs not supported here!");
// Configure the various subsystems.
@@ -1740,9 +1738,7 @@
llvm::CrashRecoveryContextCleanupRegistrar<TopLevelDeclTrackerAction>
ActCleanup(TrackerAct.get());
- if (!Act->BeginSourceFile(*Clang.get(),
- Clang->getFrontendOpts().Inputs[0].second,
- Clang->getFrontendOpts().Inputs[0].first))
+ if (!Act->BeginSourceFile(*Clang.get(), Clang->getFrontendOpts().Inputs[0]))
return 0;
if (Persistent && !TrackerAct) {
@@ -2255,7 +2251,7 @@
CICleanup(Clang.get());
Clang->setInvocation(&*CCInvocation);
- OriginalSourceFile = Clang->getFrontendOpts().Inputs[0].second;
+ OriginalSourceFile = Clang->getFrontendOpts().Inputs[0].File;
// Set up diagnostics, capturing any diagnostics produced.
Clang->setDiagnostics(&Diag);
@@ -2281,9 +2277,9 @@
assert(Clang->getFrontendOpts().Inputs.size() == 1 &&
"Invocation must have exactly one source file!");
- assert(Clang->getFrontendOpts().Inputs[0].first != IK_AST &&
+ assert(Clang->getFrontendOpts().Inputs[0].Kind != IK_AST &&
"FIXME: AST inputs not yet supported here!");
- assert(Clang->getFrontendOpts().Inputs[0].first != IK_LLVM_IR &&
+ assert(Clang->getFrontendOpts().Inputs[0].Kind != IK_LLVM_IR &&
"IR inputs not support here!");
@@ -2358,8 +2354,7 @@
llvm::OwningPtr<SyntaxOnlyAction> Act;
Act.reset(new SyntaxOnlyAction);
- if (Act->BeginSourceFile(*Clang.get(), Clang->getFrontendOpts().Inputs[0].second,
- Clang->getFrontendOpts().Inputs[0].first)) {
+ if (Act->BeginSourceFile(*Clang.get(), Clang->getFrontendOpts().Inputs[0])) {
if (OverrideMainBuffer) {
std::string ModName = getPreambleFile(this);
TranslateStoredDiagnostics(Clang->getModuleManager(), ModName,
Modified: cfe/branches/tooling/lib/Frontend/ChainedIncludesSource.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Frontend/ChainedIncludesSource.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Frontend/ChainedIncludesSource.cpp (original)
+++ cfe/branches/tooling/lib/Frontend/ChainedIncludesSource.cpp Mon Jan 23 02:39:37 2012
@@ -63,7 +63,7 @@
assert(!includes.empty() && "No '-chain-include' in options!");
llvm::OwningPtr<ChainedIncludesSource> source(new ChainedIncludesSource());
- InputKind IK = CI.getFrontendOpts().Inputs[0].first;
+ InputKind IK = CI.getFrontendOpts().Inputs[0].Kind;
SmallVector<llvm::MemoryBuffer *, 4> serialBufs;
SmallVector<std::string, 4> serialBufNames;
@@ -82,7 +82,8 @@
CInvok->getPreprocessorOpts().Macros.clear();
CInvok->getFrontendOpts().Inputs.clear();
- CInvok->getFrontendOpts().Inputs.push_back(std::make_pair(IK, includes[i]));
+ CInvok->getFrontendOpts().Inputs.push_back(FrontendInputFile(includes[i],
+ IK));
TextDiagnosticPrinter *DiagClient =
new TextDiagnosticPrinter(llvm::errs(), DiagnosticOptions());
Modified: cfe/branches/tooling/lib/Frontend/CompilerInstance.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Frontend/CompilerInstance.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Frontend/CompilerInstance.cpp (original)
+++ cfe/branches/tooling/lib/Frontend/CompilerInstance.cpp Mon Jan 23 02:39:37 2012
@@ -648,13 +648,11 @@
llvm::EnableStatistics();
for (unsigned i = 0, e = getFrontendOpts().Inputs.size(); i != e; ++i) {
- const std::string &InFile = getFrontendOpts().Inputs[i].second;
-
// Reset the ID tables if we are reusing the SourceManager.
if (hasSourceManager())
getSourceManager().clearIDTables();
- if (Act.BeginSourceFile(*this, InFile, getFrontendOpts().Inputs[i].first)) {
+ if (Act.BeginSourceFile(*this, getFrontendOpts().Inputs[i])) {
Act.Execute();
Act.EndSourceFile();
}
@@ -1019,7 +1017,8 @@
if (const FileEntry *ModuleMapFile
= ModMap.getContainingModuleMapFile(Module)) {
// Use the module map where this module resides.
- FrontendOpts.Inputs.push_back(std::make_pair(IK, ModuleMapFile->getName()));
+ FrontendOpts.Inputs.push_back(FrontendInputFile(ModuleMapFile->getName(),
+ IK));
} else {
// Create a temporary module map file.
TempModuleMapFileName = Module->Name;
@@ -1037,7 +1036,7 @@
llvm::raw_fd_ostream OS(FD, /*shouldClose=*/true);
Module->print(OS);
FrontendOpts.Inputs.push_back(
- std::make_pair(IK, TempModuleMapFileName.str().str()));
+ FrontendInputFile(TempModuleMapFileName.str().str(), IK));
}
// Don't free the remapped file buffers; they are owned by our caller.
Modified: cfe/branches/tooling/lib/Frontend/CompilerInvocation.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Frontend/CompilerInvocation.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Frontend/CompilerInvocation.cpp (original)
+++ cfe/branches/tooling/lib/Frontend/CompilerInvocation.cpp Mon Jan 23 02:39:37 2012
@@ -395,7 +395,6 @@
}
llvm_unreachable("Unexpected language kind!");
- return 0;
}
static const char *getActionName(frontend::ActionKind Kind) {
@@ -433,7 +432,6 @@
}
llvm_unreachable("Unexpected language kind!");
- return 0;
}
static void FileSystemOptsToArgs(const FileSystemOptions &Opts,
@@ -492,17 +490,17 @@
bool NeedLang = false;
for (unsigned i = 0, e = Opts.Inputs.size(); i != e; ++i)
- if (FrontendOptions::getInputKindForExtension(Opts.Inputs[i].second) !=
- Opts.Inputs[i].first)
+ if (FrontendOptions::getInputKindForExtension(Opts.Inputs[i].File) !=
+ Opts.Inputs[i].Kind)
NeedLang = true;
if (NeedLang) {
Res.push_back("-x");
- Res.push_back(getInputKindName(Opts.Inputs[0].first));
+ Res.push_back(getInputKindName(Opts.Inputs[0].Kind));
}
for (unsigned i = 0, e = Opts.Inputs.size(); i != e; ++i) {
- assert((!NeedLang || Opts.Inputs[i].first == Opts.Inputs[0].first) &&
+ assert((!NeedLang || Opts.Inputs[i].Kind == Opts.Inputs[0].Kind) &&
"Unable to represent this input vector!");
- Res.push_back(Opts.Inputs[i].second);
+ Res.push_back(Opts.Inputs[i].File);
}
if (!Opts.OutputFile.empty()) {
@@ -1463,7 +1461,7 @@
if (i == 0)
DashX = IK;
}
- Opts.Inputs.push_back(std::make_pair(IK, Inputs[i]));
+ Opts.Inputs.push_back(FrontendInputFile(Inputs[i], IK));
}
return DashX;
Modified: cfe/branches/tooling/lib/Frontend/FrontendAction.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Frontend/FrontendAction.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Frontend/FrontendAction.cpp (original)
+++ cfe/branches/tooling/lib/Frontend/FrontendAction.cpp Mon Jan 23 02:39:37 2012
@@ -115,10 +115,9 @@
FrontendAction::~FrontendAction() {}
-void FrontendAction::setCurrentFile(StringRef Value, InputKind Kind,
- ASTUnit *AST) {
- CurrentFile = Value;
- CurrentFileKind = Kind;
+void FrontendAction::setCurrentInput(const FrontendInputFile &CurrentInput,
+ ASTUnit *AST) {
+ this->CurrentInput = CurrentInput;
CurrentASTUnit.reset(AST);
}
@@ -156,11 +155,10 @@
}
bool FrontendAction::BeginSourceFile(CompilerInstance &CI,
- StringRef Filename,
- InputKind InputKind) {
+ const FrontendInputFile &Input) {
assert(!Instance && "Already processing a source file!");
- assert(!Filename.empty() && "Unexpected empty filename!");
- setCurrentFile(Filename, InputKind);
+ assert(!Input.File.empty() && "Unexpected empty filename!");
+ setCurrentInput(Input);
setCompilerInstance(&CI);
if (!BeginInvocation(CI))
@@ -168,7 +166,7 @@
// AST files follow a very different path, since they share objects via the
// AST unit.
- if (InputKind == IK_AST) {
+ if (Input.Kind == IK_AST) {
assert(!usesPreprocessorOnly() &&
"Attempt to pass AST file to preprocessor only action!");
assert(hasASTFileSupport() &&
@@ -176,12 +174,12 @@
llvm::IntrusiveRefCntPtr<DiagnosticsEngine> Diags(&CI.getDiagnostics());
std::string Error;
- ASTUnit *AST = ASTUnit::LoadFromASTFile(Filename, Diags,
+ ASTUnit *AST = ASTUnit::LoadFromASTFile(Input.File, Diags,
CI.getFileSystemOpts());
if (!AST)
goto failure;
- setCurrentFile(Filename, InputKind, AST);
+ setCurrentInput(Input, AST);
// Set the shared objects, these are reset when we finish processing the
// file, otherwise the CompilerInstance will happily destroy them.
@@ -191,11 +189,11 @@
CI.setASTContext(&AST->getASTContext());
// Initialize the action.
- if (!BeginSourceFileAction(CI, Filename))
+ if (!BeginSourceFileAction(CI, Input.File))
goto failure;
/// Create the AST consumer.
- CI.setASTConsumer(CreateWrappedASTConsumer(CI, Filename));
+ CI.setASTConsumer(CreateWrappedASTConsumer(CI, Input.File));
if (!CI.hasASTConsumer())
goto failure;
@@ -209,7 +207,7 @@
CI.createSourceManager(CI.getFileManager());
// IR files bypass the rest of initialization.
- if (InputKind == IK_LLVM_IR) {
+ if (Input.Kind == IK_LLVM_IR) {
assert(hasIRSupport() &&
"This action does not have IR file support!");
@@ -217,7 +215,7 @@
CI.getDiagnosticClient().BeginSourceFile(CI.getLangOpts(), 0);
// Initialize the action.
- if (!BeginSourceFileAction(CI, Filename))
+ if (!BeginSourceFileAction(CI, Input.File))
goto failure;
return true;
@@ -231,7 +229,7 @@
&CI.getPreprocessor());
// Initialize the action.
- if (!BeginSourceFileAction(CI, Filename))
+ if (!BeginSourceFileAction(CI, Input.File))
goto failure;
/// Create the AST context and consumer unless this is a preprocessor only
@@ -240,7 +238,7 @@
CI.createASTContext();
llvm::OwningPtr<ASTConsumer> Consumer(
- CreateWrappedASTConsumer(CI, Filename));
+ CreateWrappedASTConsumer(CI, Input.File));
if (!Consumer)
goto failure;
@@ -300,7 +298,7 @@
}
CI.getDiagnosticClient().EndSourceFile();
- setCurrentFile("", IK_None);
+ setCurrentInput(FrontendInputFile());
setCompilerInstance(0);
return false;
}
@@ -375,7 +373,7 @@
}
setCompilerInstance(0);
- setCurrentFile("", IK_None);
+ setCurrentInput(FrontendInputFile());
}
//===----------------------------------------------------------------------===//
@@ -419,7 +417,7 @@
}
bool WrapperFrontendAction::BeginSourceFileAction(CompilerInstance &CI,
StringRef Filename) {
- WrappedAction->setCurrentFile(getCurrentFile(), getCurrentFileKind());
+ WrappedAction->setCurrentInput(getCurrentInput());
WrappedAction->setCompilerInstance(&CI);
return WrappedAction->BeginSourceFileAction(CI, Filename);
}
Modified: cfe/branches/tooling/lib/Frontend/FrontendActions.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Frontend/FrontendActions.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Frontend/FrontendActions.cpp (original)
+++ cfe/branches/tooling/lib/Frontend/FrontendActions.cpp Mon Jan 23 02:39:37 2012
@@ -255,7 +255,8 @@
if (UmbrellaHeader && HeaderContents.empty()) {
// Simple case: we have an umbrella header and there are no additional
// includes, we can just parse the umbrella header directly.
- setCurrentFile(UmbrellaHeader->getName(), getCurrentFileKind());
+ setCurrentInput(FrontendInputFile(UmbrellaHeader->getName(),
+ getCurrentFileKind()));
return true;
}
@@ -311,9 +312,8 @@
ModTime);
llvm::MemoryBuffer *HeaderContentsBuf
= llvm::MemoryBuffer::getMemBufferCopy(HeaderContents);
- CI.getSourceManager().overrideFileContents(HeaderFile, HeaderContentsBuf);
-
- setCurrentFile(HeaderName, getCurrentFileKind());
+ CI.getSourceManager().overrideFileContents(HeaderFile, HeaderContentsBuf);
+ setCurrentInput(FrontendInputFile(HeaderName, getCurrentFileKind()));
return true;
}
Modified: cfe/branches/tooling/lib/Frontend/InitHeaderSearch.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Frontend/InitHeaderSearch.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Frontend/InitHeaderSearch.cpp (original)
+++ cfe/branches/tooling/lib/Frontend/InitHeaderSearch.cpp Mon Jan 23 02:39:37 2012
@@ -383,11 +383,10 @@
case llvm::Triple::Cygwin:
// Cygwin-1.7
+ AddMinGWCPlusPlusIncludePaths("/usr/lib/gcc", "i686-pc-cygwin", "4.5.3");
AddMinGWCPlusPlusIncludePaths("/usr/lib/gcc", "i686-pc-cygwin", "4.3.4");
// g++-4 / Cygwin-1.5
AddMinGWCPlusPlusIncludePaths("/usr/lib/gcc", "i686-pc-cygwin", "4.3.2");
- // FIXME: Do we support g++-3.4.4?
- AddMinGWCPlusPlusIncludePaths("/usr/lib/gcc", "i686-pc-cygwin", "3.4.4");
break;
case llvm::Triple::MinGW32:
// mingw-w64 C++ include paths (i686-w64-mingw32 and x86_64-w64-mingw32)
Modified: cfe/branches/tooling/lib/Frontend/VerifyDiagnosticConsumer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Frontend/VerifyDiagnosticConsumer.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Frontend/VerifyDiagnosticConsumer.cpp (original)
+++ cfe/branches/tooling/lib/Frontend/VerifyDiagnosticConsumer.cpp Mon Jan 23 02:39:37 2012
@@ -40,7 +40,7 @@
// DiagnosticConsumer interface.
void VerifyDiagnosticConsumer::BeginSourceFile(const LangOptions &LangOpts,
- const Preprocessor *PP) {
+ const Preprocessor *PP) {
// FIXME: Const hack, we screw up the preprocessor but in practice its ok
// because it doesn't get reused. It would be better if we could make a copy
// though.
Modified: cfe/branches/tooling/lib/Index/ASTLocation.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Index/ASTLocation.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Index/ASTLocation.cpp (original)
+++ cfe/branches/tooling/lib/Index/ASTLocation.cpp Mon Jan 23 02:39:37 2012
@@ -50,8 +50,8 @@
case N_Stmt:
return getDeclFromExpr(Stm);
}
-
- return 0;
+
+ llvm_unreachable("Invalid ASTLocation Kind!");
}
SourceRange ASTLocation::getSourceRange() const {
@@ -68,8 +68,8 @@
case N_Type:
return AsTypeLoc().getLocalSourceRange();
}
-
- return SourceRange();
+
+ llvm_unreachable("Invalid ASTLocation Kind!");
}
void ASTLocation::print(raw_ostream &OS) const {
Modified: cfe/branches/tooling/lib/Lex/Lexer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Lex/Lexer.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Lex/Lexer.cpp (original)
+++ cfe/branches/tooling/lib/Lex/Lexer.cpp Mon Jan 23 02:39:37 2012
@@ -30,6 +30,7 @@
#include "clang/Lex/CodeCompletionHandler.h"
#include "clang/Basic/SourceManager.h"
#include "llvm/ADT/StringSwitch.h"
+#include "llvm/ADT/STLExtras.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/MemoryBuffer.h"
#include <cstring>
@@ -792,6 +793,30 @@
return isAtEndOfMacroExpansion(expansionLoc, SM, LangOpts, MacroEnd);
}
+static CharSourceRange makeRangeFromFileLocs(SourceLocation Begin,
+ SourceLocation End,
+ const SourceManager &SM,
+ const LangOptions &LangOpts) {
+ assert(Begin.isFileID() && End.isFileID());
+ End = Lexer::getLocForEndOfToken(End, 0, SM,LangOpts);
+ if (End.isInvalid())
+ return CharSourceRange();
+
+ // Break down the source locations.
+ FileID FID;
+ unsigned BeginOffs;
+ llvm::tie(FID, BeginOffs) = SM.getDecomposedLoc(Begin);
+ if (FID.isInvalid())
+ return CharSourceRange();
+
+ unsigned EndOffs;
+ if (!SM.isInFileID(End, FID, &EndOffs) ||
+ BeginOffs > EndOffs)
+ return CharSourceRange();
+
+ return CharSourceRange::getCharRange(Begin, End);
+}
+
/// \brief Accepts a token source range and returns a character range with
/// file locations.
/// Returns a null range if a part of the range resides inside a macro
@@ -800,28 +825,53 @@
const SourceManager &SM,
const LangOptions &LangOpts) {
SourceLocation Begin = TokenRange.getBegin();
- if (Begin.isInvalid())
+ SourceLocation End = TokenRange.getEnd();
+ if (Begin.isInvalid() || End.isInvalid())
return CharSourceRange();
- if (Begin.isMacroID())
+ if (Begin.isFileID() && End.isFileID())
+ return makeRangeFromFileLocs(Begin, End, SM, LangOpts);
+
+ if (Begin.isMacroID() && End.isFileID()) {
if (!isAtStartOfMacroExpansion(Begin, SM, LangOpts, &Begin))
return CharSourceRange();
+ return makeRangeFromFileLocs(Begin, End, SM, LangOpts);
+ }
- SourceLocation End = getLocForEndOfToken(TokenRange.getEnd(), 0, SM,LangOpts);
- if (End.isInvalid())
- return CharSourceRange();
+ if (Begin.isFileID() && End.isMacroID()) {
+ if (!isAtEndOfMacroExpansion(End, SM, LangOpts, &End))
+ return CharSourceRange();
+ return makeRangeFromFileLocs(Begin, End, SM, LangOpts);
+ }
- // Break down the source locations.
- std::pair<FileID, unsigned> beginInfo = SM.getDecomposedLoc(Begin);
- if (beginInfo.first.isInvalid())
+ assert(Begin.isMacroID() && End.isMacroID());
+ SourceLocation MacroBegin, MacroEnd;
+ if (isAtStartOfMacroExpansion(Begin, SM, LangOpts, &MacroBegin) &&
+ isAtEndOfMacroExpansion(End, SM, LangOpts, &MacroEnd))
+ return makeRangeFromFileLocs(MacroBegin, MacroEnd, SM, LangOpts);
+
+ FileID FID;
+ unsigned BeginOffs;
+ llvm::tie(FID, BeginOffs) = SM.getDecomposedLoc(Begin);
+ if (FID.isInvalid())
return CharSourceRange();
unsigned EndOffs;
- if (!SM.isInFileID(End, beginInfo.first, &EndOffs) ||
- beginInfo.second > EndOffs)
+ if (!SM.isInFileID(End, FID, &EndOffs) ||
+ BeginOffs > EndOffs)
return CharSourceRange();
- return CharSourceRange::getCharRange(Begin, End);
+ const SrcMgr::SLocEntry *E = &SM.getSLocEntry(FID);
+ const SrcMgr::ExpansionInfo &Expansion = E->getExpansion();
+ if (Expansion.isMacroArgExpansion() &&
+ Expansion.getSpellingLoc().isFileID()) {
+ SourceLocation SpellLoc = Expansion.getSpellingLoc();
+ return makeRangeFromFileLocs(SpellLoc.getLocWithOffset(BeginOffs),
+ SpellLoc.getLocWithOffset(EndOffs),
+ SM, LangOpts);
+ }
+
+ return CharSourceRange();
}
StringRef Lexer::getSourceText(CharSourceRange Range,
Modified: cfe/branches/tooling/lib/Parse/ParseDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Parse/ParseDecl.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Parse/ParseDecl.cpp (original)
+++ cfe/branches/tooling/lib/Parse/ParseDecl.cpp Mon Jan 23 02:39:37 2012
@@ -857,7 +857,7 @@
ConsumeToken(); // Eat the comma, move to the next argument
}
// Match the ')'.
- if (ArgExprsOk && !T.consumeClose() && ArgExprs.size() > 0) {
+ if (ArgExprsOk && !T.consumeClose()) {
Attrs.addNew(&AttrName, AttrNameLoc, 0, AttrNameLoc, 0, SourceLocation(),
ArgExprs.take(), ArgExprs.size());
}
@@ -4607,10 +4607,13 @@
// Parse the constant-expression or assignment-expression now (depending
// on dialect).
- if (getLang().CPlusPlus)
+ if (getLang().CPlusPlus) {
NumElements = ParseConstantExpression();
- else
+ } else {
+ EnterExpressionEvaluationContext Unevaluated(Actions,
+ Sema::ConstantEvaluated);
NumElements = ParseAssignmentExpression();
+ }
}
// If there was an error parsing the assignment-expression, recover.
@@ -4647,6 +4650,8 @@
const bool hasParens = Tok.is(tok::l_paren);
+ EnterExpressionEvaluationContext Unevaluated(Actions, Sema::Unevaluated);
+
bool isCastExpr;
ParsedType CastTy;
SourceRange CastRange;
@@ -4682,6 +4687,13 @@
return;
}
+ // We might need to transform the operand if it is potentially evaluated.
+ Operand = Actions.HandleExprEvaluationContextForTypeof(Operand.get());
+ if (Operand.isInvalid()) {
+ DS.SetTypeSpecError();
+ return;
+ }
+
const char *PrevSpec = 0;
unsigned DiagID;
// Check for duplicate type specifiers (e.g. "int typeof(int)").
Modified: cfe/branches/tooling/lib/Parse/ParseDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Parse/ParseDeclCXX.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Parse/ParseDeclCXX.cpp (original)
+++ cfe/branches/tooling/lib/Parse/ParseDeclCXX.cpp Mon Jan 23 02:39:37 2012
@@ -1849,9 +1849,9 @@
if (DefinitionKind) {
if (!DeclaratorInfo.isFunctionDeclarator()) {
- Diag(Tok, diag::err_func_def_no_params);
+ Diag(DeclaratorInfo.getIdentifierLoc(), diag::err_func_def_no_params);
ConsumeBrace();
- SkipUntil(tok::r_brace, true);
+ SkipUntil(tok::r_brace, /*StopAtSemi*/false);
// Consume the optional ';'
if (Tok.is(tok::semi))
@@ -1860,12 +1860,13 @@
}
if (DS.getStorageClassSpec() == DeclSpec::SCS_typedef) {
- Diag(Tok, diag::err_function_declared_typedef);
+ Diag(DeclaratorInfo.getIdentifierLoc(),
+ diag::err_function_declared_typedef);
// This recovery skips the entire function body. It would be nice
// to simply call ParseCXXInlineMethodDef() below, however Sema
// assumes the declarator represents a function, not a typedef.
ConsumeBrace();
- SkipUntil(tok::r_brace, true);
+ SkipUntil(tok::r_brace, /*StopAtSemi*/false);
// Consume the optional ';'
if (Tok.is(tok::semi))
Modified: cfe/branches/tooling/lib/Parse/ParseExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Parse/ParseExpr.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Parse/ParseExpr.cpp (original)
+++ cfe/branches/tooling/lib/Parse/ParseExpr.cpp Mon Jan 23 02:39:37 2012
@@ -1442,14 +1442,6 @@
return ExprError();
}
- // C++0x [expr.sizeof]p1:
- // [...] The operand is either an expression, which is an unevaluated
- // operand (Clause 5) [...]
- //
- // The GNU typeof and GNU/C++11 alignof extensions also behave as
- // unevaluated operands.
- EnterExpressionEvaluationContext Unevaluated(Actions,
- Sema::Unevaluated);
Operand = ParseCastExpression(true/*isUnaryExpression*/);
} else {
// If it starts with a '(', we know that it is either a parenthesized
@@ -1459,14 +1451,6 @@
ParenParseOption ExprType = CastExpr;
SourceLocation LParenLoc = Tok.getLocation(), RParenLoc;
- // C++0x [expr.sizeof]p1:
- // [...] The operand is either an expression, which is an unevaluated
- // operand (Clause 5) [...]
- //
- // The GNU typeof and GNU/C++11 alignof extensions also behave as
- // unevaluated operands.
- EnterExpressionEvaluationContext Unevaluated(Actions,
- Sema::Unevaluated);
Operand = ParseParenExpression(ExprType, true/*stopIfCastExpr*/,
false, CastTy, RParenLoc);
CastRange = SourceRange(LParenLoc, RParenLoc);
@@ -1555,6 +1539,8 @@
if (OpTok.is(tok::kw_alignof))
Diag(OpTok, diag::warn_cxx98_compat_alignof);
+ EnterExpressionEvaluationContext Unevaluated(Actions, Sema::Unevaluated);
+
bool isCastExpr;
ParsedType CastTy;
SourceRange CastRange;
Modified: cfe/branches/tooling/lib/Parse/ParseExprCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Parse/ParseExprCXX.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Parse/ParseExprCXX.cpp (original)
+++ cfe/branches/tooling/lib/Parse/ParseExprCXX.cpp Mon Jan 23 02:39:37 2012
@@ -2464,7 +2464,7 @@
T.getCloseLocation());
}
}
- return ExprError();
+ llvm_unreachable("Invalid ArrayTypeTrait!");
}
/// ParseExpressionTrait - Parse built-in expression-trait
Modified: cfe/branches/tooling/lib/Parse/ParsePragma.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Parse/ParsePragma.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Parse/ParsePragma.cpp (original)
+++ cfe/branches/tooling/lib/Parse/ParsePragma.cpp Mon Jan 23 02:39:37 2012
@@ -42,13 +42,10 @@
const IdentifierInfo *PushPop = Tok.getIdentifierInfo();
- bool IsPush;
const IdentifierInfo *VisType;
if (PushPop && PushPop->isStr("pop")) {
- IsPush = false;
VisType = 0;
} else if (PushPop && PushPop->isStr("push")) {
- IsPush = true;
PP.LexUnexpandedToken(Tok);
if (Tok.isNot(tok::l_paren)) {
PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_lparen)
@@ -80,7 +77,7 @@
return;
}
- Actions.ActOnPragmaVisibility(IsPush, VisType, VisLoc);
+ Actions.ActOnPragmaVisibility(VisType, VisLoc);
}
// #pragma pack(...) comes in the following delicious flavors:
Modified: cfe/branches/tooling/lib/Rewrite/HTMLRewrite.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Rewrite/HTMLRewrite.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Rewrite/HTMLRewrite.cpp (original)
+++ cfe/branches/tooling/lib/Rewrite/HTMLRewrite.cpp Mon Jan 23 02:39:37 2012
@@ -292,7 +292,7 @@
" body { font-family:Helvetica, sans-serif; font-size:10pt }\n"
" h1 { font-size:14pt }\n"
" .code { border-collapse:collapse; width:100%; }\n"
- " .code { font-family: \"Andale Mono\", monospace; font-size:10pt }\n"
+ " .code { font-family: \"Monospace\", monospace; font-size:10pt }\n"
" .code { line-height: 1.2em }\n"
" .comment { color: green; font-style: oblique }\n"
" .keyword { color: blue }\n"
Modified: cfe/branches/tooling/lib/Sema/AnalysisBasedWarnings.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Sema/AnalysisBasedWarnings.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Sema/AnalysisBasedWarnings.cpp (original)
+++ cfe/branches/tooling/lib/Sema/AnalysisBasedWarnings.cpp Mon Jan 23 02:39:37 2012
@@ -849,8 +849,12 @@
bool processed = false;
if (const Stmt *stmt = i->stmt) {
const CFGBlock *block = AC.getBlockForRegisteredExpression(stmt);
- assert(block);
- if (CFGReverseBlockReachabilityAnalysis *cra = AC.getCFGReachablityAnalysis()) {
+ CFGReverseBlockReachabilityAnalysis *cra =
+ AC.getCFGReachablityAnalysis();
+ // FIXME: We should be able to assert that block is non-null, but
+ // the CFG analysis can skip potentially-evaluated expressions in
+ // edge cases; see test/Sema/vla-2.c.
+ if (block && cra) {
// Can this block be reached from the entrance?
if (cra->isReachable(&AC.getCFG()->getEntry(), block))
S.Diag(D.Loc, D.PD);
Modified: cfe/branches/tooling/lib/Sema/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Sema/CMakeLists.txt?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Sema/CMakeLists.txt (original)
+++ cfe/branches/tooling/lib/Sema/CMakeLists.txt Mon Jan 23 02:39:37 2012
@@ -44,4 +44,5 @@
)
add_dependencies(clangSema ClangARMNeon ClangAttrClasses ClangAttrList
- ClangDiagnosticSema ClangDeclNodes ClangStmtNodes)
+ ClangDiagnosticSema ClangDeclNodes ClangStmtNodes
+ ClangAttrTemplateInstantiate)
Modified: cfe/branches/tooling/lib/Sema/SemaAccess.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Sema/SemaAccess.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Sema/SemaAccess.cpp (original)
+++ cfe/branches/tooling/lib/Sema/SemaAccess.cpp Mon Jan 23 02:39:37 2012
@@ -999,8 +999,6 @@
const EffectiveContext &EC,
AccessTarget &Entity) {
AccessSpecifier Access = Entity.getAccess();
- const CXXRecordDecl *NamingClass = Entity.getNamingClass();
- NamingClass = NamingClass->getCanonicalDecl();
NamedDecl *D = (Entity.isMemberAccess() ? Entity.getTargetDecl() : 0);
const CXXRecordDecl *DeclaringClass = Entity.getDeclaringClass();
Modified: cfe/branches/tooling/lib/Sema/SemaAttr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Sema/SemaAttr.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Sema/SemaAttr.cpp (original)
+++ cfe/branches/tooling/lib/Sema/SemaAttr.cpp Mon Jan 23 02:39:37 2012
@@ -345,9 +345,9 @@
Stack->push_back(std::make_pair(type, loc));
}
-void Sema::ActOnPragmaVisibility(bool IsPush, const IdentifierInfo* VisType,
+void Sema::ActOnPragmaVisibility(const IdentifierInfo* VisType,
SourceLocation PragmaLoc) {
- if (IsPush) {
+ if (VisType) {
// Compute visibility to use.
VisibilityAttr::VisibilityType type;
if (VisType->isStr("default"))
Modified: cfe/branches/tooling/lib/Sema/SemaChecking.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Sema/SemaChecking.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Sema/SemaChecking.cpp (original)
+++ cfe/branches/tooling/lib/Sema/SemaChecking.cpp Mon Jan 23 02:39:37 2012
@@ -722,6 +722,12 @@
// casts here.
// FIXME: We don't allow floating point scalars as input.
Expr *FirstArg = TheCall->getArg(0);
+ ExprResult FirstArgResult = DefaultFunctionArrayLvalueConversion(FirstArg);
+ if (FirstArgResult.isInvalid())
+ return ExprError();
+ FirstArg = FirstArgResult.take();
+ TheCall->setArg(0, FirstArg);
+
const PointerType *pointerType = FirstArg->getType()->getAs<PointerType>();
if (!pointerType) {
Diag(DRE->getLocStart(), diag::err_atomic_builtin_must_be_pointer)
Modified: cfe/branches/tooling/lib/Sema/SemaCodeComplete.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Sema/SemaCodeComplete.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Sema/SemaCodeComplete.cpp (original)
+++ cfe/branches/tooling/lib/Sema/SemaCodeComplete.cpp Mon Jan 23 02:39:37 2012
@@ -2455,45 +2455,34 @@
// Format a function-like macro with placeholders for the arguments.
Result.AddChunk(Chunk(CodeCompletionString::CK_LeftParen));
- bool CombineVariadicArgument = false;
MacroInfo::arg_iterator A = MI->arg_begin(), AEnd = MI->arg_end();
- if (MI->isVariadic() && AEnd - A > 1) {
- AEnd -= 2;
- CombineVariadicArgument = true;
+
+ // C99 variadic macros add __VA_ARGS__ at the end. Skip it.
+ if (MI->isC99Varargs()) {
+ --AEnd;
+
+ if (A == AEnd) {
+ Result.AddPlaceholderChunk("...");
+ }
}
+
for (MacroInfo::arg_iterator A = MI->arg_begin(); A != AEnd; ++A) {
if (A != MI->arg_begin())
Result.AddChunk(Chunk(CodeCompletionString::CK_Comma));
-
- if (!MI->isVariadic() || A + 1 != AEnd) {
- // Non-variadic argument.
- Result.AddPlaceholderChunk(
- Result.getAllocator().CopyString((*A)->getName()));
- continue;
- }
-
- // Variadic argument; cope with the difference between GNU and C99
- // variadic macros, providing a single placeholder for the rest of the
- // arguments.
- if ((*A)->isStr("__VA_ARGS__"))
- Result.AddPlaceholderChunk("...");
- else {
- std::string Arg = (*A)->getName();
- Arg += "...";
+
+ if (MI->isVariadic() && (A+1) == AEnd) {
+ llvm::SmallString<32> Arg = (*A)->getName();
+ if (MI->isC99Varargs())
+ Arg += ", ...";
+ else
+ Arg += "...";
Result.AddPlaceholderChunk(Result.getAllocator().CopyString(Arg));
+ break;
}
- }
-
- if (CombineVariadicArgument) {
- // Handle the next-to-last argument, combining it with the variadic
- // argument.
- std::string LastArg = (*A)->getName();
- ++A;
- if ((*A)->isStr("__VA_ARGS__"))
- LastArg += ", ...";
- else
- LastArg += ", " + (*A)->getName().str() + "...";
- Result.AddPlaceholderChunk(Result.getAllocator().CopyString(LastArg));
+
+ // Non-variadic macros are simple.
+ Result.AddPlaceholderChunk(
+ Result.getAllocator().CopyString((*A)->getName()));
}
Result.AddChunk(Chunk(CodeCompletionString::CK_RightParen));
return Result.TakeString();
Modified: cfe/branches/tooling/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Sema/SemaDecl.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Sema/SemaDecl.cpp (original)
+++ cfe/branches/tooling/lib/Sema/SemaDecl.cpp Mon Jan 23 02:39:37 2012
@@ -7311,6 +7311,9 @@
/// relevant Decl.
void Sema::ActOnFinishDelayedAttribute(Scope *S, Decl *D,
ParsedAttributes &Attrs) {
+ // Always attach attributes to the underlying decl.
+ if (TemplateDecl *TD = dyn_cast<TemplateDecl>(D))
+ D = TD->getTemplatedDecl();
ProcessDeclAttributeList(S, D, Attrs.getList());
}
@@ -9556,7 +9559,8 @@
EltTy = Context.DependentTy;
else {
SourceLocation ExpLoc;
- if (getLangOptions().CPlusPlus0x && Enum->isFixed()) {
+ if (getLangOptions().CPlusPlus0x && Enum->isFixed() &&
+ !getLangOptions().MicrosoftMode) {
// C++11 [dcl.enum]p5: If the underlying type is fixed, [...] the
// constant-expression in the enumerator-definition shall be a converted
// constant expression of the underlying type.
Modified: cfe/branches/tooling/lib/Sema/SemaDeclAttr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Sema/SemaDeclAttr.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Sema/SemaDeclAttr.cpp (original)
+++ cfe/branches/tooling/lib/Sema/SemaDeclAttr.cpp Mon Jan 23 02:39:37 2012
@@ -393,13 +393,11 @@
if (pointer && !checkIsPointer(S, D, Attr))
return;
- if (Arg->isTypeDependent())
- // FIXME: handle attributes with dependent types
- return;
-
- // check that the argument is lockable object
- if (!checkForLockableRecord(S, D, Attr, getRecordType(Arg->getType())))
- return;
+ if (!Arg->isTypeDependent()) {
+ if (!checkForLockableRecord(S, D, Attr, getRecordType(Arg->getType())))
+ return;
+ // FIXME -- semantic checks for dependent attributes
+ }
if (pointer)
D->addAttr(::new (S.Context) PtGuardedByAttr(Attr.getRange(),
Modified: cfe/branches/tooling/lib/Sema/SemaDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Sema/SemaDeclCXX.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Sema/SemaDeclCXX.cpp (original)
+++ cfe/branches/tooling/lib/Sema/SemaDeclCXX.cpp Mon Jan 23 02:39:37 2012
@@ -2505,9 +2505,12 @@
// Create a reference to the iteration variable.
ExprResult IterationVarRef
- = SemaRef.BuildDeclRefExpr(IterationVar, SizeType, VK_RValue, Loc);
+ = SemaRef.BuildDeclRefExpr(IterationVar, SizeType, VK_LValue, Loc);
assert(!IterationVarRef.isInvalid() &&
"Reference to invented variable cannot fail!");
+ IterationVarRef = SemaRef.DefaultLvalueConversion(IterationVarRef.take());
+ assert(!IterationVarRef.isInvalid() &&
+ "Conversion of invented variable cannot fail!");
// Subscript the array with this iteration variable.
CtorArg = SemaRef.CreateBuiltinArraySubscriptExpr(CtorArg.take(), Loc,
@@ -2673,8 +2676,8 @@
case IIK_Default:
return false;
}
-
- return false;
+
+ llvm_unreachable("Invalid ImplicitInitializerKind!");
}
};
}
@@ -7630,9 +7633,11 @@
// Create a reference to the iteration variable; we'll use this several
// times throughout.
Expr *IterationVarRef
- = S.BuildDeclRefExpr(IterationVar, SizeType, VK_RValue, Loc).take();
+ = S.BuildDeclRefExpr(IterationVar, SizeType, VK_LValue, Loc).take();
assert(IterationVarRef && "Reference to invented variable cannot fail!");
-
+ Expr *IterationVarRefRVal = S.DefaultLvalueConversion(IterationVarRef).take();
+ assert(IterationVarRefRVal && "Conversion of invented variable cannot fail!");
+
// Create the DeclStmt that holds the iteration variable.
Stmt *InitStmt = new (S.Context) DeclStmt(DeclGroupRef(IterationVar),Loc,Loc);
@@ -7640,7 +7645,7 @@
llvm::APInt Upper
= ArrayTy->getSize().zextOrTrunc(S.Context.getTypeSize(SizeType));
Expr *Comparison
- = new (S.Context) BinaryOperator(IterationVarRef,
+ = new (S.Context) BinaryOperator(IterationVarRefRVal,
IntegerLiteral::Create(S.Context, Upper, SizeType, Loc),
BO_NE, S.Context.BoolTy,
VK_RValue, OK_Ordinary, Loc);
@@ -7652,9 +7657,11 @@
// Subscript the "from" and "to" expressions with the iteration variable.
From = AssertSuccess(S.CreateBuiltinArraySubscriptExpr(From, Loc,
- IterationVarRef, Loc));
+ IterationVarRefRVal,
+ Loc));
To = AssertSuccess(S.CreateBuiltinArraySubscriptExpr(To, Loc,
- IterationVarRef, Loc));
+ IterationVarRefRVal,
+ Loc));
if (!Copying) // Cast to rvalue
From = CastForMoving(S, From);
@@ -7839,11 +7846,13 @@
PushOnScopeChains(CopyAssignment, S, false);
ClassDecl->addDecl(CopyAssignment);
- // C++0x [class.copy]p18:
- // ... If the class definition declares a move constructor or move
- // assignment operator, the implicitly declared copy assignment operator is
- // defined as deleted; ...
- if (ClassDecl->hasUserDeclaredMoveConstructor() ||
+ // C++0x [class.copy]p19:
+ // .... If the class definition does not explicitly declare a copy
+ // assignment operator, there is no user-declared move constructor, and
+ // there is no user-declared move assignment operator, a copy assignment
+ // operator is implicitly declared as defaulted.
+ if ((ClassDecl->hasUserDeclaredMoveConstructor() &&
+ !getLangOptions().MicrosoftMode) ||
ClassDecl->hasUserDeclaredMoveAssignment() ||
ShouldDeleteCopyAssignmentOperator(CopyAssignment))
CopyAssignment->setDeletedAsWritten();
@@ -8742,12 +8751,14 @@
PushOnScopeChains(CopyConstructor, S, false);
ClassDecl->addDecl(CopyConstructor);
- // C++0x [class.copy]p7:
- // ... If the class definition declares a move constructor or move
- // assignment operator, the implicitly declared constructor is defined as
- // deleted; ...
+ // C++11 [class.copy]p8:
+ // ... If the class definition does not explicitly declare a copy
+ // constructor, there is no user-declared move constructor, and there is no
+ // user-declared move assignment operator, a copy constructor is implicitly
+ // declared as defaulted.
if (ClassDecl->hasUserDeclaredMoveConstructor() ||
- ClassDecl->hasUserDeclaredMoveAssignment() ||
+ (ClassDecl->hasUserDeclaredMoveAssignment() &&
+ !getLangOptions().MicrosoftMode) ||
ShouldDeleteSpecialMember(CopyConstructor, CXXCopyConstructor))
CopyConstructor->setDeletedAsWritten();
@@ -10751,8 +10762,7 @@
// not have a vtable.
if (!Class->isDynamicClass() || Class->isDependentContext() ||
CurContext->isDependentContext() ||
- ExprEvalContexts.back().Context == Unevaluated ||
- ExprEvalContexts.back().Context == ConstantEvaluated)
+ ExprEvalContexts.back().Context == Unevaluated)
return;
// Try to insert this class into the map.
Modified: cfe/branches/tooling/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Sema/SemaExpr.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Sema/SemaExpr.cpp (original)
+++ cfe/branches/tooling/lib/Sema/SemaExpr.cpp Mon Jan 23 02:39:37 2012
@@ -1742,7 +1742,6 @@
return ActOnDependentIdExpression(SS, NameInfo, IsAddressOfOperand,
TemplateArgs);
- bool IvarLookupFollowUp = false;
// Perform the required lookup.
LookupResult R(*this, NameInfo,
(Id.getKind() == UnqualifiedId::IK_ImplicitSelfParam)
@@ -1762,7 +1761,7 @@
return ActOnDependentIdExpression(SS, NameInfo, IsAddressOfOperand,
TemplateArgs);
} else {
- IvarLookupFollowUp = (!SS.isSet() && II && getCurMethodDecl());
+ bool IvarLookupFollowUp = II && !SS.isSet() && getCurMethodDecl();
LookupParsedName(R, S, &SS, !IvarLookupFollowUp);
// If the result might be in a dependent base class, this is a dependent
@@ -1780,9 +1779,6 @@
if (Expr *Ex = E.takeAs<Expr>())
return Owned(Ex);
-
- // for further use, this must be set to false if in class method.
- IvarLookupFollowUp = getCurMethodDecl()->isInstanceMethod();
}
}
@@ -3016,6 +3012,12 @@
if (isInvalid)
return ExprError();
+ if (ExprKind == UETT_SizeOf && E->getType()->isVariableArrayType()) {
+ PE = TranformToPotentiallyEvaluated(E);
+ if (PE.isInvalid()) return ExprError();
+ E = PE.take();
+ }
+
// C99 6.5.3.4p4: the type (an unsigned integer type) is size_t.
return Owned(new (Context) UnaryExprOrTypeTraitExpr(
ExprKind, E, Context.getSizeType(), OpLoc,
@@ -3722,6 +3724,7 @@
DeclRefExpr *ConfigDR = new (Context) DeclRefExpr(
ConfigDecl, ConfigQTy, VK_LValue, LLLLoc);
+ MarkDeclarationReferenced(LLLLoc, ConfigDecl);
return ActOnCallExpr(S, ConfigDR, LLLLoc, ExecConfig, GGGLoc, 0,
/*IsExecConfig=*/true);
@@ -9439,6 +9442,12 @@
ExprNeedsCleanups = false;
}
+ExprResult Sema::HandleExprEvaluationContextForTypeof(Expr *E) {
+ if (!E->getType()->isVariablyModifiedType())
+ return E;
+ return TranformToPotentiallyEvaluated(E);
+}
+
/// \brief Note that the given declaration was referenced in the source code.
///
/// This routine should be invoke whenever a given declaration is referenced
@@ -9468,21 +9477,16 @@
switch (ExprEvalContexts.back().Context) {
case Unevaluated:
// We are in an expression that is not potentially evaluated; do nothing.
+ // (Depending on how you read the standard, we actually do need to do
+ // something here for null pointer constants, but the standard's
+ // definition of a null pointer constant is completely crazy.)
return;
case ConstantEvaluated:
- // We are in an expression that will be evaluated during translation; in
- // C++11, we need to define any functions which are used in case they're
- // constexpr, whereas in C++98, we only need to define static data members
- // of class templates.
- if (!getLangOptions().CPlusPlus ||
- (!getLangOptions().CPlusPlus0x && !isa<VarDecl>(D)))
- return;
- break;
-
case PotentiallyEvaluated:
- // We are in a potentially-evaluated expression, so this declaration is
- // "used"; handle this below.
+ // We are in a potentially evaluated expression (or a constant-expression
+ // in C++03); we need to do implicit template instantiation, implicitly
+ // define class members, and mark most declarations as used.
break;
case PotentiallyEvaluatedIfUsed:
@@ -9607,6 +9611,8 @@
// Keep track of used but undefined variables. We make a hole in
// the warning for static const data members with in-line
// initializers.
+ // FIXME: The hole we make for static const data members is too wide!
+ // We need to implement the C++11 rules for odr-used.
if (Var->hasDefinition() == VarDecl::DeclarationOnly
&& Var->getLinkage() != ExternalLinkage
&& !(Var->isStaticDataMember() && Var->hasInit())) {
Modified: cfe/branches/tooling/lib/Sema/SemaExprCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Sema/SemaExprCXX.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Sema/SemaExprCXX.cpp (original)
+++ cfe/branches/tooling/lib/Sema/SemaExprCXX.cpp Mon Jan 23 02:39:37 2012
@@ -993,8 +993,7 @@
// C++ 5.3.4p6: "The expression in a direct-new-declarator shall have integral
// or enumeration type with a non-negative value."
if (ArraySize && !ArraySize->isTypeDependent()) {
- // Eliminate placeholders.
- ExprResult ConvertedSize = CheckPlaceholderExpr(ArraySize);
+ ExprResult ConvertedSize = DefaultFunctionArrayLvalueConversion(ArraySize);
if (ConvertedSize.isInvalid())
return ExprError();
ArraySize = ConvertedSize.take();
@@ -4381,8 +4380,11 @@
return ExprError();
if (!ObjectType->isDependentType() && !ObjectType->isScalarType()) {
- Diag(OpLoc, diag::err_pseudo_dtor_base_not_scalar)
- << ObjectType << Base->getSourceRange();
+ if (getLangOptions().MicrosoftMode && ObjectType->isVoidType())
+ Diag(OpLoc, diag::ext_pseudo_dtor_on_void) << Base->getSourceRange();
+ else
+ Diag(OpLoc, diag::err_pseudo_dtor_base_not_scalar)
+ << ObjectType << Base->getSourceRange();
return ExprError();
}
Modified: cfe/branches/tooling/lib/Sema/SemaLookup.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Sema/SemaLookup.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Sema/SemaLookup.cpp (original)
+++ cfe/branches/tooling/lib/Sema/SemaLookup.cpp Mon Jan 23 02:39:37 2012
@@ -1732,7 +1732,6 @@
}
llvm_unreachable("unknown ambiguity kind");
- return true;
}
namespace {
Modified: cfe/branches/tooling/lib/Sema/SemaStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Sema/SemaStmt.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Sema/SemaStmt.cpp (original)
+++ cfe/branches/tooling/lib/Sema/SemaStmt.cpp Mon Jan 23 02:39:37 2012
@@ -495,7 +495,7 @@
if (!Cond)
return StmtError();
- CondResult = CheckPlaceholderExpr(Cond);
+ CondResult = DefaultFunctionArrayLvalueConversion(Cond);
if (CondResult.isInvalid())
return StmtError();
@@ -862,39 +862,35 @@
std::unique(EnumVals.begin(), EnumVals.end(), EqEnumVals);
// See which case values aren't in enum.
- // TODO: we might want to check whether case values are out of the
- // enum even if we don't want to check whether all cases are handled.
- if (!TheDefaultStmt) {
- EnumValsTy::const_iterator EI = EnumVals.begin();
- for (CaseValsTy::const_iterator CI = CaseVals.begin();
- CI != CaseVals.end(); CI++) {
- while (EI != EIend && EI->first < CI->first)
- EI++;
- if (EI == EIend || EI->first > CI->first)
- Diag(CI->second->getLHS()->getExprLoc(), diag::warn_not_in_enum)
- << ED->getDeclName();
+ EnumValsTy::const_iterator EI = EnumVals.begin();
+ for (CaseValsTy::const_iterator CI = CaseVals.begin();
+ CI != CaseVals.end(); CI++) {
+ while (EI != EIend && EI->first < CI->first)
+ EI++;
+ if (EI == EIend || EI->first > CI->first)
+ Diag(CI->second->getLHS()->getExprLoc(), diag::warn_not_in_enum)
+ << ED->getDeclName();
+ }
+ // See which of case ranges aren't in enum
+ EI = EnumVals.begin();
+ for (CaseRangesTy::const_iterator RI = CaseRanges.begin();
+ RI != CaseRanges.end() && EI != EIend; RI++) {
+ while (EI != EIend && EI->first < RI->first)
+ EI++;
+
+ if (EI == EIend || EI->first != RI->first) {
+ Diag(RI->second->getLHS()->getExprLoc(), diag::warn_not_in_enum)
+ << ED->getDeclName();
}
- // See which of case ranges aren't in enum
- EI = EnumVals.begin();
- for (CaseRangesTy::const_iterator RI = CaseRanges.begin();
- RI != CaseRanges.end() && EI != EIend; RI++) {
- while (EI != EIend && EI->first < RI->first)
- EI++;
-
- if (EI == EIend || EI->first != RI->first) {
- Diag(RI->second->getLHS()->getExprLoc(), diag::warn_not_in_enum)
- << ED->getDeclName();
- }
- llvm::APSInt Hi =
- RI->second->getRHS()->EvaluateKnownConstInt(Context);
- AdjustAPSInt(Hi, CondWidth, CondIsSigned);
- while (EI != EIend && EI->first < Hi)
- EI++;
- if (EI == EIend || EI->first != Hi)
- Diag(RI->second->getRHS()->getExprLoc(), diag::warn_not_in_enum)
- << ED->getDeclName();
- }
+ llvm::APSInt Hi =
+ RI->second->getRHS()->EvaluateKnownConstInt(Context);
+ AdjustAPSInt(Hi, CondWidth, CondIsSigned);
+ while (EI != EIend && EI->first < Hi)
+ EI++;
+ if (EI == EIend || EI->first != Hi)
+ Diag(RI->second->getRHS()->getExprLoc(), diag::warn_not_in_enum)
+ << ED->getDeclName();
}
// Check which enum vals aren't in switch
@@ -904,7 +900,7 @@
SmallVector<DeclarationName,8> UnhandledNames;
- for (EnumValsTy::const_iterator EI = EnumVals.begin(); EI != EIend; EI++){
+ for (EI = EnumVals.begin(); EI != EIend; EI++){
// Drop unneeded case values
llvm::APSInt CIVal;
while (CI != CaseVals.end() && CI->first < EI->first)
@@ -924,28 +920,34 @@
if (RI == CaseRanges.end() || EI->first < RI->first) {
hasCasesNotInSwitch = true;
- if (!TheDefaultStmt)
- UnhandledNames.push_back(EI->second->getDeclName());
+ UnhandledNames.push_back(EI->second->getDeclName());
}
}
+ if (TheDefaultStmt && UnhandledNames.empty())
+ Diag(TheDefaultStmt->getDefaultLoc(), diag::warn_unreachable_default);
+
// Produce a nice diagnostic if multiple values aren't handled.
switch (UnhandledNames.size()) {
case 0: break;
case 1:
- Diag(CondExpr->getExprLoc(), diag::warn_missing_case1)
+ Diag(CondExpr->getExprLoc(), TheDefaultStmt
+ ? diag::warn_def_missing_case1 : diag::warn_missing_case1)
<< UnhandledNames[0];
break;
case 2:
- Diag(CondExpr->getExprLoc(), diag::warn_missing_case2)
+ Diag(CondExpr->getExprLoc(), TheDefaultStmt
+ ? diag::warn_def_missing_case2 : diag::warn_missing_case2)
<< UnhandledNames[0] << UnhandledNames[1];
break;
case 3:
- Diag(CondExpr->getExprLoc(), diag::warn_missing_case3)
+ Diag(CondExpr->getExprLoc(), TheDefaultStmt
+ ? diag::warn_def_missing_case3 : diag::warn_missing_case3)
<< UnhandledNames[0] << UnhandledNames[1] << UnhandledNames[2];
break;
default:
- Diag(CondExpr->getExprLoc(), diag::warn_missing_cases)
+ Diag(CondExpr->getExprLoc(), TheDefaultStmt
+ ? diag::warn_def_missing_cases : diag::warn_missing_cases)
<< (unsigned)UnhandledNames.size()
<< UnhandledNames[0] << UnhandledNames[1] << UnhandledNames[2];
break;
Modified: cfe/branches/tooling/lib/Sema/SemaTemplateDeduction.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Sema/SemaTemplateDeduction.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Sema/SemaTemplateDeduction.cpp (original)
+++ cfe/branches/tooling/lib/Sema/SemaTemplateDeduction.cpp Mon Jan 23 02:39:37 2012
@@ -278,7 +278,7 @@
return X;
}
- return DeducedTemplateArgument();
+ llvm_unreachable("Invalid TemplateArgument Kind!");
}
/// \brief Deduce the value of the given non-type template parameter
@@ -1335,8 +1335,8 @@
SmallVector<const RecordType *, 8> ToVisit;
ToVisit.push_back(RecordT);
bool Successful = false;
- SmallVectorImpl<DeducedTemplateArgument> DeducedOrig(0);
- DeducedOrig = Deduced;
+ SmallVector<DeducedTemplateArgument, 8> DeducedOrig(Deduced.begin(),
+ Deduced.end());
while (!ToVisit.empty()) {
// Retrieve the next class in the inheritance hierarchy.
const RecordType *NextT = ToVisit.back();
@@ -1358,7 +1358,8 @@
// from this base class.
if (BaseResult == Sema::TDK_Success) {
Successful = true;
- DeducedOrig = Deduced;
+ DeducedOrig.clear();
+ DeducedOrig.append(Deduced.begin(), Deduced.end());
}
else
Deduced = DeducedOrig;
@@ -1528,7 +1529,7 @@
return Sema::TDK_Success;
}
- return Sema::TDK_Success;
+ llvm_unreachable("Invalid Type Class!");
}
static Sema::TemplateDeductionResult
@@ -1569,7 +1570,6 @@
case TemplateArgument::TemplateExpansion:
llvm_unreachable("caller should handle pack expansions");
- break;
case TemplateArgument::Declaration:
if (Arg.getKind() == TemplateArgument::Declaration &&
@@ -1629,7 +1629,7 @@
llvm_unreachable("Argument packs should be expanded by the caller!");
}
- return Sema::TDK_Success;
+ llvm_unreachable("Invalid TemplateArgument Kind!");
}
/// \brief Determine whether there is a template argument to be used for
@@ -1879,7 +1879,7 @@
return true;
}
- return false;
+ llvm_unreachable("Invalid TemplateArgument Kind!");
}
/// \brief Allocate a TemplateArgumentLoc where all locations have
@@ -1904,7 +1904,6 @@
switch (Arg.getKind()) {
case TemplateArgument::Null:
llvm_unreachable("Can't get a NULL template argument here");
- break;
case TemplateArgument::Type:
return TemplateArgumentLoc(Arg,
@@ -1949,7 +1948,7 @@
return TemplateArgumentLoc(Arg, TemplateArgumentLocInfo());
}
- return TemplateArgumentLoc();
+ llvm_unreachable("Invalid TemplateArgument Kind!");
}
Modified: cfe/branches/tooling/lib/Sema/SemaTemplateInstantiate.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Sema/SemaTemplateInstantiate.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Sema/SemaTemplateInstantiate.cpp (original)
+++ cfe/branches/tooling/lib/Sema/SemaTemplateInstantiate.cpp Mon Jan 23 02:39:37 2012
@@ -1654,6 +1654,10 @@
return Invalid;
}
+// Defined via #include from SemaTemplateInstantiateDecl.cpp
+Attr* instantiateTemplateAttribute(const Attr *At, ASTContext &C, Sema &S,
+ const MultiLevelTemplateArgumentList &TemplateArgs);
+
/// \brief Instantiate the definition of a class from a given pattern.
///
/// \param PointOfInstantiation The point of instantiation within the
@@ -1763,6 +1767,10 @@
SmallVector<Decl*, 4> Fields;
SmallVector<std::pair<FieldDecl*, FieldDecl*>, 4>
FieldsWithMemberInitializers;
+ // Delay instantiation of late parsed attributes.
+ LateInstantiatedAttrVec LateAttrs;
+ Instantiator.enableLateAttributeInstantiation(&LateAttrs);
+
for (RecordDecl::decl_iterator Member = Pattern->decls_begin(),
MemberEnd = Pattern->decls_end();
Member != MemberEnd; ++Member) {
@@ -1822,6 +1830,21 @@
}
}
+ // Instantiate late parsed attributes, and attach them to their decls.
+ // See Sema::InstantiateAttrs
+ for (LateInstantiatedAttrVec::iterator I = LateAttrs.begin(),
+ E = LateAttrs.end(); I != E; ++I) {
+ assert(CurrentInstantiationScope == Instantiator.getStartingScope());
+ CurrentInstantiationScope = I->Scope;
+ Attr *NewAttr =
+ instantiateTemplateAttribute(I->TmplAttr, Context, *this, TemplateArgs);
+ I->NewDecl->addAttr(NewAttr);
+ LocalInstantiationScope::deleteScopes(I->Scope,
+ Instantiator.getStartingScope());
+ }
+ Instantiator.disableLateAttributeInstantiation();
+ LateAttrs.clear();
+
if (!FieldsWithMemberInitializers.empty())
ActOnFinishDelayedMemberInitializers(Instantiation);
Modified: cfe/branches/tooling/lib/Sema/SemaTemplateInstantiateDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Sema/SemaTemplateInstantiateDecl.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Sema/SemaTemplateInstantiateDecl.cpp (original)
+++ cfe/branches/tooling/lib/Sema/SemaTemplateInstantiateDecl.cpp Mon Jan 23 02:39:37 2012
@@ -57,12 +57,17 @@
return false;
}
-// FIXME: Is this still too simple?
+// Include attribute instantiation code.
+#include "clang/Sema/AttrTemplateInstantiate.inc"
+
void Sema::InstantiateAttrs(const MultiLevelTemplateArgumentList &TemplateArgs,
- const Decl *Tmpl, Decl *New) {
+ const Decl *Tmpl, Decl *New,
+ LateInstantiatedAttrVec *LateAttrs,
+ LocalInstantiationScope *OuterMostScope) {
for (AttrVec::const_iterator i = Tmpl->attr_begin(), e = Tmpl->attr_end();
i != e; ++i) {
const Attr *TmplAttr = *i;
+
// FIXME: This should be generalized to more than just the AlignedAttr.
if (const AlignedAttr *Aligned = dyn_cast<AlignedAttr>(TmplAttr)) {
if (Aligned->isAlignmentDependent()) {
@@ -87,9 +92,18 @@
}
}
- // FIXME: Is cloning correct for all attributes?
- Attr *NewAttr = TmplAttr->clone(Context);
- New->addAttr(NewAttr);
+ if (TmplAttr->isLateParsed() && LateAttrs) {
+ // Late parsed attributes must be instantiated and attached after the
+ // enclosing class has been instantiated. See Sema::InstantiateClass.
+ LocalInstantiationScope *Saved = 0;
+ if (CurrentInstantiationScope)
+ Saved = CurrentInstantiationScope->cloneScopes(OuterMostScope);
+ LateAttrs->push_back(LateInstantiatedAttribute(TmplAttr, Saved, New));
+ } else {
+ Attr *NewAttr =
+ instantiateTemplateAttribute(TmplAttr, Context, *this, TemplateArgs);
+ New->addAttr(NewAttr);
+ }
}
}
@@ -493,7 +507,7 @@
return 0;
}
- SemaRef.InstantiateAttrs(TemplateArgs, D, Field);
+ SemaRef.InstantiateAttrs(TemplateArgs, D, Field, LateAttrs, StartingScope);
if (Invalid)
Field->setInvalidDecl();
@@ -1374,8 +1388,7 @@
}
SmallVector<ParmVarDecl *, 4> Params;
- TypeSourceInfo *TInfo = D->getTypeSourceInfo();
- TInfo = SubstFunctionType(D, Params);
+ TypeSourceInfo *TInfo = SubstFunctionType(D, Params);
if (!TInfo)
return 0;
QualType T = TInfo->getType();
@@ -2377,7 +2390,8 @@
// Get the definition. Leaves the variable unchanged if undefined.
Tmpl->isDefined(Definition);
- SemaRef.InstantiateAttrs(TemplateArgs, Definition, New);
+ SemaRef.InstantiateAttrs(TemplateArgs, Definition, New,
+ LateAttrs, StartingScope);
return false;
}
Modified: cfe/branches/tooling/lib/Sema/SemaTemplateVariadic.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Sema/SemaTemplateVariadic.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Sema/SemaTemplateVariadic.cpp (original)
+++ cfe/branches/tooling/lib/Sema/SemaTemplateVariadic.cpp Mon Jan 23 02:39:37 2012
@@ -388,7 +388,6 @@
return Arg.getTemplatePackExpansion(EllipsisLoc);
}
llvm_unreachable("Unhandled template argument kind?");
- return ParsedTemplateArgument();
}
TypeResult Sema::ActOnPackExpansion(ParsedType Type,
@@ -632,7 +631,6 @@
}
llvm_unreachable("No unexpanded parameter packs in type expansion.");
- return 0;
}
bool Sema::containsUnexpandedParameterPacks(Declarator &D) {
@@ -695,7 +693,6 @@
// declarator-id (conceptually), so the parser should not invoke this
// routine at this time.
llvm_unreachable("Could not have seen this kind of declarator chunk");
- break;
case DeclaratorChunk::MemberPointer:
if (Chunk.Mem.Scope().getScopeRep() &&
Modified: cfe/branches/tooling/lib/Sema/SemaType.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Sema/SemaType.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Sema/SemaType.cpp (original)
+++ cfe/branches/tooling/lib/Sema/SemaType.cpp Mon Jan 23 02:39:37 2012
@@ -1059,8 +1059,7 @@
// If we are in an unevaluated context, like sizeof, skip adding a
// qualification.
- } else if (S.ExprEvalContexts.back().Context == Sema::Unevaluated ||
- S.ExprEvalContexts.back().Context == Sema::ConstantEvaluated) {
+ } else if (S.ExprEvalContexts.back().Context == Sema::Unevaluated) {
return type;
// If that failed, give an error and recover using __autoreleasing.
@@ -1794,10 +1793,8 @@
switch (D.getContext()) {
case Declarator::KNRTypeListContext:
llvm_unreachable("K&R type lists aren't allowed in C++");
- break;
case Declarator::LambdaExprContext:
llvm_unreachable("Can't specify a type specifier in lambda grammar");
- break;
case Declarator::ObjCParameterContext:
case Declarator::ObjCResultContext:
case Declarator::PrototypeContext:
@@ -2327,7 +2324,6 @@
case NestedNameSpecifier::NamespaceAlias:
case NestedNameSpecifier::Global:
llvm_unreachable("Nested-name-specifier must name a type");
- break;
case NestedNameSpecifier::TypeSpec:
case NestedNameSpecifier::TypeSpecWithTemplate:
@@ -2659,7 +2655,7 @@
const char *attrStr = 0;
switch (ownership) {
- case Qualifiers::OCL_None: llvm_unreachable("no ownership!"); break;
+ case Qualifiers::OCL_None: llvm_unreachable("no ownership!");
case Qualifiers::OCL_ExplicitNone: attrStr = "none"; break;
case Qualifiers::OCL_Strong: attrStr = "strong"; break;
case Qualifiers::OCL_Weak: attrStr = "weak"; break;
@@ -2780,7 +2776,6 @@
return AttributeList::AT_pcs;
}
llvm_unreachable("unexpected attribute kind!");
- return AttributeList::Kind();
}
static void fillAttributedTypeLoc(AttributedTypeLoc TL,
@@ -3055,7 +3050,6 @@
case NestedNameSpecifier::NamespaceAlias:
case NestedNameSpecifier::Global:
llvm_unreachable("Nested-name-specifier must name a type");
- break;
}
// Finally fill in MemberPointerLocInfo fields.
@@ -3572,7 +3566,6 @@
}
llvm_unreachable("unknown wrapping kind");
- return QualType();
}
};
}
Modified: cfe/branches/tooling/lib/StaticAnalyzer/Checkers/ArrayBoundCheckerV2.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/StaticAnalyzer/Checkers/ArrayBoundCheckerV2.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/StaticAnalyzer/Checkers/ArrayBoundCheckerV2.cpp (original)
+++ cfe/branches/tooling/lib/StaticAnalyzer/Checkers/ArrayBoundCheckerV2.cpp Mon Jan 23 02:39:37 2012
@@ -28,7 +28,7 @@
public Checker<check::Location> {
mutable llvm::OwningPtr<BuiltinBug> BT;
- enum OOB_Kind { OOB_Precedes, OOB_Excedes };
+ enum OOB_Kind { OOB_Precedes, OOB_Excedes, OOB_Tainted };
void reportOOB(CheckerContext &C, const ProgramState *errorState,
OOB_Kind kind) const;
@@ -157,7 +157,7 @@
// If we are under constrained and the index variables are tainted, report.
if (state_exceedsUpperBound && state_withinUpperBound) {
if (state->isTainted(rawOffset.getByteOffset()))
- reportOOB(checkerContext, state_exceedsUpperBound, OOB_Excedes);
+ reportOOB(checkerContext, state_exceedsUpperBound, OOB_Tainted);
return;
}
@@ -193,9 +193,18 @@
llvm::SmallString<256> buf;
llvm::raw_svector_ostream os(buf);
- os << "Out of bound memory access "
- << (kind == OOB_Precedes ? "(accessed memory precedes memory block)"
- : "(access exceeds upper limit of memory block)");
+ os << "Out of bound memory access ";
+ switch (kind) {
+ case OOB_Precedes:
+ os << "(accessed memory precedes memory block)";
+ break;
+ case OOB_Excedes:
+ os << "(access exceeds upper limit of memory block)";
+ break;
+ case OOB_Tainted:
+ os << "(index is tainted)";
+ break;
+ }
checkerContext.EmitReport(new BugReport(*BT, os.str(), errorNode));
}
Modified: cfe/branches/tooling/lib/StaticAnalyzer/Checkers/DivZeroChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/StaticAnalyzer/Checkers/DivZeroChecker.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/StaticAnalyzer/Checkers/DivZeroChecker.cpp (original)
+++ cfe/branches/tooling/lib/StaticAnalyzer/Checkers/DivZeroChecker.cpp Mon Jan 23 02:39:37 2012
@@ -24,11 +24,31 @@
namespace {
class DivZeroChecker : public Checker< check::PreStmt<BinaryOperator> > {
mutable llvm::OwningPtr<BuiltinBug> BT;
+ void reportBug(const char *Msg,
+ const ProgramState *StateZero,
+ CheckerContext &C) const ;
public:
void checkPreStmt(const BinaryOperator *B, CheckerContext &C) const;
};
} // end anonymous namespace
+void DivZeroChecker::reportBug(const char *Msg,
+ const ProgramState *StateZero,
+ CheckerContext &C) const {
+ if (ExplodedNode *N = C.generateSink(StateZero)) {
+ if (!BT)
+ BT.reset(new BuiltinBug("Division by zero"));
+
+ BugReport *R =
+ new BugReport(*BT, Msg, N);
+
+ R->addVisitor(bugreporter::getTrackNullOrUndefValueVisitor(N,
+ bugreporter::GetDenomExpr(N)));
+
+ C.EmitReport(R);
+ }
+}
+
void DivZeroChecker::checkPreStmt(const BinaryOperator *B,
CheckerContext &C) const {
BinaryOperator::Opcode Op = B->getOpcode();
@@ -57,18 +77,13 @@
if (!stateNotZero) {
assert(stateZero);
- if (ExplodedNode *N = C.generateSink(stateZero)) {
- if (!BT)
- BT.reset(new BuiltinBug("Division by zero"));
-
- BugReport *R =
- new BugReport(*BT, BT->getDescription(), N);
-
- R->addVisitor(bugreporter::getTrackNullOrUndefValueVisitor(N,
- bugreporter::GetDenomExpr(N)));
+ reportBug("Division by zero", stateZero, C);
+ return;
+ }
- C.EmitReport(R);
- }
+ bool TaintedD = C.getState()->isTainted(*DV);
+ if ((stateNotZero && stateZero && TaintedD)) {
+ reportBug("Division by a tainted value, possibly zero", stateZero, C);
return;
}
Modified: cfe/branches/tooling/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp (original)
+++ cfe/branches/tooling/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp Mon Jan 23 02:39:37 2012
@@ -225,14 +225,11 @@
case Builtin::BIstrncpy:
case Builtin::BIstrncat:
return TaintPropagationRule(1, 2, 0, true);
- break;
case Builtin::BIstrlcpy:
case Builtin::BIstrlcat:
return TaintPropagationRule(1, 2, 0, false);
- break;
case Builtin::BIstrndup:
return TaintPropagationRule(0, 1, ReturnValueIndex);
- break;
default:
break;
@@ -409,8 +406,8 @@
const PointerType *ArgTy =
dyn_cast<PointerType>(Arg->getType().getCanonicalType().getTypePtr());
- assert(ArgTy);
- SVal Val = State->getSVal(*AddrLoc, ArgTy->getPointeeType());
+ SVal Val = State->getSVal(*AddrLoc,
+ ArgTy ? ArgTy->getPointeeType(): QualType());
return Val.getAsSymbol();
}
Modified: cfe/branches/tooling/lib/StaticAnalyzer/Checkers/PthreadLockChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/StaticAnalyzer/Checkers/PthreadLockChecker.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/StaticAnalyzer/Checkers/PthreadLockChecker.cpp (original)
+++ cfe/branches/tooling/lib/StaticAnalyzer/Checkers/PthreadLockChecker.cpp Mon Jan 23 02:39:37 2012
@@ -135,7 +135,6 @@
break;
default:
llvm_unreachable("Unknown tryLock locking semantics");
- break;
}
assert(lockFail && lockSucc);
C.addTransition(lockFail);
Modified: cfe/branches/tooling/lib/StaticAnalyzer/Checkers/VLASizeChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/StaticAnalyzer/Checkers/VLASizeChecker.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/StaticAnalyzer/Checkers/VLASizeChecker.cpp (original)
+++ cfe/branches/tooling/lib/StaticAnalyzer/Checkers/VLASizeChecker.cpp Mon Jan 23 02:39:37 2012
@@ -26,14 +26,52 @@
namespace {
class VLASizeChecker : public Checker< check::PreStmt<DeclStmt> > {
- mutable llvm::OwningPtr<BugType> BT_zero;
- mutable llvm::OwningPtr<BugType> BT_undef;
-
+ mutable llvm::OwningPtr<BugType> BT;
+ enum VLASize_Kind { VLA_Garbage, VLA_Zero, VLA_Tainted };
+
+ void reportBug(VLASize_Kind Kind,
+ const Expr *SizeE,
+ const ProgramState *State,
+ CheckerContext &C) const;
public:
void checkPreStmt(const DeclStmt *DS, CheckerContext &C) const;
};
} // end anonymous namespace
+void VLASizeChecker::reportBug(VLASize_Kind Kind,
+ const Expr *SizeE,
+ const ProgramState *State,
+ CheckerContext &C) const {
+ // Generate an error node.
+ ExplodedNode *N = C.generateSink(State);
+ if (!N)
+ return;
+
+ if (!BT)
+ BT.reset(new BuiltinBug("Dangerous variable-length array (VLA) declaration"));
+
+ llvm::SmallString<256> buf;
+ llvm::raw_svector_ostream os(buf);
+ os << "Declared variable-length array (VLA) ";
+ switch (Kind) {
+ case VLA_Garbage:
+ os << "uses a garbage value as its size";
+ break;
+ case VLA_Zero:
+ os << "has zero size";
+ break;
+ case VLA_Tainted:
+ os << "has tainted size";
+ break;
+ }
+
+ BugReport *report = new BugReport(*BT, os.str(), N);
+ report->addRange(SizeE->getSourceRange());
+ report->addVisitor(bugreporter::getTrackNullOrUndefValueVisitor(N, SizeE));
+ C.EmitReport(report);
+ return;
+}
+
void VLASizeChecker::checkPreStmt(const DeclStmt *DS, CheckerContext &C) const {
if (!DS->isSingleDecl())
return;
@@ -53,20 +91,7 @@
SVal sizeV = state->getSVal(SE, C.getLocationContext());
if (sizeV.isUndef()) {
- // Generate an error node.
- ExplodedNode *N = C.generateSink();
- if (!N)
- return;
-
- if (!BT_undef)
- BT_undef.reset(new BuiltinBug("Declared variable-length array (VLA) "
- "uses a garbage value as its size"));
-
- BugReport *report =
- new BugReport(*BT_undef, BT_undef->getName(), N);
- report->addRange(SE->getSourceRange());
- report->addVisitor(bugreporter::getTrackNullOrUndefValueVisitor(N, SE));
- C.EmitReport(report);
+ reportBug(VLA_Garbage, SE, state, C);
return;
}
@@ -75,6 +100,12 @@
if (sizeV.isUnknown())
return;
+ // Check if the size is tainted.
+ if (state->isTainted(sizeV)) {
+ reportBug(VLA_Tainted, SE, 0, C);
+ return;
+ }
+
// Check if the size is zero.
DefinedSVal sizeD = cast<DefinedSVal>(sizeV);
@@ -82,16 +113,7 @@
llvm::tie(stateNotZero, stateZero) = state->assume(sizeD);
if (stateZero && !stateNotZero) {
- ExplodedNode *N = C.generateSink(stateZero);
- if (!BT_zero)
- BT_zero.reset(new BuiltinBug("Declared variable-length array (VLA) has "
- "zero size"));
-
- BugReport *report =
- new BugReport(*BT_zero, BT_zero->getName(), N);
- report->addRange(SE->getSourceRange());
- report->addVisitor(bugreporter::getTrackNullOrUndefValueVisitor(N, SE));
- C.EmitReport(report);
+ reportBug(VLA_Zero, SE, stateZero, C);
return;
}
Modified: cfe/branches/tooling/lib/StaticAnalyzer/Core/CheckerContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/StaticAnalyzer/Core/CheckerContext.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/StaticAnalyzer/Core/CheckerContext.cpp (original)
+++ cfe/branches/tooling/lib/StaticAnalyzer/Core/CheckerContext.cpp Mon Jan 23 02:39:37 2012
@@ -56,13 +56,10 @@
}
StringRef CheckerContext::getMacroNameOrSpelling(SourceLocation &Loc) {
- if (!Loc.isMacroID()) {
- SmallVector<char, 16> buf;
- return Lexer::getSpelling(Loc, buf, getSourceManager(), getLangOptions());
- } else {
+ if (Loc.isMacroID())
return Lexer::getImmediateMacroName(Loc, getSourceManager(),
getLangOptions());
- }
- return StringRef();
+ SmallVector<char, 16> buf;
+ return Lexer::getSpelling(Loc, buf, getSourceManager(), getLangOptions());
}
Modified: cfe/branches/tooling/lib/StaticAnalyzer/Core/Environment.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/StaticAnalyzer/Core/Environment.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/StaticAnalyzer/Core/Environment.cpp (original)
+++ cfe/branches/tooling/lib/StaticAnalyzer/Core/Environment.cpp Mon Jan 23 02:39:37 2012
@@ -59,7 +59,6 @@
case Stmt::GenericSelectionExprClass:
llvm_unreachable("ParenExprs and GenericSelectionExprs should "
"have been handled by IgnoreParens()");
- return UnknownVal();
case Stmt::CharacterLiteralClass: {
const CharacterLiteral* C = cast<CharacterLiteral>(E);
return svalBuilder.makeIntVal(C->getValue(), C->getType());
Modified: cfe/branches/tooling/lib/StaticAnalyzer/Core/ExprEngine.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/StaticAnalyzer/Core/ExprEngine.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/StaticAnalyzer/Core/ExprEngine.cpp (original)
+++ cfe/branches/tooling/lib/StaticAnalyzer/Core/ExprEngine.cpp Mon Jan 23 02:39:37 2012
@@ -211,8 +211,6 @@
ProcessImplicitDtor(*E.getAs<CFGImplicitDtor>(), Pred);
return;
}
- currentStmtIdx = 0;
- currentBuilderContext = 0;
}
static bool shouldRemoveDeadBindings(AnalysisManager &AMgr,
@@ -529,7 +527,6 @@
case Stmt::WhileStmtClass:
case Expr::MSDependentExistsStmtClass:
llvm_unreachable("Stmt should not be in analyzer evaluation loop");
- break;
case Stmt::GNUNullExprClass: {
// GNU __null is a pointer-width integer, not an actual pointer.
Modified: cfe/branches/tooling/lib/StaticAnalyzer/Core/SimpleConstraintManager.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/StaticAnalyzer/Core/SimpleConstraintManager.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/lib/StaticAnalyzer/Core/SimpleConstraintManager.cpp (original)
+++ cfe/branches/tooling/lib/StaticAnalyzer/Core/SimpleConstraintManager.cpp Mon Jan 23 02:39:37 2012
@@ -231,16 +231,12 @@
switch (SE->getOpcode()) {
case BO_Add:
return SE->getRHS();
- break;
case BO_Sub:
return -SE->getRHS();
- break;
default:
// We cannot simplify non-additive operators.
return DefaultAdjustment;
}
-
- return DefaultAdjustment;
}
const ProgramState *SimpleConstraintManager::assumeSymRel(const ProgramState *state,
Modified: cfe/branches/tooling/runtime/libcxx/Makefile
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/runtime/libcxx/Makefile?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/runtime/libcxx/Makefile (original)
+++ cfe/branches/tooling/runtime/libcxx/Makefile Mon Jan 23 02:39:37 2012
@@ -25,7 +25,7 @@
install-local::
$(MAKE) -C $(LIBCXX_SRC_ROOT) \
- HEADER_DIR=$(PROJ_libcxx_hdrs) do-installhdrs
+ HEADER_DIR=$(PROJ_libcxx_hdrs) installheaders
endif
endif
Modified: cfe/branches/tooling/test/ARCMT/GC-no-arc-runtime.m.result
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/ARCMT/GC-no-arc-runtime.m.result?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/ARCMT/GC-no-arc-runtime.m.result (original)
+++ cfe/branches/tooling/test/ARCMT/GC-no-arc-runtime.m.result Mon Jan 23 02:39:37 2012
@@ -26,7 +26,7 @@
@end
@interface I2
- at property id prop;
+ at property (strong) id prop;
@end
@implementation I2
@@ -52,12 +52,12 @@
@end
@interface I4Impl {
- I4Impl *pds2;
+ I4Impl *__strong pds2;
}
@property (unsafe_unretained) I4Impl * pw1, * pw2;
- at property I4Impl * ps;
- at property I4Impl * pds;
- at property I4Impl * pds2;
+ at property (strong) I4Impl * ps;
+ at property (strong) I4Impl * pds;
+ at property (strong) I4Impl * pds2;
@end
@implementation I4Impl
Modified: cfe/branches/tooling/test/ARCMT/GC.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/ARCMT/GC.m?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/ARCMT/GC.m (original)
+++ cfe/branches/tooling/test/ARCMT/GC.m Mon Jan 23 02:39:37 2012
@@ -79,3 +79,14 @@
id x = NSMakeCollectable(cft);
}
@end
+
+// rdar://10532449
+ at interface rdar10532449
+ at property (assign) id assign_prop;
+ at property (assign, readonly) id __strong strong_readonly_prop;
+ at property (assign) id __weak weak_prop;
+ at end
+
+ at implementation rdar10532449
+ at synthesize assign_prop, strong_readonly_prop, weak_prop;
+ at end
Modified: cfe/branches/tooling/test/ARCMT/GC.m.result
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/ARCMT/GC.m.result?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/ARCMT/GC.m.result (original)
+++ cfe/branches/tooling/test/ARCMT/GC.m.result Mon Jan 23 02:39:37 2012
@@ -26,7 +26,7 @@
@end
@interface I2
- at property id prop;
+ at property (strong) id prop;
@end
@implementation I2
@@ -52,15 +52,15 @@
@end
@interface I4Impl {
- I4Impl *pds2;
+ I4Impl *__strong pds2;
I4Impl *pds3;
__weak I4Impl *pw3;
__weak I4Impl *pw4;
}
@property (weak) I4Impl * pw1, * pw2;
- at property I4Impl * ps;
- at property I4Impl * pds;
- at property I4Impl * pds2;
+ at property (strong) I4Impl * ps;
+ at property (strong) I4Impl * pds;
+ at property (strong) I4Impl * pds2;
@property (readwrite) I4Impl * pds3;
@property (readonly) I4Impl * pds4;
@property (weak, readonly) I4Impl *pw3;
@@ -74,3 +74,14 @@
id x = CFBridgingRelease(cft);
}
@end
+
+// rdar://10532449
+ at interface rdar10532449
+ at property (strong) id assign_prop;
+ at property (strong, readonly) id strong_readonly_prop;
+ at property (weak) id weak_prop;
+ at end
+
+ at implementation rdar10532449
+ at synthesize assign_prop, strong_readonly_prop, weak_prop;
+ at end
Modified: cfe/branches/tooling/test/ARCMT/assign-prop-with-arc-runtime.m.result
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/ARCMT/assign-prop-with-arc-runtime.m.result?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/ARCMT/assign-prop-with-arc-runtime.m.result (original)
+++ cfe/branches/tooling/test/ARCMT/assign-prop-with-arc-runtime.m.result Mon Jan 23 02:39:37 2012
@@ -38,9 +38,9 @@
@property (weak) Foo *no_user_ivar1;
@property (weak, readonly) Foo *no_user_ivar2;
- at property id def1;
- at property (atomic) id def2;
- at property (atomic) id def3;
+ at property (strong) id def1;
+ at property (atomic,strong) id def2;
+ at property (strong,atomic) id def3;
@end
@@ -58,12 +58,12 @@
@end
@interface TestExt
- at property (readonly) TestExt *x1;
+ at property (strong,readonly) TestExt *x1;
@property (weak, readonly) TestExt *x2;
@end
@interface TestExt()
- at property (readwrite) TestExt *x1;
+ at property (strong,readwrite) TestExt *x1;
@property (weak, readwrite) TestExt *x2;
@end
Modified: cfe/branches/tooling/test/ARCMT/driver-migrate.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/ARCMT/driver-migrate.m?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/ARCMT/driver-migrate.m (original)
+++ cfe/branches/tooling/test/ARCMT/driver-migrate.m Mon Jan 23 02:39:37 2012
@@ -3,9 +3,9 @@
// CHECK: "-arcmt-migrate" "-arcmt-migrate-directory" "{{[^"]*}}/foo/bar"
// RUN: touch %t.o
-// RUN: %clang -ccc-arcmt-check -ccc-host-triple i386-apple-darwin9 -### %t.o 2> %t.log
+// RUN: %clang -ccc-arcmt-check -target i386-apple-darwin9 -### %t.o 2> %t.log
// RUN: FileCheck -check-prefix=LINK %s < %t.log
-// RUN: %clang -ccc-arcmt-migrate /foo/bar -ccc-host-triple i386-apple-darwin9 -### %t.o 2> %t.log
+// RUN: %clang -ccc-arcmt-migrate /foo/bar -target i386-apple-darwin9 -### %t.o 2> %t.log
// RUN: FileCheck -check-prefix=LINK %s < %t.log
// LINK-NOT: {{ld(.exe)?"}}
Modified: cfe/branches/tooling/test/ARCMT/releases-driver.m.result
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/ARCMT/releases-driver.m.result?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/ARCMT/releases-driver.m.result (original)
+++ cfe/branches/tooling/test/ARCMT/releases-driver.m.result Mon Jan 23 02:39:37 2012
@@ -20,7 +20,7 @@
@interface Foo : NSObject {
id bar;
}
- at property id bar;
+ at property (strong) id bar;
-(void)test:(id)obj;
@end
Modified: cfe/branches/tooling/test/ARCMT/releases.m.result
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/ARCMT/releases.m.result?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/ARCMT/releases.m.result (original)
+++ cfe/branches/tooling/test/ARCMT/releases.m.result Mon Jan 23 02:39:37 2012
@@ -20,7 +20,7 @@
@interface Foo : NSObject {
id bar;
}
- at property id bar;
+ at property (strong) id bar;
-(void)test:(id)obj;
@end
Modified: cfe/branches/tooling/test/ARCMT/remove-dealloc-method.m.result
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/ARCMT/remove-dealloc-method.m.result?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/ARCMT/remove-dealloc-method.m.result (original)
+++ cfe/branches/tooling/test/ARCMT/remove-dealloc-method.m.result Mon Jan 23 02:39:37 2012
@@ -5,10 +5,10 @@
#define nil ((void*) 0)
@interface Foo
- at property id x;
- at property id y;
- at property id w;
- at property id z;
+ at property (strong) id x;
+ at property (strong) id y;
+ at property (strong) id w;
+ at property (strong) id z;
@end
@implementation Foo
Modified: cfe/branches/tooling/test/ARCMT/remove-dealloc-zerouts.m.result
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/ARCMT/remove-dealloc-zerouts.m.result?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/ARCMT/remove-dealloc-zerouts.m.result (original)
+++ cfe/branches/tooling/test/ARCMT/remove-dealloc-zerouts.m.result Mon Jan 23 02:39:37 2012
@@ -3,10 +3,10 @@
// RUN: diff %t %s.result
@interface Foo
- at property id x;
- at property id y;
- at property id w;
- at property id z;
+ at property (strong) id x;
+ at property (strong) id y;
+ at property (strong) id w;
+ at property (strong) id z;
@property (strong) id q;
@end
@@ -23,7 +23,7 @@
@end
@interface Bar
- at property Foo *a;
+ at property (strong) Foo *a;
- (void) setA:(Foo*) val;
- (id) a;
@end
Modified: cfe/branches/tooling/test/ARCMT/retains.m.result
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/ARCMT/retains.m.result?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/ARCMT/retains.m.result (original)
+++ cfe/branches/tooling/test/ARCMT/retains.m.result Mon Jan 23 02:39:37 2012
@@ -9,7 +9,7 @@
@interface Foo : NSObject {
id bar;
}
- at property id bar;
+ at property (strong) id bar;
-(id)test:(id)obj;
-(id)something;
@end
Modified: cfe/branches/tooling/test/Analysis/taint-generic.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Analysis/taint-generic.c?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Analysis/taint-generic.c (original)
+++ cfe/branches/tooling/test/Analysis/taint-generic.c Mon Jan 23 02:39:37 2012
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -analyze -analyzer-checker=experimental.security.taint,experimental.security.ArrayBoundV2 -Wno-format-security -verify %s
+// RUN: %clang_cc1 -analyze -analyzer-checker=experimental.security.taint,core,experimental.security.ArrayBoundV2 -Wno-format-security -verify %s
int scanf(const char *restrict format, ...);
int getchar(void);
@@ -49,7 +49,7 @@
void bufferScanfArithmetic2(int x) {
int n;
scanf("%d", &n);
- int m = 100 / (n + 3) * x;
+ int m = 100 - (n + 3) * x;
Buffer[m] = 1; // expected-warning {{Out of bound memory access }}
}
@@ -64,13 +64,13 @@
}
void scanfArg() {
- int t;
- scanf("%d", t); // expected-warning {{conversion specifies type 'int *' but the argument has type 'int'}}
+ int t = 0;
+ scanf("%d", t); // expected-warning {{format specifies type 'int *' but the argument has type 'int'}}
}
void bufferGetchar(int x) {
int m = getchar();
- Buffer[m] = 1; //expected-warning {{Out of bound memory access }}
+ Buffer[m] = 1; //expected-warning {{Out of bound memory access (index is tainted)}}
}
void testUncontrolledFormatString(char **p) {
@@ -171,3 +171,15 @@
execl(buffer, "filename", 0); // no-warning
}
+int testDivByZero() {
+ int x;
+ scanf("%d", &x);
+ return 5/x; // expected-warning {{Division by a tainted value, possibly zero}}
+}
+
+// Zero-sized VLAs.
+void testTaintedVLASize() {
+ int x;
+ scanf("%d", &x);
+ int vla[x]; // expected-warning{{Declared variable-length array (VLA) has tainted size}}
+}
Modified: cfe/branches/tooling/test/CodeGen/2009-10-20-GlobalDebug.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CodeGen/2009-10-20-GlobalDebug.c?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/CodeGen/2009-10-20-GlobalDebug.c (original)
+++ cfe/branches/tooling/test/CodeGen/2009-10-20-GlobalDebug.c Mon Jan 23 02:39:37 2012
@@ -1,5 +1,5 @@
// REQUIRES: x86-registered-target
-// RUN: %clang -ccc-host-triple i386-apple-darwin10 -flto -S -g %s -o - | FileCheck %s
+// RUN: %clang -target i386-apple-darwin10 -flto -S -g %s -o - | FileCheck %s
int global;
int main() {
static int localstatic;
Modified: cfe/branches/tooling/test/CodeGen/char-literal.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CodeGen/char-literal.c?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/CodeGen/char-literal.c (original)
+++ cfe/branches/tooling/test/CodeGen/char-literal.c Mon Jan 23 02:39:37 2012
@@ -14,17 +14,17 @@
// CHECK-CPP0X: store i8 98
char b = 'ab';
- // Should get concatonated characters
+ // Should get concatenated characters
// CHECK-C: store i32 24930
// CHECK-CPP0X: store i32 24930
int b1 = 'ab';
- // Should get concatonated characters
+ // Should get concatenated characters
// CHECK-C: store i32 808464432
// CHECK-CPP0X: store i32 808464432
int b2 = '0000';
- // Should get truncated value (last four characters concatonated)
+ // Should get truncated value (last four characters concatenated)
// CHECK-C: store i32 1919512167
// CHECK-CPP0X: store i32 1919512167
int b3 = 'somesillylongstring';
@@ -45,6 +45,20 @@
// CHECK-CPP0X: store i32 97
char32_t Ua = U'a';
+ // CHECK-CPP0X: store i16 1047
+ char16_t ua1 = u'Ð';
+ // CHECK-CPP0X: store i16 12538
+ char16_t ua2 = u'ãº';
+ // CHECK-CPP0X: store i16 -27177
+ char16_t ua3 = u'é';
+
+ // CHECK-CPP0X: store i32 181
+ char32_t Ua1 = U'µ';
+ // CHECK-CPP0X: store i32 38359
+ char32_t Ua2 = U'é';
+ // CHECK-CPP0X: store i32 128128
+ char32_t Ua3 = U'ð';
+
#endif
// CHECK-C: store i32 61451
Modified: cfe/branches/tooling/test/CodeGen/frame-pointer-elim.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CodeGen/frame-pointer-elim.c?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/CodeGen/frame-pointer-elim.c (original)
+++ cfe/branches/tooling/test/CodeGen/frame-pointer-elim.c Mon Jan 23 02:39:37 2012
@@ -1,6 +1,6 @@
// REQUIRES: x86-registered-target
-// RUN: %clang -ccc-host-triple i386-apple-darwin -S -o - %s | \
+// RUN: %clang -target i386-apple-darwin -S -o - %s | \
// RUN: FileCheck --check-prefix=DARWIN %s
// DARWIN: f0:
// DARWIN: pushl %ebp
@@ -9,7 +9,7 @@
// DARWIN: pushl %ebp
// DARWIN: ret
-// RUN: %clang -ccc-host-triple i386-pc-linux-gnu -S -o - %s | \
+// RUN: %clang -target i386-pc-linux-gnu -S -o - %s | \
// RUN: FileCheck --check-prefix=LINUX %s
// LINUX: f0:
// LINUX-NOT: pushl %ebp
@@ -18,7 +18,7 @@
// LINUX: pushl %ebp
// LINUX: ret
-// RUN: %clang -ccc-host-triple i386-darwin -S -o - -fomit-frame-pointer %s | \
+// RUN: %clang -target i386-darwin -S -o - -fomit-frame-pointer %s | \
// RUN: FileCheck --check-prefix=OMIT_ALL %s
// OMIT_ALL: f0:
// OMIT_ALL-NOT: pushl %ebp
@@ -27,7 +27,7 @@
// OMIT_ALL-NOT: pushl %ebp
// OMIT_ALL: ret
-// RUN: %clang -ccc-host-triple i386-darwin -S -o - -momit-leaf-frame-pointer %s | \
+// RUN: %clang -target i386-darwin -S -o - -momit-leaf-frame-pointer %s | \
// RUN: FileCheck --check-prefix=OMIT_LEAF %s
// OMIT_LEAF: f0:
// OMIT_LEAF-NOT: pushl %ebp
Modified: cfe/branches/tooling/test/CodeGen/mips64-f128-literal.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CodeGen/mips64-f128-literal.c?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/CodeGen/mips64-f128-literal.c (original)
+++ cfe/branches/tooling/test/CodeGen/mips64-f128-literal.c Mon Jan 23 02:39:37 2012
@@ -1,4 +1,4 @@
-// RUN: %clang -ccc-host-triple mips64el-unknown-linux -ccc-clang-archs mips64el -O3 -S -mabi=n64 -o - -emit-llvm %s | FileCheck %s
+// RUN: %clang -target mips64el-unknown-linux -ccc-clang-archs mips64el -O3 -S -mabi=n64 -o - -emit-llvm %s | FileCheck %s
typedef long double LD;
Modified: cfe/branches/tooling/test/CodeGen/mips64-padding-arg.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CodeGen/mips64-padding-arg.c?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/CodeGen/mips64-padding-arg.c (original)
+++ cfe/branches/tooling/test/CodeGen/mips64-padding-arg.c Mon Jan 23 02:39:37 2012
@@ -1,4 +1,4 @@
-// RUN: %clang -ccc-host-triple mips64el-unknown-linux -ccc-clang-archs mips64el -O3 -S -mabi=n64 -o - -emit-llvm %s | FileCheck %s
+// RUN: %clang -target mips64el-unknown-linux -ccc-clang-archs mips64el -O3 -S -mabi=n64 -o - -emit-llvm %s | FileCheck %s
typedef struct {
double d;
Modified: cfe/branches/tooling/test/CodeGen/mmx-inline-asm.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CodeGen/mmx-inline-asm.c?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/CodeGen/mmx-inline-asm.c (original)
+++ cfe/branches/tooling/test/CodeGen/mmx-inline-asm.c Mon Jan 23 02:39:37 2012
@@ -1,4 +1,4 @@
-// RUN: %clang -mmmx -ccc-host-triple i386-unknown-unknown -emit-llvm -S %s -o - | FileCheck %s
+// RUN: %clang -mmmx -target i386-unknown-unknown -emit-llvm -S %s -o - | FileCheck %s
// <rdar://problem/9091220>
#include <mmintrin.h>
Modified: cfe/branches/tooling/test/CodeGen/mmx-shift-with-immediate.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CodeGen/mmx-shift-with-immediate.c?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/CodeGen/mmx-shift-with-immediate.c (original)
+++ cfe/branches/tooling/test/CodeGen/mmx-shift-with-immediate.c Mon Jan 23 02:39:37 2012
@@ -1,4 +1,4 @@
-// RUN: %clang -mmmx -ccc-host-triple i386-unknown-unknown -emit-llvm -S %s -o - | FileCheck %s
+// RUN: %clang -mmmx -target i386-unknown-unknown -emit-llvm -S %s -o - | FileCheck %s
#include <mmintrin.h>
void shift(__m64 a, __m64 b, int c) {
Modified: cfe/branches/tooling/test/CodeGenCXX/apple-kext-guard-variable.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CodeGenCXX/apple-kext-guard-variable.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/CodeGenCXX/apple-kext-guard-variable.cpp (original)
+++ cfe/branches/tooling/test/CodeGenCXX/apple-kext-guard-variable.cpp Mon Jan 23 02:39:37 2012
@@ -1,4 +1,4 @@
-// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -S -o %t.s -mkernel -Xclang -verify %s
+// RUN: %clang -target x86_64-apple-darwin10 -S -o %t.s -mkernel -Xclang -verify %s
// rdar://problem/9143356
Modified: cfe/branches/tooling/test/CodeGenCXX/cxx-apple-kext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CodeGenCXX/cxx-apple-kext.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/CodeGenCXX/cxx-apple-kext.cpp (original)
+++ cfe/branches/tooling/test/CodeGenCXX/cxx-apple-kext.cpp Mon Jan 23 02:39:37 2012
@@ -1,6 +1,6 @@
-// RUN: %clangxx -ccc-host-triple x86_64-apple-darwin10 %s -flto -S -o - |\
+// RUN: %clangxx -target x86_64-apple-darwin10 %s -flto -S -o - |\
// RUN: FileCheck --check-prefix=CHECK-NO-KEXT %s
-// RUN: %clangxx -ccc-host-triple x86_64-apple-darwin10 %s -fapple-kext -flto -S -o - |\
+// RUN: %clangxx -target x86_64-apple-darwin10 %s -fapple-kext -flto -S -o - |\
// RUN: FileCheck --check-prefix=CHECK-KEXT %s
// CHECK-NO-KEXT-NOT: _GLOBAL__D_a
Modified: cfe/branches/tooling/test/Coverage/targets.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Coverage/targets.c?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Coverage/targets.c (original)
+++ cfe/branches/tooling/test/Coverage/targets.c Mon Jan 23 02:39:37 2012
@@ -16,5 +16,5 @@
// RUN: %clang_cc1 -g -triple x86_64-unknown-unknown -emit-llvm -o %t %s
// <rdar://problem/7181838> clang 1.0 fails to compile Python 2.6
-// RUN: %clang -ccc-host-triple x86_64-apple-darwin9 -### -S %s -mmacosx-version-min=10.4
+// RUN: %clang -target x86_64-apple-darwin9 -### -S %s -mmacosx-version-min=10.4
Modified: cfe/branches/tooling/test/Driver/Wp-args.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Driver/Wp-args.c?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Driver/Wp-args.c (original)
+++ cfe/branches/tooling/test/Driver/Wp-args.c Mon Jan 23 02:39:37 2012
@@ -1,7 +1,7 @@
// Check that we extract -MD from '-Wp,-MD,FOO', which is used by a number of
// major projects (e.g., FireFox and the Linux Kernel).
-// RUN: %clang --ccc-host-triple i386-pc-linux-gnu -### \
+// RUN: %clang --target i386-pc-linux-gnu -### \
// RUN: -Wp,-MD,FOO.d -fsyntax-only %s 2> %t
// RUN: FileCheck < %t %s
//
Modified: cfe/branches/tooling/test/Driver/Xarch.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Driver/Xarch.c?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Driver/Xarch.c (original)
+++ cfe/branches/tooling/test/Driver/Xarch.c Mon Jan 23 02:39:37 2012
@@ -1,9 +1,9 @@
-// RUN: %clang -ccc-host-triple i386-apple-darwin9 -m32 -Xarch_i386 -O2 %s -S -### 2> %t.log
+// RUN: %clang -target i386-apple-darwin9 -m32 -Xarch_i386 -O2 %s -S -### 2> %t.log
// RUN: grep ' "-O2" ' %t.log | count 1
-// RUN: %clang -ccc-host-triple i386-apple-darwin9 -m64 -Xarch_i386 -O2 %s -S -### 2> %t.log
+// RUN: %clang -target i386-apple-darwin9 -m64 -Xarch_i386 -O2 %s -S -### 2> %t.log
// RUN: grep ' "-O2" ' %t.log | count 0
// RUN: grep "argument unused during compilation: '-Xarch_i386 -O2'" %t.log
-// RUN: not %clang -ccc-host-triple i386-apple-darwin9 -m32 -Xarch_i386 -o -Xarch_i386 -S %s -S -Xarch_i386 -o 2> %t.log
+// RUN: not %clang -target i386-apple-darwin9 -m32 -Xarch_i386 -o -Xarch_i386 -S %s -S -Xarch_i386 -o 2> %t.log
// RUN: grep "error: invalid Xarch argument: '-Xarch_i386 -o'" %t.log | count 2
// RUN: grep "error: invalid Xarch argument: '-Xarch_i386 -S'" %t.log
Modified: cfe/branches/tooling/test/Driver/Xlinker-args.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Driver/Xlinker-args.c?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Driver/Xlinker-args.c (original)
+++ cfe/branches/tooling/test/Driver/Xlinker-args.c Mon Jan 23 02:39:37 2012
@@ -1,7 +1,7 @@
// Check that we extract --no-demangle from '-Xlinker' and '-Wl,', since that
// was a collect2 argument.
-// RUN: %clang -ccc-host-triple i386-apple-darwin9 -### \
+// RUN: %clang -target i386-apple-darwin9 -### \
// RUN: -Xlinker one -Xlinker --no-demangle \
// RUN: -Wl,two,--no-demangle,three -Xlinker four %s 2> %t
// RUN: FileCheck < %t %s
Modified: cfe/branches/tooling/test/Driver/analyze.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Driver/analyze.c?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Driver/analyze.c (original)
+++ cfe/branches/tooling/test/Driver/analyze.c Mon Jan 23 02:39:37 2012
@@ -1,7 +1,7 @@
// Verify that the analyzer gets the same flags as normal compilation
// (at least for a few key ones).
-// RUN: env MACOSX_DEPLOYMENT_TARGET=10.5 %clang -ccc-host-triple i386-apple-darwin9 -### --analyze -o /dev/null %s -msse 2> %t.log
+// RUN: env MACOSX_DEPLOYMENT_TARGET=10.5 %clang -target i386-apple-darwin9 -### --analyze -o /dev/null %s -msse 2> %t.log
// RUN: FileCheck --input-file=%t.log %s
// CHECK: "-analyze"
Modified: cfe/branches/tooling/test/Driver/apple-kext-i386.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Driver/apple-kext-i386.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Driver/apple-kext-i386.cpp (original)
+++ cfe/branches/tooling/test/Driver/apple-kext-i386.cpp Mon Jan 23 02:39:37 2012
@@ -1,21 +1,21 @@
// Check that we transparently fallback to llvm-gcc for i386 kexts, we don't
// support the ABI they use (yet).
-// RUN: %clang -ccc-host-triple i386-apple-darwin10 \
+// RUN: %clang -target i386-apple-darwin10 \
// RUN: -fapple-kext -### -fsyntax-only %s 2> %t
// RUN: FileCheck --check-prefix=CHECK < %t %s
// CHECK: cc1plus"
// CHECK: "-fapple-kext"
-// RUN: %clang -ccc-host-triple i386-apple-darwin10 \
+// RUN: %clang -target i386-apple-darwin10 \
// RUN: -mkernel -### -fsyntax-only %s 2> %t
// RUN: FileCheck --check-prefix=CHECK-MKERNEL < %t %s
// CHECK-MKERNEL: cc1plus"
// CHECK-MKERNEL: "-mkernel"
-// RUN: %clang -ccc-host-triple i386-apple-darwin10 \
+// RUN: %clang -target i386-apple-darwin10 \
// RUN: -Wno-self-assign -Wc++11-extensions -Wno-microsoft -Wmicrosoft -Wvla \
// RUN: -faltivec -mthumb -mcpu=G4 -mlongcall -mno-longcall -msoft-float \
// RUN: -fapple-kext -### -fsyntax-only %s 2> %t
@@ -33,7 +33,7 @@
// CHECK-UNSUPPORTED: "-mno-longcall"
// CHECK-UNSUPPORTED: "-msoft-float"
-// RUN: %clang -ccc-host-triple i386-apple-darwin10 \
+// RUN: %clang -target i386-apple-darwin10 \
// RUN: -Wconstant-logical-operand -save-temps \
// RUN: -fapple-kext -### -fsyntax-only %s 2> %t
// RUN: FileCheck --check-prefix=CHECK-UNSUPPORTED2 < %t %s
Modified: cfe/branches/tooling/test/Driver/apple-kext-mkernel.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Driver/apple-kext-mkernel.c?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Driver/apple-kext-mkernel.c (original)
+++ cfe/branches/tooling/test/Driver/apple-kext-mkernel.c Mon Jan 23 02:39:37 2012
@@ -1,4 +1,4 @@
-// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 \
+// RUN: %clang -target x86_64-apple-darwin10 \
// RUN: -mkernel -### -fsyntax-only %s 2> %t
// RUN: FileCheck --check-prefix=CHECK-X86 < %t %s
@@ -7,7 +7,7 @@
// CHECK-X86: "-fno-rtti"
// CHECK-X86: "-fno-common"
-// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 \
+// RUN: %clang -target x86_64-apple-darwin10 \
// RUN: -arch armv7 -mkernel -### -fsyntax-only %s 2> %t
// RUN: FileCheck --check-prefix=CHECK-ARM < %t %s
Modified: cfe/branches/tooling/test/Driver/arc.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Driver/arc.c?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Driver/arc.c (original)
+++ cfe/branches/tooling/test/Driver/arc.c Mon Jan 23 02:39:37 2012
@@ -1,8 +1,8 @@
-// RUN: %clang -ObjC -ccc-host-triple i386-apple-darwin9 -m32 -fobjc-arc %s -fsyntax-only 2>&1 | FileCheck %s
-// RUN: %clang -x objective-c -ccc-host-triple i386-apple-darwin9 -m32 -fobjc-arc %s -fsyntax-only 2>&1 | FileCheck %s
-// RUN: %clang -x objective-c++ -ccc-host-triple i386-apple-darwin9 -m32 -fobjc-arc %s -fsyntax-only 2>&1 | FileCheck %s
-// RUN: %clang -x c -ccc-host-triple i386-apple-darwin9 -m32 -fobjc-arc %s -fsyntax-only 2>&1 | FileCheck -check-prefix NOTOBJC %s
-// RUN: %clang -x c++ -ccc-host-triple i386-apple-darwin9 -m32 -fobjc-arc %s -fsyntax-only 2>&1 | FileCheck -check-prefix NOTOBJC %s
+// RUN: %clang -ObjC -target i386-apple-darwin9 -m32 -fobjc-arc %s -fsyntax-only 2>&1 | FileCheck %s
+// RUN: %clang -x objective-c -target i386-apple-darwin9 -m32 -fobjc-arc %s -fsyntax-only 2>&1 | FileCheck %s
+// RUN: %clang -x objective-c++ -target i386-apple-darwin9 -m32 -fobjc-arc %s -fsyntax-only 2>&1 | FileCheck %s
+// RUN: %clang -x c -target i386-apple-darwin9 -m32 -fobjc-arc %s -fsyntax-only 2>&1 | FileCheck -check-prefix NOTOBJC %s
+// RUN: %clang -x c++ -target i386-apple-darwin9 -m32 -fobjc-arc %s -fsyntax-only 2>&1 | FileCheck -check-prefix NOTOBJC %s
// Just to test clang is working.
# foo
Modified: cfe/branches/tooling/test/Driver/arch.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Driver/arch.c?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Driver/arch.c (original)
+++ cfe/branches/tooling/test/Driver/arch.c Mon Jan 23 02:39:37 2012
@@ -1,3 +1,3 @@
-// RUN: %clang -ccc-host-triple armv7a-unknown-linux-gnueabi -S -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang -target armv7a-unknown-linux-gnueabi -S -emit-llvm %s -o - | FileCheck %s
// CHECK: target triple = "armv7-unknown-linux-gnueabi"
Modified: cfe/branches/tooling/test/Driver/arm-darwin-builtin.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Driver/arm-darwin-builtin.c?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Driver/arm-darwin-builtin.c (original)
+++ cfe/branches/tooling/test/Driver/arm-darwin-builtin.c Mon Jan 23 02:39:37 2012
@@ -1,14 +1,14 @@
// FIXME: Disable pending PR4941.
-// RUX: clang -ccc-host-triple x86_64-apple-darwin9 -arch arm -### -fsyntax-only %s 2> %t &&
+// RUX: clang -target x86_64-apple-darwin9 -arch arm -### -fsyntax-only %s 2> %t &&
// RUX: grep -- "-fno-builtin-strcat" %t &&
// RUX: grep -- "-fno-builtin-strcpy" %t &&
// FIXME: Disable pending PR4941.
-// RUX: clang -ccc-host-triple x86_64-apple-darwin9 -arch arm -### -fsyntax-only %s -fbuiltin-strcat -fbuiltin-strcpy 2> %t &&
+// RUX: clang -target x86_64-apple-darwin9 -arch arm -### -fsyntax-only %s -fbuiltin-strcat -fbuiltin-strcpy 2> %t &&
// RUX: not grep -- "-fno-builtin-strcat" %t &&
// RUX: not grep -- "-fno-builtin-strcpy" %t &&
-// RUN: %clang -ccc-no-clang -ccc-host-triple x86_64-apple-darwin9 -arch arm -### -fsyntax-only %s -fbuiltin-strcat -fbuiltin-strcpy 2> %t
+// RUN: %clang -ccc-no-clang -target x86_64-apple-darwin9 -arch arm -### -fsyntax-only %s -fbuiltin-strcat -fbuiltin-strcpy 2> %t
// RUN: not grep -- "-fno-builtin-strcat" %t
// RUN: not grep -- "-fno-builtin-strcpy" %t
Modified: cfe/branches/tooling/test/Driver/arm-mfpu.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Driver/arm-mfpu.c?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Driver/arm-mfpu.c (original)
+++ cfe/branches/tooling/test/Driver/arm-mfpu.c Mon Jan 23 02:39:37 2012
@@ -1,48 +1,48 @@
// Test that different values of -mfpu pick correct ARM FPU target-feature(s).
-// RUN: %clang -ccc-host-triple arm-linux-eabi %s -### -o %t.o 2>&1 \
+// RUN: %clang -target arm-linux-eabi %s -### -o %t.o 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-DEFAULT %s
// CHECK-DEFAULT-NOT: "-target-feature" "+vfp2"
// CHECK-DEFAULT-NOT: "-target-feature" "+vfp3"
// CHECK-DEFAULT-NOT: "-target-feature" "+d16"
// CHECK-DEFAULT-NOT: "-target-feature" "+neon"
-// RUN: %clang -ccc-host-triple arm-linux-eabi -mfpu=fpa %s -### -o %t.o 2>&1 \
+// RUN: %clang -target arm-linux-eabi -mfpu=fpa %s -### -o %t.o 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-FPA %s
-// RUN: %clang -ccc-host-triple arm-linux-eabi -mfpu=fpe2 %s -### -o %t.o 2>&1 \
+// RUN: %clang -target arm-linux-eabi -mfpu=fpe2 %s -### -o %t.o 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-FPA %s
-// RUN: %clang -ccc-host-triple arm-linux-eabi -mfpu=fpe3 %s -### -o %t.o 2>&1 \
+// RUN: %clang -target arm-linux-eabi -mfpu=fpe3 %s -### -o %t.o 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-FPA %s
-// RUN: %clang -ccc-host-triple arm-linux-eabi -mfpu=maverick %s -### -o %t.o 2>&1 \
+// RUN: %clang -target arm-linux-eabi -mfpu=maverick %s -### -o %t.o 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-FPA %s
// CHECK-FPA: "-target-feature" "-vfp2"
// CHECK-FPA: "-target-feature" "-vfp3"
// CHECK-FPA: "-target-feature" "-neon"
-// RUN: %clang -ccc-host-triple arm-linux-eabi -mfpu=vfp3-d16 %s -### -o %t.o 2>&1 \
+// RUN: %clang -target arm-linux-eabi -mfpu=vfp3-d16 %s -### -o %t.o 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-VFP3-D16 %s
-// RUN: %clang -ccc-host-triple arm-linux-eabi -mfpu=vfpv3-d16 %s -### -o %t.o 2>&1 \
+// RUN: %clang -target arm-linux-eabi -mfpu=vfpv3-d16 %s -### -o %t.o 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-VFP3-D16 %s
// CHECK-VFP3-D16: "-target-feature" "+vfp3"
// CHECK-VFP3-D16: "-target-feature" "+d16"
// CHECK-VFP3-D16: "-target-feature" "-neon"
-// RUN: %clang -ccc-host-triple arm-linux-eabi -mfpu=vfp %s -### -o %t.o 2>&1 \
+// RUN: %clang -target arm-linux-eabi -mfpu=vfp %s -### -o %t.o 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-VFP %s
// CHECK-VFP: "-target-feature" "+vfp2"
// CHECK-VFP: "-target-feature" "-neon"
-// RUN: %clang -ccc-host-triple arm-linux-eabi -mfpu=vfp3 %s -### -o %t.o 2>&1 \
+// RUN: %clang -target arm-linux-eabi -mfpu=vfp3 %s -### -o %t.o 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-VFP3 %s
-// RUN: %clang -ccc-host-triple arm-linux-eabi -mfpu=vfpv3 %s -### -o %t.o 2>&1 \
+// RUN: %clang -target arm-linux-eabi -mfpu=vfpv3 %s -### -o %t.o 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-VFP3 %s
// CHECK-VFP3: "-target-feature" "+vfp3"
// CHECK-VFP3: "-target-feature" "-neon"
-// RUN: %clang -ccc-host-triple arm-linux-eabi -mfpu=neon %s -### -o %t.o 2>&1 \
+// RUN: %clang -target arm-linux-eabi -mfpu=neon %s -### -o %t.o 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-NEON %s
// CHECK-NEON: "-target-feature" "+neon"
-// RUN: %clang -ccc-host-triple arm-linux-eabi -msoft-float %s -### -o %t.o 2>&1 \
+// RUN: %clang -target arm-linux-eabi -msoft-float %s -### -o %t.o 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-SOFT-FLOAT %s
// CHECK-SOFT-FLOAT: "-target-feature" "-neon"
Modified: cfe/branches/tooling/test/Driver/ast.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Driver/ast.c?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Driver/ast.c (original)
+++ cfe/branches/tooling/test/Driver/ast.c Mon Jan 23 02:39:37 2012
@@ -1,4 +1,4 @@
-// RUN: %clang -ccc-host-triple i386-unknown-unknown -ccc-print-phases -emit-ast %s 2> %t
+// RUN: %clang -target i386-unknown-unknown -ccc-print-phases -emit-ast %s 2> %t
// RUN: echo 'END' >> %t
// RUN: FileCheck -check-prefix EMIT-AST-PHASES -input-file %t %s
@@ -10,7 +10,7 @@
// EMIT-AST-PHASES: END
// RUN: touch %t.ast
-// RUN: %clang -ccc-host-triple i386-unknown-unknown -ccc-print-phases -c %t.ast 2> %t
+// RUN: %clang -target i386-unknown-unknown -ccc-print-phases -c %t.ast 2> %t
// RUN: echo 'END' >> %t
// RUN: FileCheck -check-prefix COMPILE-AST-PHASES -input-file %t %s
Modified: cfe/branches/tooling/test/Driver/bindings.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Driver/bindings.c?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Driver/bindings.c (original)
+++ cfe/branches/tooling/test/Driver/bindings.c Mon Jan 23 02:39:37 2012
@@ -1,48 +1,48 @@
// Basic binding.
-// RUN: %clang -ccc-host-triple i386-unknown-unknown -ccc-print-bindings %s 2> %t
+// RUN: %clang -target i386-unknown-unknown -ccc-print-bindings %s 2> %t
// RUN: grep '"clang", inputs: \[".*bindings.c"\], output: ".*\.s"' %t
// RUN: grep '"gcc::Assemble", inputs: \[".*\.s"\], output: ".*\.o"' %t
// RUN: grep '"gcc::Link", inputs: \[".*\.o"\], output: "a.out"' %t
-// RUN: %clang -ccc-host-triple i386-unknown-unknown -ccc-print-bindings -ccc-no-clang %s 2> %t
+// RUN: %clang -target i386-unknown-unknown -ccc-print-bindings -ccc-no-clang %s 2> %t
// RUN: grep '"gcc::Compile", inputs: \[".*bindings.c"\], output: ".*\.s"' %t
// RUN: grep '"gcc::Assemble", inputs: \[".*\.s"\], output: ".*\.o"' %t
// RUN: grep '"gcc::Link", inputs: \[".*\.o"\], output: "a.out"' %t
-// RUN: %clang -ccc-host-triple i386-unknown-unknown -ccc-print-bindings -ccc-no-clang -no-integrated-cpp %s 2> %t
+// RUN: %clang -target i386-unknown-unknown -ccc-print-bindings -ccc-no-clang -no-integrated-cpp %s 2> %t
// RUN: grep '"gcc::Preprocess", inputs: \[".*bindings.c"\], output: ".*\.i"' %t
// RUN: grep '"gcc::Compile", inputs: \[".*\.i"\], output: ".*\.s"' %t
// RUN: grep '"gcc::Assemble", inputs: \[".*\.s"\], output: ".*\.o"' %t
// RUN: grep '"gcc::Link", inputs: \[".*\.o"\], output: "a.out"' %t
-// RUN: %clang -ccc-host-triple i386-unknown-unknown -ccc-print-bindings -ccc-no-clang -x c-header %s 2> %t
+// RUN: %clang -target i386-unknown-unknown -ccc-print-bindings -ccc-no-clang -x c-header %s 2> %t
// RUN: grep '"gcc::Precompile", inputs: \[".*bindings.c"\], output: ".*bindings.c.gch' %t
// Clang control options
-// RUN: %clang -ccc-host-triple i386-unknown-unknown -ccc-print-bindings -fsyntax-only %s 2> %t
+// RUN: %clang -target i386-unknown-unknown -ccc-print-bindings -fsyntax-only %s 2> %t
// RUN: grep '"clang", inputs: \[".*bindings.c"\], output: (nothing)' %t
-// RUN: %clang -ccc-host-triple i386-unknown-unknown -ccc-print-bindings -ccc-no-clang -fsyntax-only %s 2> %t
+// RUN: %clang -target i386-unknown-unknown -ccc-print-bindings -ccc-no-clang -fsyntax-only %s 2> %t
// RUN: grep '"gcc::Compile", inputs: \[".*bindings.c"\], output: (nothing)' %t
-// RUN: %clang -ccc-host-triple i386-unknown-unknown -ccc-print-bindings -ccc-no-clang-cxx -fsyntax-only -x c++ %s 2> %t
+// RUN: %clang -target i386-unknown-unknown -ccc-print-bindings -ccc-no-clang-cxx -fsyntax-only -x c++ %s 2> %t
// RUN: grep '"gcc::Compile", inputs: \[".*bindings.c"\], output: (nothing)' %t
-// RUN: %clang -ccc-host-triple i386-unknown-unknown -ccc-print-bindings -ccc-clang-cxx -fsyntax-only -x c++ %s 2> %t
+// RUN: %clang -target i386-unknown-unknown -ccc-print-bindings -ccc-clang-cxx -fsyntax-only -x c++ %s 2> %t
// RUN: grep '"clang", inputs: \[".*bindings.c"\], output: (nothing)' %t
-// RUN: %clang -ccc-host-triple i386-unknown-unknown -ccc-print-bindings -ccc-no-clang-cpp -fsyntax-only -no-integrated-cpp %s 2> %t
+// RUN: %clang -target i386-unknown-unknown -ccc-print-bindings -ccc-no-clang-cpp -fsyntax-only -no-integrated-cpp %s 2> %t
// RUN: grep '"gcc::Preprocess", inputs: \[".*bindings.c"\], output: ".*\.i"' %t
// RUN: grep '"clang", inputs: \[".*\.i"\], output: (nothing)' %t
-// RUN: %clang -ccc-host-triple i386-apple-darwin9 -ccc-print-bindings -ccc-clang-archs i386 %s -S -arch ppc 2> %t
+// RUN: %clang -target i386-apple-darwin9 -ccc-print-bindings -ccc-clang-archs i386 %s -S -arch ppc 2> %t
// RUN: grep '"gcc::Compile", inputs: \[".*bindings.c"\], output: "bindings.s"' %t
-// RUN: %clang -ccc-host-triple i386-apple-darwin9 -ccc-print-bindings -ccc-clang-archs powerpc %s -S -arch ppc 2> %t
+// RUN: %clang -target i386-apple-darwin9 -ccc-print-bindings -ccc-clang-archs powerpc %s -S -arch ppc 2> %t
// RUN: grep '"clang", inputs: \[".*bindings.c"\], output: "bindings.s"' %t
-// RUN: %clang -ccc-host-triple powerpc-unknown-unknown -ccc-print-bindings -ccc-clang-archs "" %s -S 2> %t
+// RUN: %clang -target powerpc-unknown-unknown -ccc-print-bindings -ccc-clang-archs "" %s -S 2> %t
// RUN: grep '"clang", inputs: \[".*bindings.c"\], output: "bindings.s"' %t
-// RUN: %clang -ccc-host-triple powerpc-unknown-unknown -ccc-print-bindings -ccc-clang-archs "i386" %s -S 2> %t
+// RUN: %clang -target powerpc-unknown-unknown -ccc-print-bindings -ccc-clang-archs "i386" %s -S 2> %t
// RUN: grep '"gcc::Compile", inputs: \[".*bindings.c"\], output: "bindings.s"' %t
// Darwin bindings
-// RUN: %clang -ccc-host-triple i386-apple-darwin9 -no-integrated-as -ccc-print-bindings %s 2> %t
+// RUN: %clang -target i386-apple-darwin9 -no-integrated-as -ccc-print-bindings %s 2> %t
// RUN: grep '"clang", inputs: \[".*bindings.c"\], output: ".*\.s"' %t
// RUN: grep '"darwin::Assemble", inputs: \[".*\.s"\], output: ".*\.o"' %t
// RUN: grep '"darwin::Link", inputs: \[".*\.o"\], output: "a.out"' %t
Modified: cfe/branches/tooling/test/Driver/cc-log-diagnostics.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Driver/cc-log-diagnostics.c?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Driver/cc-log-diagnostics.c (original)
+++ cfe/branches/tooling/test/Driver/cc-log-diagnostics.c Mon Jan 23 02:39:37 2012
@@ -1,7 +1,7 @@
// RUN: rm -f %t.log
// RUN: env RC_DEBUG_OPTIONS=1 \
// RUN: CC_LOG_DIAGNOSTICS=1 CC_LOG_DIAGNOSTICS_FILE=%t.log \
-// RUN: %clang -Wfoobar -no-canonical-prefixes -ccc-host-triple x86_64-apple-darwin10 -fsyntax-only %s
+// RUN: %clang -Wfoobar -no-canonical-prefixes -target x86_64-apple-darwin10 -fsyntax-only %s
// RUN: FileCheck %s < %t.log
int f0() {}
Modified: cfe/branches/tooling/test/Driver/ccc-host-triple-no-integrated-as.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Driver/ccc-host-triple-no-integrated-as.c?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Driver/ccc-host-triple-no-integrated-as.c (original)
+++ cfe/branches/tooling/test/Driver/ccc-host-triple-no-integrated-as.c Mon Jan 23 02:39:37 2012
@@ -1,9 +1,9 @@
-// Check that -no-integrated-as works when -ccc-host-triple i386-pc-win32-macho or
-// -ccc-host-triple x86_64-pc-win32-macho is specified.
+// Check that -no-integrated-as works when -target i386-pc-win32-macho or
+// -target x86_64-pc-win32-macho is specified.
-// RUN: %clang -### -c -ccc-host-triple i386-pc-win32-macho -no-integrated-as %s 2> %t1
+// RUN: %clang -### -c -target i386-pc-win32-macho -no-integrated-as %s 2> %t1
// RUN: FileCheck -check-prefix=X86 < %t1 %s
-// RUN: %clang -### -c -ccc-host-triple x86_64-pc-win32-macho -no-integrated-as %s 2> %t2
+// RUN: %clang -### -c -target x86_64-pc-win32-macho -no-integrated-as %s 2> %t2
// RUN: FileCheck -check-prefix=X86_64 < %t2 %s
//
// X86: "-cc1"
Modified: cfe/branches/tooling/test/Driver/cfi.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Driver/cfi.c?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Driver/cfi.c (original)
+++ cfe/branches/tooling/test/Driver/cfi.c Mon Jan 23 02:39:37 2012
@@ -1,8 +1,8 @@
-// RUN: %clang -ccc-host-triple i386-apple-darwin10 \
+// RUN: %clang -target i386-apple-darwin10 \
// RUN: -no-integrated-as -### %s 2>&1 | \
// RUN: FileCheck --check-prefix=CHECK-DARWIN %s
-// RUN: %clang -ccc-host-triple i386-pc-linux-gnu -static -### %s 2>&1 | \
+// RUN: %clang -target i386-pc-linux-gnu -static -### %s 2>&1 | \
// RUN: FileCheck --check-prefix=CHECK-LINUX %s
// CHECK-DARWIN: -fno-dwarf2-cfi-asm
Modified: cfe/branches/tooling/test/Driver/clang-translation.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Driver/clang-translation.c?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Driver/clang-translation.c (original)
+++ cfe/branches/tooling/test/Driver/clang-translation.c Mon Jan 23 02:39:37 2012
@@ -1,4 +1,4 @@
-// RUN: %clang -ccc-host-triple i386-unknown-unknown -### -S -O0 -Os %s -o %t.s -fverbose-asm -funwind-tables -fvisibility=hidden 2> %t.log
+// RUN: %clang -target i386-unknown-unknown -### -S -O0 -Os %s -o %t.s -fverbose-asm -funwind-tables -fvisibility=hidden 2> %t.log
// RUN: grep '"-triple" "i386-unknown-unknown"' %t.log
// RUN: grep '"-S"' %t.log
// RUN: grep '"-disable-free"' %t.log
@@ -9,12 +9,12 @@
// RUN: grep '"-o" .*clang-translation.*' %t.log
// RUN: grep '"-masm-verbose"' %t.log
// RUN: grep '"-fvisibility" "hidden"' %t.log
-// RUN: %clang -ccc-host-triple i386-apple-darwin9 -### -S %s -o %t.s 2> %t.log
+// RUN: %clang -target i386-apple-darwin9 -### -S %s -o %t.s 2> %t.log
// RUN: grep '"-target-cpu" "yonah"' %t.log
-// RUN: %clang -ccc-host-triple x86_64-apple-darwin9 -### -S %s -o %t.s 2> %t.log
+// RUN: %clang -target x86_64-apple-darwin9 -### -S %s -o %t.s 2> %t.log
// RUN: grep '"-target-cpu" "core2"' %t.log
-// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -### -S %s 2> %t.log \
+// RUN: %clang -target x86_64-apple-darwin10 -### -S %s 2> %t.log \
// RUN: -arch armv7
// RUN: FileCheck -check-prefix=ARMV7_DEFAULT %s < %t.log
// ARMV7_DEFAULT: clang
@@ -24,7 +24,7 @@
// ARMV7_DEFAULT-NOT: "-msoft-float"
// ARMV7_DEFAULT: "-x" "c"
-// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -### -S %s 2> %t.log \
+// RUN: %clang -target x86_64-apple-darwin10 -### -S %s 2> %t.log \
// RUN: -arch armv7 -msoft-float
// RUN: FileCheck -check-prefix=ARMV7_SOFTFLOAT %s < %t.log
// ARMV7_SOFTFLOAT: clang
@@ -35,7 +35,7 @@
// ARMV7_SOFTFLOAT: "-neon"
// ARMV7_SOFTFLOAT: "-x" "c"
-// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -### -S %s 2> %t.log \
+// RUN: %clang -target x86_64-apple-darwin10 -### -S %s 2> %t.log \
// RUN: -arch armv7 -mhard-float
// RUN: FileCheck -check-prefix=ARMV7_HARDFLOAT %s < %t.log
// ARMV7_HARDFLOAT: clang
Modified: cfe/branches/tooling/test/Driver/darwin-as.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Driver/darwin-as.c?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Driver/darwin-as.c (original)
+++ cfe/branches/tooling/test/Driver/darwin-as.c Mon Jan 23 02:39:37 2012
@@ -1,16 +1,16 @@
-// RUN: %clang -ccc-host-triple i386-apple-darwin10 -### -x assembler -c %s \
+// RUN: %clang -target i386-apple-darwin10 -### -x assembler -c %s \
// RUN: -no-integrated-as -static -dynamic 2>%t
// RUN: FileCheck -check-prefix=STATIC_AND_DYNAMIC-32 --input-file %t %s
//
// CHECK-STATIC_AND_DYNAMIC-32: as{{(.exe)?}}" "-arch" "i386" "-force_cpusubtype_ALL" "-static" "-o"
-// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -### -x assembler -c %s \
+// RUN: %clang -target x86_64-apple-darwin10 -### -x assembler -c %s \
// RUN: -no-integrated-as -static 2>%t
// RUN: FileCheck -check-prefix=STATIC-64 --input-file %t %s
//
// CHECK-STATIC-64: as{{(.exe)?}}" "-arch" "x86_64" "-force_cpusubtype_ALL" "-o"
-// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -### \
+// RUN: %clang -target x86_64-apple-darwin10 -### \
// RUN: -arch armv6 -x assembler -c %s 2>%t
// RUN: FileCheck -check-prefix=ARMV6 --input-file %t %s
//
Modified: cfe/branches/tooling/test/Driver/darwin-cc.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Driver/darwin-cc.c?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Driver/darwin-cc.c (original)
+++ cfe/branches/tooling/test/Driver/darwin-cc.c Mon Jan 23 02:39:37 2012
@@ -1,4 +1,4 @@
-// RUN: %clang -ccc-no-clang -ccc-host-triple i386-apple-darwin10 -m32 -### -MD -g -fast -Q -dA -mkernel -ansi -aFOO -S -o /tmp/OUTPUTNAME -g0 -gfull -O2 -Werror -pedantic -Wmost -w -std=c99 -trigraphs -v -pg -fFOO -undef -Qn --param a=b -fmudflap -coverage -save-temps -nostdinc -I ARG0 -F ARG1 -I ARG2 -P -MF ARG3 -MG -MP -remap -g3 -H -D ARG4 -U ARG5 -A ARG6 -D ARG7 -U ARG8 -A ARG9 -include ARG10 -pthread %s 2> %t.log
+// RUN: %clang -ccc-no-clang -target i386-apple-darwin10 -m32 -### -MD -g -fast -Q -dA -mkernel -ansi -aFOO -S -o /tmp/OUTPUTNAME -g0 -gfull -O2 -Werror -pedantic -Wmost -w -std=c99 -trigraphs -v -pg -fFOO -undef -Qn --param a=b -fmudflap -coverage -save-temps -nostdinc -I ARG0 -F ARG1 -I ARG2 -P -MF ARG3 -MG -MP -remap -g3 -H -D ARG4 -U ARG5 -A ARG6 -D ARG7 -U ARG8 -A ARG9 -include ARG10 -pthread %s 2> %t.log
// RUN: FileCheck %s < %t.log
// CHECK: {{ ".*cc1.*" "-E" "-nostdinc" "-v" "-I" "ARG0" "-FARG1" "-I" "ARG2" "-P" "-MD" "[^"]*/OUTPUTNAME.d" "-MF" "ARG3" "-MG" "-MP" "-MQ" "[^"]*/OUTPUTNAME" "-remap" "-dD" "-H" "-D__STATIC__" "-D_REENTRANT" "-D" "ARG4" "-U" "ARG5" "-A" "ARG6" "-D" "ARG7" "-U" "ARG8" "-A" "ARG9" "-include" "ARG10" ".*darwin-cc.c" "-D_MUDFLAP" "-include" "mf-runtime.h" "-m32" "-mkernel" "-mtune=core2" "-mmacosx-version-min=10.6.0" "-ansi" "-std=c99" "-trigraphs" "-Werror" "-pedantic" "-Wmost" "-w" "-fast" "-fno-eliminate-unused-debug-symbols" "-fFOO" "-fmudflap" "-O2" "-undef" "-fpch-preprocess" "-o" ".*darwin-cc.i"}}
// CHECK: {{ ".*cc1.*" "-fpreprocessed" ".*darwin-cc.i" "-O3" "-dumpbase" ".*darwin-cc.c" "-dA" "-m32" "-mkernel" "-mtune=core2" "-mmacosx-version-min=10.6.0" "-ansi" "-aFOO" "-auxbase-strip" "[^"]*/OUTPUTNAME" "-g" "-g0" "-g" "-g3" "-O2" "-Werror" "-pedantic" "-Wmost" "-w" "-ansi" "-std=c99" "-trigraphs" "-version" "-p" "-fast" "-fno-eliminate-unused-debug-symbols" "-fFOO" "-fmudflap" "-undef" "-fno-ident" "-o" "[^"]*/OUTPUTNAME" "--param" "a=b" "-fno-builtin" "-fno-merge-constants" "-fprofile-arcs" "-ftest-coverage"}}
Modified: cfe/branches/tooling/test/Driver/darwin-debug-flags.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Driver/darwin-debug-flags.c?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Driver/darwin-debug-flags.c (original)
+++ cfe/branches/tooling/test/Driver/darwin-debug-flags.c Mon Jan 23 02:39:37 2012
@@ -1,7 +1,7 @@
-// RUN: env RC_DEBUG_OPTIONS=1 %clang -ccc-host-triple i386-apple-darwin9 -g -Os %s -emit-llvm -S -o - | FileCheck %s
+// RUN: env RC_DEBUG_OPTIONS=1 %clang -target i386-apple-darwin9 -g -Os %s -emit-llvm -S -o - | FileCheck %s
// <rdar://problem/7256886>
// RUN: touch %t.s
-// RUN: env RC_DEBUG_OPTIONS=1 %clang -### -ccc-host-triple i386-apple-darwin9 -c -g %t.s 2>&1 | FileCheck -check-prefix=S %s
+// RUN: env RC_DEBUG_OPTIONS=1 %clang -### -target i386-apple-darwin9 -c -g %t.s 2>&1 | FileCheck -check-prefix=S %s
// CHECK: !0 = metadata !{
// CHECK: -g -Os
Modified: cfe/branches/tooling/test/Driver/darwin-dsymutil.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Driver/darwin-dsymutil.c?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Driver/darwin-dsymutil.c (original)
+++ cfe/branches/tooling/test/Driver/darwin-dsymutil.c Mon Jan 23 02:39:37 2012
@@ -1,6 +1,6 @@
// Check that we run dsymutil properly with multiple -arch options.
//
-// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -ccc-print-phases \
+// RUN: %clang -target x86_64-apple-darwin10 -ccc-print-phases \
// RUN: -arch i386 -arch x86_64 %s -g 2> %t
// RUN: FileCheck -check-prefix=CHECK-MULTIARCH-ACTIONS < %t %s
//
@@ -14,7 +14,7 @@
// CHECK-MULTIARCH-ACTIONS: 7: lipo, {5, 6}, image
// CHECK-MULTIARCH-ACTIONS: 8: dsymutil, {7}, dSYM
//
-// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -ccc-print-bindings \
+// RUN: %clang -target x86_64-apple-darwin10 -ccc-print-bindings \
// RUN: -arch i386 -arch x86_64 %s -g 2> %t
// RUN: FileCheck -check-prefix=CHECK-MULTIARCH-BINDINGS < %t %s
//
@@ -23,7 +23,7 @@
// Check output name derivation.
//
-// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -ccc-print-bindings \
+// RUN: %clang -target x86_64-apple-darwin10 -ccc-print-bindings \
// RUN: -o foo %s -g 2> %t
// RUN: FileCheck -check-prefix=CHECK-OUTPUT-NAME < %t %s
//
@@ -33,12 +33,12 @@
// Check that we only use dsymutil when needed.
//
// RUN: touch %t.o
-// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -ccc-print-bindings \
+// RUN: %clang -target x86_64-apple-darwin10 -ccc-print-bindings \
// RUN: -o foo %t.o -g 2> %t
// RUN: grep "Dsymutil" %t | count 0
// Check that we put the .dSYM in the right place.
-// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -ccc-print-bindings \
+// RUN: %clang -target x86_64-apple-darwin10 -ccc-print-bindings \
// RUN: -o bar/foo %s -g 2> %t
// RUN: FileCheck -check-prefix=CHECK-LOCATION < %t %s
Modified: cfe/branches/tooling/test/Driver/darwin-iphone-defaults.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Driver/darwin-iphone-defaults.m?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Driver/darwin-iphone-defaults.m (original)
+++ cfe/branches/tooling/test/Driver/darwin-iphone-defaults.m Mon Jan 23 02:39:37 2012
@@ -1,4 +1,4 @@
-// RUN: %clang -ccc-host-triple i386-apple-darwin9 -miphoneos-version-min=3.0 -arch armv7 -flto -S -o - %s | FileCheck %s
+// RUN: %clang -target i386-apple-darwin9 -miphoneos-version-min=3.0 -arch armv7 -flto -S -o - %s | FileCheck %s
// CHECK: @f0() ssp
// CHECK: @__f0_block_invoke
Modified: cfe/branches/tooling/test/Driver/darwin-ld.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Driver/darwin-ld.c?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Driver/darwin-ld.c (original)
+++ cfe/branches/tooling/test/Driver/darwin-ld.c Mon Jan 23 02:39:37 2012
@@ -1,19 +1,19 @@
// Check that ld gets arch_multiple.
-// RUN: %clang -ccc-host-triple i386-apple-darwin9 -arch i386 -arch x86_64 %s -### -o foo 2> %t.log
+// RUN: %clang -target i386-apple-darwin9 -arch i386 -arch x86_64 %s -### -o foo 2> %t.log
// RUN: grep '".*ld.*" .*"-arch_multiple" "-final_output" "foo"' %t.log
// Make sure we run dsymutil on source input files.
-// RUN: %clang -ccc-host-triple i386-apple-darwin9 -### -g %s -o BAR 2> %t.log
+// RUN: %clang -target i386-apple-darwin9 -### -g %s -o BAR 2> %t.log
// RUN: grep '".*dsymutil" "-o" "BAR.dSYM" "BAR"' %t.log
-// RUN: %clang -ccc-host-triple i386-apple-darwin9 -### -g -filelist FOO %s -o BAR 2> %t.log
+// RUN: %clang -target i386-apple-darwin9 -### -g -filelist FOO %s -o BAR 2> %t.log
// RUN: grep '".*dsymutil" "-o" "BAR.dSYM" "BAR"' %t.log
// Check linker changes that came with new linkedit format.
// RUN: touch %t.o
-// RUN: %clang -ccc-host-triple i386-apple-darwin9 -### -arch armv6 -miphoneos-version-min=3.0 %t.o 2> %t.log
-// RUN: %clang -ccc-host-triple i386-apple-darwin9 -### -arch armv6 -miphoneos-version-min=3.0 -dynamiclib %t.o 2>> %t.log
-// RUN: %clang -ccc-host-triple i386-apple-darwin9 -### -arch armv6 -miphoneos-version-min=3.0 -bundle %t.o 2>> %t.log
+// RUN: %clang -target i386-apple-darwin9 -### -arch armv6 -miphoneos-version-min=3.0 %t.o 2> %t.log
+// RUN: %clang -target i386-apple-darwin9 -### -arch armv6 -miphoneos-version-min=3.0 -dynamiclib %t.o 2>> %t.log
+// RUN: %clang -target i386-apple-darwin9 -### -arch armv6 -miphoneos-version-min=3.0 -bundle %t.o 2>> %t.log
// RUN: FileCheck -check-prefix=LINK_IPHONE_3_0 %s < %t.log
// LINK_IPHONE_3_0: {{ld(.exe)?"}}
@@ -28,9 +28,9 @@
// LINK_IPHONE_3_0: -lbundle1.o
// LINK_IPHONE_3_0: -lSystem
-// RUN: %clang -ccc-host-triple i386-apple-darwin9 -### -arch armv7 -miphoneos-version-min=3.1 %t.o 2> %t.log
-// RUN: %clang -ccc-host-triple i386-apple-darwin9 -### -arch armv7 -miphoneos-version-min=3.1 -dynamiclib %t.o 2>> %t.log
-// RUN: %clang -ccc-host-triple i386-apple-darwin9 -### -arch armv7 -miphoneos-version-min=3.1 -bundle %t.o 2>> %t.log
+// RUN: %clang -target i386-apple-darwin9 -### -arch armv7 -miphoneos-version-min=3.1 %t.o 2> %t.log
+// RUN: %clang -target i386-apple-darwin9 -### -arch armv7 -miphoneos-version-min=3.1 -dynamiclib %t.o 2>> %t.log
+// RUN: %clang -target i386-apple-darwin9 -### -arch armv7 -miphoneos-version-min=3.1 -bundle %t.o 2>> %t.log
// RUN: FileCheck -check-prefix=LINK_IPHONE_3_1 %s < %t.log
// LINK_IPHONE_3_1: {{ld(.exe)?"}}
@@ -45,26 +45,26 @@
// LINK_IPHONE_3_1-NOT: -lbundle1.o
// LINK_IPHONE_3_1: -lSystem
-// RUN: %clang -ccc-host-triple i386-apple-darwin9 -### -fpie %t.o 2> %t.log
+// RUN: %clang -target i386-apple-darwin9 -### -fpie %t.o 2> %t.log
// RUN: FileCheck -check-prefix=LINK_EXPLICIT_PIE %s < %t.log
//
// LINK_EXPLICIT_PIE: {{ld(.exe)?"}}
// LINK_EXPLICIT_PIE: "-pie"
-// RUN: %clang -ccc-host-triple i386-apple-darwin9 -### -fno-pie %t.o 2> %t.log
+// RUN: %clang -target i386-apple-darwin9 -### -fno-pie %t.o 2> %t.log
// RUN: FileCheck -check-prefix=LINK_EXPLICIT_NO_PIE %s < %t.log
//
// LINK_EXPLICIT_NO_PIE: {{ld(.exe)?"}}
// LINK_EXPLICIT_NO_PIE: "-no_pie"
-// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -### %t.o \
+// RUN: %clang -target x86_64-apple-darwin10 -### %t.o \
// RUN: -mlinker-version=100 2> %t.log
// RUN: FileCheck -check-prefix=LINK_NEWER_DEMANGLE %s < %t.log
//
// LINK_NEWER_DEMANGLE: {{ld(.exe)?"}}
// LINK_NEWER_DEMANGLE: "-demangle"
-// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -### %t.o \
+// RUN: %clang -target x86_64-apple-darwin10 -### %t.o \
// RUN: -mlinker-version=100 -Wl,--no-demangle 2> %t.log
// RUN: FileCheck -check-prefix=LINK_NEWER_NODEMANGLE %s < %t.log
//
@@ -72,7 +72,7 @@
// LINK_NEWER_NODEMANGLE-NOT: "-demangle"
// LINK_NEWER_NODEMANGLE: "-lSystem"
-// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -### %t.o \
+// RUN: %clang -target x86_64-apple-darwin10 -### %t.o \
// RUN: -mlinker-version=95 2> %t.log
// RUN: FileCheck -check-prefix=LINK_OLDER_NODEMANGLE %s < %t.log
//
@@ -80,7 +80,7 @@
// LINK_OLDER_NODEMANGLE-NOT: "-demangle"
// LINK_OLDER_NODEMANGLE: "-lSystem"
-// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -### %t.o \
+// RUN: %clang -target x86_64-apple-darwin10 -### %t.o \
// RUN: -mlinker-version=117 -flto 2> %t.log
// RUN: cat %t.log
// RUN: FileCheck -check-prefix=LINK_OBJECT_LTO_PATH %s < %t.log
@@ -88,7 +88,7 @@
// LINK_OBJECT_LTO_PATH: {{ld(.exe)?"}}
// LINK_OBJECT_LTO_PATH: "-object_path_lto"
-// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -### %t.o \
+// RUN: %clang -target x86_64-apple-darwin10 -### %t.o \
// RUN: -force_load a -force_load b 2> %t.log
// RUN: cat %t.log
// RUN: FileCheck -check-prefix=FORCE_LOAD %s < %t.log
@@ -96,14 +96,14 @@
// FORCE_LOAD: {{ld(.exe)?"}}
// FORCE_LOAD: "-force_load" "a" "-force_load" "b"
-// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -### %t.o \
+// RUN: %clang -target x86_64-apple-darwin10 -### %t.o \
// RUN: -lazy_framework Framework 2> %t.log
//
// RUN: FileCheck -check-prefix=LINK_LAZY_FRAMEWORK %s < %t.log
// LINK_LAZY_FRAMEWORK: {{ld(.exe)?"}}
// LINK_LAZY_FRAMEWORK: "-lazy_framework" "Framework"
-// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -### %t.o \
+// RUN: %clang -target x86_64-apple-darwin10 -### %t.o \
// RUN: -lazy_library Library 2> %t.log
//
// RUN: FileCheck -check-prefix=LINK_LAZY_LIBRARY %s < %t.log
Modified: cfe/branches/tooling/test/Driver/darwin-objc-defaults.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Driver/darwin-objc-defaults.m?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Driver/darwin-objc-defaults.m (original)
+++ cfe/branches/tooling/test/Driver/darwin-objc-defaults.m Mon Jan 23 02:39:37 2012
@@ -2,7 +2,7 @@
// i386
-// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -S -### %s \
+// RUN: %clang -target x86_64-apple-darwin10 -S -### %s \
// RUN: -arch i386 -mmacosx-version-min=10.5 2> %t
// RUN: FileCheck --check-prefix CHECK-I386_OSX10_5 < %t %s
@@ -11,7 +11,7 @@
// CHECK-CHECK-I386_OSX10_5-NOT: -fobjc-dispatch-method
// CHECK-CHECK-I386_OSX10_5: darwin-objc-defaults
-// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -S -### %s \
+// RUN: %clang -target x86_64-apple-darwin10 -S -### %s \
// RUN: -arch i386 -mmacosx-version-min=10.6 2> %t
// RUN: FileCheck --check-prefix CHECK-I386_OSX10_6 < %t %s
@@ -20,7 +20,7 @@
// CHECK-CHECK-I386_OSX10_6-NOT: -fobjc-dispatch-method
// CHECK-CHECK-I386_OSX10_6: darwin-objc-defaults
-// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -S -### %s \
+// RUN: %clang -target x86_64-apple-darwin10 -S -### %s \
// RUN: -arch i386 -miphoneos-version-min=3.0 2> %t
// RUN: FileCheck --check-prefix CHECK-I386_IPHONE3_0 < %t %s
@@ -31,7 +31,7 @@
// x86_64
-// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -S -### %s \
+// RUN: %clang -target x86_64-apple-darwin10 -S -### %s \
// RUN: -arch x86_64 -mmacosx-version-min=10.5 2> %t
// RUN: FileCheck --check-prefix CHECK-X86_64_OSX10_5 < %t %s
@@ -40,7 +40,7 @@
// CHECK-CHECK-X86_64_OSX10_5: -fobjc-dispatch-method=non-legacy
// CHECK-CHECK-X86_64_OSX10_5: darwin-objc-defaults
-// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -S -### %s \
+// RUN: %clang -target x86_64-apple-darwin10 -S -### %s \
// RUN: -arch x86_64 -mmacosx-version-min=10.6 2> %t
// RUN: FileCheck --check-prefix CHECK-X86_64_OSX10_6 < %t %s
@@ -49,7 +49,7 @@
// CHECK-CHECK-X86_64_OSX10_6: -fobjc-dispatch-method=mixed
// CHECK-CHECK-X86_64_OSX10_6: darwin-objc-defaults
-// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -S -### %s \
+// RUN: %clang -target x86_64-apple-darwin10 -S -### %s \
// RUN: -arch x86_64 -miphoneos-version-min=3.0 2> %t
// RUN: FileCheck --check-prefix CHECK-X86_64_IPHONE3_0 < %t %s
@@ -60,7 +60,7 @@
// armv7
-// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -S -### %s \
+// RUN: %clang -target x86_64-apple-darwin10 -S -### %s \
// RUN: -arch armv7 -mmacosx-version-min=10.5 2> %t
// RUN: FileCheck --check-prefix CHECK-ARMV7_OSX10_5 < %t %s
@@ -69,7 +69,7 @@
// CHECK-CHECK-ARMV7_OSX10_5-NOT: -fobjc-dispatch-method
// CHECK-CHECK-ARMV7_OSX10_5: darwin-objc-defaults
-// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -S -### %s \
+// RUN: %clang -target x86_64-apple-darwin10 -S -### %s \
// RUN: -arch armv7 -mmacosx-version-min=10.6 2> %t
// RUN: FileCheck --check-prefix CHECK-ARMV7_OSX10_6 < %t %s
@@ -78,7 +78,7 @@
// CHECK-CHECK-ARMV7_OSX10_6-NOT: -fobjc-dispatch-method
// CHECK-CHECK-ARMV7_OSX10_6: darwin-objc-defaults
-// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -S -### %s \
+// RUN: %clang -target x86_64-apple-darwin10 -S -### %s \
// RUN: -arch armv7 -miphoneos-version-min=3.0 2> %t
// RUN: FileCheck --check-prefix CHECK-ARMV7_IPHONE3_0 < %t %s
Modified: cfe/branches/tooling/test/Driver/darwin-objc-gc.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Driver/darwin-objc-gc.m?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Driver/darwin-objc-gc.m (original)
+++ cfe/branches/tooling/test/Driver/darwin-objc-gc.m Mon Jan 23 02:39:37 2012
@@ -1,6 +1,6 @@
// Check that we warn, but accept, -fobjc-gc for iPhone OS.
-// RUN: %clang -ccc-host-triple i386-apple-darwin9 -miphoneos-version-min=3.0 -fobjc-gc -flto -S -o %t %s 2> %t.err
+// RUN: %clang -target i386-apple-darwin9 -miphoneos-version-min=3.0 -fobjc-gc -flto -S -o %t %s 2> %t.err
// RUN: FileCheck --check-prefix=IPHONE_OBJC_GC_LL %s < %t
// RUN: FileCheck --check-prefix=IPHONE_OBJC_GC_STDERR %s < %t.err
Modified: cfe/branches/tooling/test/Driver/darwin-objc-options.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Driver/darwin-objc-options.m?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Driver/darwin-objc-options.m (original)
+++ cfe/branches/tooling/test/Driver/darwin-objc-options.m Mon Jan 23 02:39:37 2012
@@ -1,6 +1,6 @@
// Check miscellaneous Objective-C options.
-// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -S -### %s \
+// RUN: %clang -target x86_64-apple-darwin10 -S -### %s \
// RUN: -arch x86_64 -fobjc-abi-version=1 2> %t
// RUN: FileCheck --check-prefix CHECK-X86_64_ABI1 < %t %s
@@ -9,7 +9,7 @@
// CHECK-CHECK-X86_64_ABI1-NOT: -fobjc-dispatch-method
// CHECK-CHECK-X86_64_ABI1: darwin-objc-options
-// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -S -### %s \
+// RUN: %clang -target x86_64-apple-darwin10 -S -### %s \
// RUN: -arch i386 -fobjc-abi-version=2 2> %t
// RUN: FileCheck --check-prefix CHECK-I386_ABI2 < %t %s
Modified: cfe/branches/tooling/test/Driver/darwin-verify-debug.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Driver/darwin-verify-debug.c?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Driver/darwin-verify-debug.c (original)
+++ cfe/branches/tooling/test/Driver/darwin-verify-debug.c Mon Jan 23 02:39:37 2012
@@ -1,7 +1,7 @@
// Check that we verify debug output properly with multiple -arch options.
//
// REQUIRES: asserts
-// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -ccc-print-phases \
+// RUN: %clang -target x86_64-apple-darwin10 -ccc-print-phases \
// RUN: -verify -arch i386 -arch x86_64 %s -g 2> %t
// RUN: FileCheck -check-prefix=CHECK-MULTIARCH-ACTIONS < %t %s
//
@@ -9,7 +9,7 @@
// CHECK-MULTIARCH-ACTIONS: 8: dsymutil, {7}, dSYM
// CHECK-MULTIARCH-ACTIONS: 9: verify, {8}, none
//
-// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -ccc-print-bindings \
+// RUN: %clang -target x86_64-apple-darwin10 -ccc-print-bindings \
// RUN: -verify -arch i386 -arch x86_64 %s -g 2> %t
// RUN: FileCheck -check-prefix=CHECK-MULTIARCH-BINDINGS < %t %s
//
@@ -18,7 +18,7 @@
// Check output name derivation.
//
-// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -ccc-print-bindings \
+// RUN: %clang -target x86_64-apple-darwin10 -ccc-print-bindings \
// RUN: -verify -o foo %s -g 2> %t
// RUN: FileCheck -check-prefix=CHECK-OUTPUT-NAME < %t %s
//
@@ -29,6 +29,6 @@
// Check that we only verify when needed.
//
// RUN: touch %t.o
-// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -ccc-print-bindings \
+// RUN: %clang -target x86_64-apple-darwin10 -ccc-print-bindings \
// RUN: -verify -o foo %t.o -g 2> %t
// RUN: grep "Verify" %t | count 0
Modified: cfe/branches/tooling/test/Driver/darwin-version.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Driver/darwin-version.c?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Driver/darwin-version.c (original)
+++ cfe/branches/tooling/test/Driver/darwin-version.c Mon Jan 23 02:39:37 2012
@@ -1,5 +1,5 @@
// RUN: env MACOSX_DEPLOYMENT_TARGET=10.1 \
-// RUN: %clang -ccc-host-triple i386-apple-darwin9 -DTEST0 -E %s
+// RUN: %clang -target i386-apple-darwin9 -DTEST0 -E %s
#ifdef TEST0
#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ != 1010
#error Invalid version
@@ -7,7 +7,7 @@
#endif
// RUN: env IPHONEOS_DEPLOYMENT_TARGET=2.0 \
-// RUN: %clang -ccc-host-triple i386-apple-darwin9 -DTEST1 -E %s
+// RUN: %clang -target i386-apple-darwin9 -DTEST1 -E %s
#ifdef TEST1
#if __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ != 20000
#error Invalid version
@@ -15,7 +15,7 @@
#endif
// RUN: env IPHONEOS_DEPLOYMENT_TARGET=2.3.1 \
-// RUN: %clang -ccc-host-triple i386-apple-darwin9 -DTEST2 -E %s
+// RUN: %clang -target i386-apple-darwin9 -DTEST2 -E %s
#ifdef TEST2
#if __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ != 20301
#error Invalid version
@@ -23,7 +23,7 @@
#endif
// RUN: env MACOSX_DEPLOYMENT_TARGET=10.4.10 \
-// RUN: %clang -ccc-host-triple i386-apple-darwin9 -DTEST3 -E %s
+// RUN: %clang -target i386-apple-darwin9 -DTEST3 -E %s
#ifdef TEST3
#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ != 1049
#error Invalid version
Modified: cfe/branches/tooling/test/Driver/darwin-xarch.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Driver/darwin-xarch.c?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Driver/darwin-xarch.c (original)
+++ cfe/branches/tooling/test/Driver/darwin-xarch.c Mon Jan 23 02:39:37 2012
@@ -1,4 +1,4 @@
-// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -### \
+// RUN: %clang -target x86_64-apple-darwin10 -### \
// RUN: -arch i386 -Xarch_i386 -mmacosx-version-min=10.4 \
// RUN: -arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.5 \
// RUN: -c %s 2> %t
@@ -7,13 +7,13 @@
// CHECK-COMPILE: clang{{.*}}" "-cc1" "-triple" "i386-apple-macosx10.4.0"
// CHECK-COMPILE: clang{{.*}}" "-cc1" "-triple" "x86_64-apple-macosx10.5.0"
-// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -### \
+// RUN: %clang -target x86_64-apple-darwin10 -### \
// RUN: -arch i386 -Xarch_i386 -Wl,-some-linker-arg -filelist X 2> %t
// RUN: FileCheck --check-prefix=CHECK-LINK < %t %s
//
// CHECK-LINK: ld{{.*}} "-arch" "i386"{{.*}} "-some-linker-arg"
-// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -### \
+// RUN: %clang -target x86_64-apple-darwin10 -### \
// RUN: -arch armv7 -Xarch_armv7 -Wl,-some-linker-arg -filelist X 2> %t
// RUN: FileCheck --check-prefix=CHECK-ARMV7-LINK < %t %s
//
Modified: cfe/branches/tooling/test/Driver/default-toolchain.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Driver/default-toolchain.c?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Driver/default-toolchain.c (original)
+++ cfe/branches/tooling/test/Driver/default-toolchain.c Mon Jan 23 02:39:37 2012
@@ -1,8 +1,8 @@
-// RUN: %clang -ccc-host-triple i386-unknown-unknown -m64 -v 2> %t
+// RUN: %clang -target i386-unknown-unknown -m64 -v 2> %t
// RUN: grep 'Target: x86_64-unknown-unknown' %t
-// RUN: %clang -ccc-host-triple i386-apple-darwin9 -arch ppc -m64 -v 2> %t
+// RUN: %clang -target i386-apple-darwin9 -arch ppc -m64 -v 2> %t
// RUN: grep 'Target: powerpc64-apple-darwin9' %t
-// RUN: %clang -ccc-host-triple i386-apple-darwin9 -arch ppc64 -m32 -v 2> %t
+// RUN: %clang -target i386-apple-darwin9 -arch ppc64 -m32 -v 2> %t
// RUN: grep 'Target: powerpc-apple-darwin9' %t
Modified: cfe/branches/tooling/test/Driver/dragonfly.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Driver/dragonfly.c?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Driver/dragonfly.c (original)
+++ cfe/branches/tooling/test/Driver/dragonfly.c Mon Jan 23 02:39:37 2012
@@ -1,4 +1,4 @@
-// RUN: %clang -ccc-host-triple amd64-pc-dragonfly %s -### 2> %t.log
+// RUN: %clang -target amd64-pc-dragonfly %s -### 2> %t.log
// RUN: FileCheck -input-file %t.log %s
// CHECK: clang{{.*}}" "-cc1" "-triple" "amd64-pc-dragonfly"
Modified: cfe/branches/tooling/test/Driver/exceptions.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Driver/exceptions.m?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Driver/exceptions.m (original)
+++ cfe/branches/tooling/test/Driver/exceptions.m Mon Jan 23 02:39:37 2012
@@ -1,4 +1,4 @@
-// RUN: %clang -ccc-host-triple x86_64-apple-darwin9 \
+// RUN: %clang -target x86_64-apple-darwin9 \
// RUN: -fsyntax-only -fno-exceptions %s
void f1() {
Modified: cfe/branches/tooling/test/Driver/flags.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Driver/flags.c?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Driver/flags.c (original)
+++ cfe/branches/tooling/test/Driver/flags.c Mon Jan 23 02:39:37 2012
@@ -1,9 +1,9 @@
-// RUN: %clang -ccc-host-triple i386-apple-darwin9 -### -S -msoft-float %s 2> %t.log
+// RUN: %clang -target i386-apple-darwin9 -### -S -msoft-float %s 2> %t.log
// RUN: grep '"-no-implicit-float"' %t.log
-// RUN: %clang -ccc-host-triple i386-apple-darwin9 -### -S -msoft-float -mno-soft-float %s 2> %t.log
+// RUN: %clang -target i386-apple-darwin9 -### -S -msoft-float -mno-soft-float %s 2> %t.log
// RUN: grep '"-no-implicit-float"' %t.log | count 0
-// RUN: %clang -ccc-host-triple i386-apple-darwin9 -### -S -mno-soft-float %s -msoft-float 2> %t.log
+// RUN: %clang -target i386-apple-darwin9 -### -S -mno-soft-float %s -msoft-float 2> %t.log
// RUN: grep '"-no-implicit-float"' %t.log
Modified: cfe/branches/tooling/test/Driver/frame-pointer.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Driver/frame-pointer.c?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Driver/frame-pointer.c (original)
+++ cfe/branches/tooling/test/Driver/frame-pointer.c Mon Jan 23 02:39:37 2012
@@ -1,15 +1,15 @@
-// RUN: %clang -ccc-host-triple i386-pc-linux -### -S -O0 %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK0-32 %s
-// RUN: %clang -ccc-host-triple i386-pc-linux -### -S -O1 %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK1-32 %s
-// RUN: %clang -ccc-host-triple i386-pc-linux -### -S -O2 %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK2-32 %s
-// RUN: %clang -ccc-host-triple i386-pc-linux -### -S -O3 %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK3-32 %s
-// RUN: %clang -ccc-host-triple i386-pc-linux -### -S -Os %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECKs-32 %s
+// RUN: %clang -target i386-pc-linux -### -S -O0 %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK0-32 %s
+// RUN: %clang -target i386-pc-linux -### -S -O1 %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK1-32 %s
+// RUN: %clang -target i386-pc-linux -### -S -O2 %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK2-32 %s
+// RUN: %clang -target i386-pc-linux -### -S -O3 %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK3-32 %s
+// RUN: %clang -target i386-pc-linux -### -S -Os %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECKs-32 %s
-// RUN: %clang -ccc-host-triple x86_64-pc-linux -### -S -O0 %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK0-64 %s
-// RUN: %clang -ccc-host-triple x86_64-pc-linux -### -S -O1 %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK1-64 %s
-// RUN: %clang -ccc-host-triple x86_64-pc-linux -### -S -O2 %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK2-64 %s
-// RUN: %clang -ccc-host-triple x86_64-pc-linux -### -S -O3 %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK3-64 %s
-// RUN: %clang -ccc-host-triple x86_64-pc-linux -### -S -Os %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECKs-64 %s
+// RUN: %clang -target x86_64-pc-linux -### -S -O0 %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK0-64 %s
+// RUN: %clang -target x86_64-pc-linux -### -S -O1 %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK1-64 %s
+// RUN: %clang -target x86_64-pc-linux -### -S -O2 %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK2-64 %s
+// RUN: %clang -target x86_64-pc-linux -### -S -O3 %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK3-64 %s
+// RUN: %clang -target x86_64-pc-linux -### -S -Os %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECKs-64 %s
// CHECK0-32: -mdisable-fp-elim
// CHECK1-32-NOT: -mdisable-fp-elim
Modified: cfe/branches/tooling/test/Driver/freebsd.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Driver/freebsd.c?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Driver/freebsd.c (original)
+++ cfe/branches/tooling/test/Driver/freebsd.c Mon Jan 23 02:39:37 2012
@@ -1,4 +1,4 @@
-// RUN: %clang -ccc-clang-archs "" -ccc-host-triple powerpc64-pc-freebsd8 %s -### 2> %t
+// RUN: %clang -ccc-clang-archs "" -target powerpc64-pc-freebsd8 %s -### 2> %t
// RUN: FileCheck --check-prefix=CHECK-PPC < %t %s
//
// CHECK-PPC: clang{{.*}}" "-cc1" "-triple" "powerpc64-pc-freebsd8"
@@ -7,13 +7,13 @@
// Check that -m32 properly adjusts the toolchain flags.
//
-// RUN: %clang -ccc-host-triple x86_64-pc-freebsd8 -m32 -### %s 2> %t
+// RUN: %clang -target x86_64-pc-freebsd8 -m32 -### %s 2> %t
// RUN: FileCheck --check-prefix=CHECK-LIB32 < %t %s
//
// CHECK-LIB32: clang{{.*}}" "-cc1" "-triple" "i386-pc-freebsd8"
// CHECK-LIB32: ld{{.*}}" {{.*}} "-m" "elf_i386_fbsd"
//
-// RUN: %clang -ccc-host-triple x86_64-pc-freebsd8 -m32 -print-search-dirs %s > %t
+// RUN: %clang -target x86_64-pc-freebsd8 -m32 -print-search-dirs %s > %t
// RUN: FileCheck --check-prefix=CHECK-LIB32PATHS < %t %s
//
// CHECK-LIB32PATHS: libraries: ={{.*:?}}/usr/lib32
Modified: cfe/branches/tooling/test/Driver/gcc_forward.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Driver/gcc_forward.c?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Driver/gcc_forward.c (original)
+++ cfe/branches/tooling/test/Driver/gcc_forward.c Mon Jan 23 02:39:37 2012
@@ -1,6 +1,6 @@
// Check that we don't try to forward -Xclang or -mlinker-version to GCC.
//
-// RUN: %clang -ccc-host-triple powerpc-unknown-unknown \
+// RUN: %clang -target powerpc-unknown-unknown \
// RUN: -ccc-clang-archs i386 -c %s \
// RUN: -Xclang foo-bar \
// RUN: -mlinker-version=10 -### 2> %t
Modified: cfe/branches/tooling/test/Driver/gnu-runtime.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Driver/gnu-runtime.m?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Driver/gnu-runtime.m (original)
+++ cfe/branches/tooling/test/Driver/gnu-runtime.m Mon Jan 23 02:39:37 2012
@@ -1,5 +1,5 @@
-// RUN: %clang -ccc-host-triple i386-apple-darwin10 -### -fsyntax-only -fgnu-runtime %s 2>&1 | FileCheck %s
-// RUN: %clang -ccc-host-triple i386-apple-darwin10 -### -x objective-c++ -fsyntax-only -fgnu-runtime %s 2>&1 | FileCheck %s
+// RUN: %clang -target i386-apple-darwin10 -### -fsyntax-only -fgnu-runtime %s 2>&1 | FileCheck %s
+// RUN: %clang -target i386-apple-darwin10 -### -x objective-c++ -fsyntax-only -fgnu-runtime %s 2>&1 | FileCheck %s
// CHECK: -fgnu-runtime
// CHECK: -fobjc-runtime-has-arc
// CHECK: -fobjc-runtime-has-weak
Modified: cfe/branches/tooling/test/Driver/ios-simulator-arcruntime.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Driver/ios-simulator-arcruntime.c?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Driver/ios-simulator-arcruntime.c (original)
+++ cfe/branches/tooling/test/Driver/ios-simulator-arcruntime.c Mon Jan 23 02:39:37 2012
@@ -1,5 +1,5 @@
-// RUN: %clang -### -x objective-c -ccc-host-triple i386-apple-darwin10 -arch i386 -mmacosx-version-min=10.6 -D__IPHONE_OS_VERSION_MIN_REQUIRED=40201 -fobjc-arc -fsyntax-only %s 2>&1 | FileCheck -check-prefix=CHECK-OPTIONS1 %s
-// RUN: %clang -### -x objective-c -ccc-host-triple i386-apple-darwin10 -arch i386 -mmacosx-version-min=10.6 -D__IPHONE_OS_VERSION_MIN_REQUIRED=50000 -fobjc-arc -fsyntax-only %s 2>&1 | FileCheck -check-prefix=CHECK-OPTIONS2 %s
+// RUN: %clang -### -x objective-c -target i386-apple-darwin10 -arch i386 -mmacosx-version-min=10.6 -D__IPHONE_OS_VERSION_MIN_REQUIRED=40201 -fobjc-arc -fsyntax-only %s 2>&1 | FileCheck -check-prefix=CHECK-OPTIONS1 %s
+// RUN: %clang -### -x objective-c -target i386-apple-darwin10 -arch i386 -mmacosx-version-min=10.6 -D__IPHONE_OS_VERSION_MIN_REQUIRED=50000 -fobjc-arc -fsyntax-only %s 2>&1 | FileCheck -check-prefix=CHECK-OPTIONS2 %s
//
// CHECK-OPTIONS1-NOT: -fobjc-runtime-has-weak
Modified: cfe/branches/tooling/test/Driver/le32-unknown-nacl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Driver/le32-unknown-nacl.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Driver/le32-unknown-nacl.cpp (original)
+++ cfe/branches/tooling/test/Driver/le32-unknown-nacl.cpp Mon Jan 23 02:39:37 2012
@@ -1,6 +1,6 @@
-// RUN: %clang -ccc-host-triple le32-unknown-nacl -ccc-clang-archs le32 -ccc-echo %s -emit-llvm-only -c 2>&1 | FileCheck %s -check-prefix=ECHO
-// RUN: %clang -ccc-host-triple le32-unknown-nacl -ccc-clang-archs le32 %s -emit-llvm -S -c -o - | FileCheck %s
-// RUN: %clang -ccc-host-triple le32-unknown-nacl -ccc-clang-archs le32 %s -emit-llvm -S -c -pthread -o - | FileCheck %s -check-prefix=THREADS
+// RUN: %clang -target le32-unknown-nacl -ccc-clang-archs le32 -ccc-echo %s -emit-llvm-only -c 2>&1 | FileCheck %s -check-prefix=ECHO
+// RUN: %clang -target le32-unknown-nacl -ccc-clang-archs le32 %s -emit-llvm -S -c -o - | FileCheck %s
+// RUN: %clang -target le32-unknown-nacl -ccc-clang-archs le32 %s -emit-llvm -S -c -pthread -o - | FileCheck %s -check-prefix=THREADS
// ECHO: {{.*}} -cc1 {{.*}}le32-unknown-nacl.c
Modified: cfe/branches/tooling/test/Driver/linux-header-search.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Driver/linux-header-search.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Driver/linux-header-search.cpp (original)
+++ cfe/branches/tooling/test/Driver/linux-header-search.cpp Mon Jan 23 02:39:37 2012
@@ -3,7 +3,7 @@
//
// Test a very broken version of multiarch that shipped in Ubuntu 11.04.
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
-// RUN: -ccc-host-triple i386-unknown-linux \
+// RUN: -target i386-unknown-linux \
// RUN: --sysroot=%S/Inputs/ubuntu_11.04_multiarch_tree \
// RUN: | FileCheck --check-prefix=CHECK-UBUNTU-11-04 %s
// CHECK-UBUNTU-11-04: "{{.*}}clang{{.*}}" "-cc1"
Modified: cfe/branches/tooling/test/Driver/linux-ld.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Driver/linux-ld.c?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Driver/linux-ld.c (original)
+++ cfe/branches/tooling/test/Driver/linux-ld.c Mon Jan 23 02:39:37 2012
@@ -2,7 +2,7 @@
// sysroot to make these tests independent of the host system.
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -ccc-host-triple i386-unknown-linux \
+// RUN: -target i386-unknown-linux \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
// RUN: | FileCheck --check-prefix=CHECK-LD-32 %s
// CHECK-LD-32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
@@ -14,7 +14,7 @@
// CHECK-LD-32: "-L[[SYSROOT]]/usr/lib"
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -ccc-host-triple x86_64-unknown-linux \
+// RUN: -target x86_64-unknown-linux \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
// RUN: | FileCheck --check-prefix=CHECK-LD-64 %s
// CHECK-LD-64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
@@ -26,7 +26,7 @@
// CHECK-LD-64: "-L[[SYSROOT]]/usr/lib"
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -ccc-host-triple i386-unknown-linux -m32 \
+// RUN: -target i386-unknown-linux -m32 \
// RUN: --sysroot=%S/Inputs/multilib_32bit_linux_tree \
// RUN: | FileCheck --check-prefix=CHECK-32-TO-32 %s
// CHECK-32-TO-32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
@@ -42,7 +42,7 @@
// CHECK-32-TO-32: "-L[[SYSROOT]]/usr/lib"
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -ccc-host-triple i386-unknown-linux -m64 \
+// RUN: -target i386-unknown-linux -m64 \
// RUN: --sysroot=%S/Inputs/multilib_32bit_linux_tree \
// RUN: | FileCheck --check-prefix=CHECK-32-TO-64 %s
// CHECK-32-TO-64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
@@ -59,7 +59,7 @@
// CHECK-32-TO-64: "-L[[SYSROOT]]/usr/lib"
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -ccc-host-triple x86_64-unknown-linux -m64 \
+// RUN: -target x86_64-unknown-linux -m64 \
// RUN: --sysroot=%S/Inputs/multilib_64bit_linux_tree \
// RUN: | FileCheck --check-prefix=CHECK-64-TO-64 %s
// CHECK-64-TO-64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
@@ -75,7 +75,7 @@
// CHECK-64-TO-64: "-L[[SYSROOT]]/usr/lib"
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -ccc-host-triple x86_64-unknown-linux -m32 \
+// RUN: -target x86_64-unknown-linux -m32 \
// RUN: --sysroot=%S/Inputs/multilib_64bit_linux_tree \
// RUN: | FileCheck --check-prefix=CHECK-64-TO-32 %s
// CHECK-64-TO-32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
@@ -92,7 +92,7 @@
// CHECK-64-TO-32: "-L[[SYSROOT]]/usr/lib"
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -ccc-host-triple i386-unknown-linux -m32 \
+// RUN: -target i386-unknown-linux -m32 \
// RUN: -ccc-install-dir %S/Inputs/fake_install_tree/bin \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
// RUN: | FileCheck --check-prefix=CHECK-INSTALL-DIR-32 %s
@@ -103,7 +103,7 @@
// Check that with 64-bit builds, we don't actually use the install directory
// as its version of GCC is lower than our sysrooted version.
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -ccc-host-triple x86_64-unknown-linux -m64 \
+// RUN: -target x86_64-unknown-linux -m64 \
// RUN: -ccc-install-dir %S/Inputs/fake_install_tree/bin \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
// RUN: | FileCheck --check-prefix=CHECK-INSTALL-DIR-64 %s
@@ -114,7 +114,7 @@
// Check that we support unusual patch version formats, including missing that
// component.
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -ccc-host-triple i386-unknown-linux -m32 \
+// RUN: -target i386-unknown-linux -m32 \
// RUN: -ccc-install-dir %S/Inputs/gcc_version_parsing1/bin \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
// RUN: | FileCheck --check-prefix=CHECK-GCC-VERSION1 %s
@@ -122,7 +122,7 @@
// CHECK-GCC-VERSION1: "{{.*}}/Inputs/gcc_version_parsing1/bin/../lib/gcc/i386-unknown-linux/4.7/crtbegin.o"
// CHECK-GCC-VERSION1: "-L{{.*}}/Inputs/gcc_version_parsing1/bin/../lib/gcc/i386-unknown-linux/4.7"
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -ccc-host-triple i386-unknown-linux -m32 \
+// RUN: -target i386-unknown-linux -m32 \
// RUN: -ccc-install-dir %S/Inputs/gcc_version_parsing2/bin \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
// RUN: | FileCheck --check-prefix=CHECK-GCC-VERSION2 %s
@@ -130,7 +130,7 @@
// CHECK-GCC-VERSION2: "{{.*}}/Inputs/gcc_version_parsing2/bin/../lib/gcc/i386-unknown-linux/4.7.x/crtbegin.o"
// CHECK-GCC-VERSION2: "-L{{.*}}/Inputs/gcc_version_parsing2/bin/../lib/gcc/i386-unknown-linux/4.7.x"
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -ccc-host-triple i386-unknown-linux -m32 \
+// RUN: -target i386-unknown-linux -m32 \
// RUN: -ccc-install-dir %S/Inputs/gcc_version_parsing3/bin \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
// RUN: | FileCheck --check-prefix=CHECK-GCC-VERSION3 %s
@@ -138,7 +138,7 @@
// CHECK-GCC-VERSION3: "{{.*}}/Inputs/gcc_version_parsing3/bin/../lib/gcc/i386-unknown-linux/4.7.99-rc5/crtbegin.o"
// CHECK-GCC-VERSION3: "-L{{.*}}/Inputs/gcc_version_parsing3/bin/../lib/gcc/i386-unknown-linux/4.7.99-rc5"
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -ccc-host-triple i386-unknown-linux -m32 \
+// RUN: -target i386-unknown-linux -m32 \
// RUN: -ccc-install-dir %S/Inputs/gcc_version_parsing4/bin \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
// RUN: | FileCheck --check-prefix=CHECK-GCC-VERSION4 %s
@@ -148,7 +148,7 @@
//
// Test a very broken version of multiarch that shipped in Ubuntu 11.04.
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -ccc-host-triple i386-unknown-linux \
+// RUN: -target i386-unknown-linux \
// RUN: --sysroot=%S/Inputs/ubuntu_11.04_multiarch_tree \
// RUN: | FileCheck --check-prefix=CHECK-UBUNTU-11-04 %s
// CHECK-UBUNTU-11-04: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
@@ -162,7 +162,7 @@
//
// Test the setup that shipped in SUSE 10.3 on ppc64.
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -ccc-host-triple powerpc64-suse-linux \
+// RUN: -target powerpc64-suse-linux \
// RUN: --sysroot=%S/Inputs/suse_10.3_ppc64_tree \
// RUN: | FileCheck --check-prefix=CHECK-SUSE-10-3-PPC64 %s
// CHECK-SUSE-10-3-PPC64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
@@ -175,22 +175,22 @@
// Check that we do not pass --hash-style=gnu and --hash-style=both to linker
// when build for MIPS platforms.
// RUN: %clang %s -### -o %t.o 2>&1 \
-// RUN: -ccc-host-triple mips-linux-gnu -ccc-clang-archs mips \
+// RUN: -target mips-linux-gnu -ccc-clang-archs mips \
// RUN: | FileCheck --check-prefix=CHECK-MIPS %s
// CHECK-MIPS: "{{.*}}ld{{(.exe)?}}"
// CHECK-MIPS-NOT: "--hash-style={{gnu|both}}"
// RUN: %clang %s -### -o %t.o 2>&1 \
-// RUN: -ccc-host-triple mipsel-linux-gnu -ccc-clang-archs mipsel \
+// RUN: -target mipsel-linux-gnu -ccc-clang-archs mipsel \
// RUN: | FileCheck --check-prefix=CHECK-MIPSEL %s
// CHECK-MIPSEL: "{{.*}}ld{{(.exe)?}}"
// CHECK-MIPSEL-NOT: "--hash-style={{gnu|both}}"
// RUN: %clang %s -### -o %t.o 2>&1 \
-// RUN: -ccc-host-triple mips64-linux-gnu -ccc-clang-archs mips64 \
+// RUN: -target mips64-linux-gnu -ccc-clang-archs mips64 \
// RUN: | FileCheck --check-prefix=CHECK-MIPS64 %s
// CHECK-MIPS64: "{{.*}}ld{{(.exe)?}}"
// CHECK-MIPS64-NOT: "--hash-style={{gnu|both}}"
// RUN: %clang %s -### -o %t.o 2>&1 \
-// RUN: -ccc-host-triple mips64el-linux-gnu -ccc-clang-archs mips64el \
+// RUN: -target mips64el-linux-gnu -ccc-clang-archs mips64el \
// RUN: | FileCheck --check-prefix=CHECK-MIPS64EL %s
// CHECK-MIPS64EL: "{{.*}}ld{{(.exe)?}}"
// CHECK-MIPS64EL-NOT: "--hash-style={{gnu|both}}"
Modified: cfe/branches/tooling/test/Driver/mno-global-merge.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Driver/mno-global-merge.c?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Driver/mno-global-merge.c (original)
+++ cfe/branches/tooling/test/Driver/mno-global-merge.c Mon Jan 23 02:39:37 2012
@@ -1,10 +1,10 @@
-// RUN: %clang -ccc-host-triple armv7-apple-darwin10 \
+// RUN: %clang -target armv7-apple-darwin10 \
// RUN: -mno-global-merge -### -fsyntax-only %s 2> %t
// RUN: FileCheck --check-prefix=CHECK-NGM < %t %s
// CHECK-NGM: "-mno-global-merge"
-// RUN: %clang -ccc-host-triple armv7-apple-darwin10 \
+// RUN: %clang -target armv7-apple-darwin10 \
// RUN: -mglobal-merge -### -fsyntax-only %s 2> %t
// RUN: FileCheck --check-prefix=CHECK-GM < %t %s
Modified: cfe/branches/tooling/test/Driver/nostdlib.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Driver/nostdlib.c?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Driver/nostdlib.c (original)
+++ cfe/branches/tooling/test/Driver/nostdlib.c Mon Jan 23 02:39:37 2012
@@ -1,4 +1,4 @@
-// RUN: %clang -ccc-host-triple i686-pc-linux-gnu -### -nostdlib %s 2> %t
+// RUN: %clang -target i686-pc-linux-gnu -### -nostdlib %s 2> %t
// RUN: FileCheck < %t %s
//
// CHECK-NOT: start-group
Modified: cfe/branches/tooling/test/Driver/nostdlibinc.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Driver/nostdlibinc.c?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Driver/nostdlibinc.c (original)
+++ cfe/branches/tooling/test/Driver/nostdlibinc.c Mon Jan 23 02:39:37 2012
@@ -1,4 +1,4 @@
-// RUN: %clang -ccc-host-triple x86_64-unknown-unknown \
+// RUN: %clang -target x86_64-unknown-unknown \
// RUN: -nostdlibinc -ffreestanding -fsyntax-only %s
#if !__has_include("stddef.h")
Modified: cfe/branches/tooling/test/Driver/openbsd.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Driver/openbsd.c?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Driver/openbsd.c (original)
+++ cfe/branches/tooling/test/Driver/openbsd.c Mon Jan 23 02:39:37 2012
@@ -1,4 +1,4 @@
-// RUN: %clang -ccc-clang-archs "" -ccc-host-triple i686-pc-openbsd %s -### 2> %t.log
+// RUN: %clang -ccc-clang-archs "" -target i686-pc-openbsd %s -### 2> %t.log
// RUN: FileCheck -input-file %t.log %s
// CHECK: clang{{.*}}" "-cc1" "-triple" "i686-pc-openbsd"
Modified: cfe/branches/tooling/test/Driver/phases.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Driver/phases.c?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Driver/phases.c (original)
+++ cfe/branches/tooling/test/Driver/phases.c Mon Jan 23 02:39:37 2012
@@ -1,5 +1,5 @@
// Basic compilation for various types of files.
-// RUN: %clang -ccc-host-triple i386-unknown-unknown -ccc-print-phases -x c %s -x objective-c %s -x c++ %s -x objective-c++ -x assembler %s -x assembler-with-cpp %s -x none %s 2>&1 | FileCheck -check-prefix=BASIC %s
+// RUN: %clang -target i386-unknown-unknown -ccc-print-phases -x c %s -x objective-c %s -x c++ %s -x objective-c++ -x assembler %s -x assembler-with-cpp %s -x none %s 2>&1 | FileCheck -check-prefix=BASIC %s
// BASIC: 0: input, "{{.*}}phases.c", c
// BASIC: 1: preprocessor, {0}, cpp-output
// BASIC: 2: compiler, {1}, assembler
@@ -24,7 +24,7 @@
// BASIC: 21: linker, {3, 7, 11, 13, 16, 20}, image
// Universal linked image.
-// RUN: %clang -ccc-host-triple i386-apple-darwin9 -ccc-print-phases -x c %s -arch ppc -arch i386 2>&1 | FileCheck -check-prefix=ULI %s
+// RUN: %clang -target i386-apple-darwin9 -ccc-print-phases -x c %s -arch ppc -arch i386 2>&1 | FileCheck -check-prefix=ULI %s
// ULI: 0: input, "{{.*}}phases.c", c
// ULI: 1: preprocessor, {0}, cpp-output
// ULI: 2: compiler, {1}, assembler
@@ -35,7 +35,7 @@
// ULI: 7: lipo, {5, 6}, image
// Universal object file.
-// RUN: %clang -ccc-host-triple i386-apple-darwin9 -ccc-print-phases -c -x c %s -arch ppc -arch i386 2>&1 | FileCheck -check-prefix=UOF %s
+// RUN: %clang -target i386-apple-darwin9 -ccc-print-phases -c -x c %s -arch ppc -arch i386 2>&1 | FileCheck -check-prefix=UOF %s
// UOF: 0: input, "{{.*}}phases.c", c
// UOF: 1: preprocessor, {0}, cpp-output
// UOF: 2: compiler, {1}, assembler
@@ -45,33 +45,33 @@
// UOF: 6: lipo, {4, 5}, object
// Arch defaulting
-// RUN: %clang -ccc-host-triple i386-apple-darwin9 -ccc-print-phases -c -x assembler %s 2>&1 | FileCheck -check-prefix=ARCH1 %s
+// RUN: %clang -target i386-apple-darwin9 -ccc-print-phases -c -x assembler %s 2>&1 | FileCheck -check-prefix=ARCH1 %s
// ARCH1: 2: bind-arch, "i386", {1}, object
-// RUN: %clang -ccc-host-triple i386-apple-darwin9 -ccc-print-phases -c -x assembler %s -m32 -m64 2>&1 | FileCheck -check-prefix=ARCH2 %s
+// RUN: %clang -target i386-apple-darwin9 -ccc-print-phases -c -x assembler %s -m32 -m64 2>&1 | FileCheck -check-prefix=ARCH2 %s
// ARCH2: 2: bind-arch, "x86_64", {1}, object
-// RUN: %clang -ccc-host-triple x86_64-apple-darwin9 -ccc-print-phases -c -x assembler %s 2>&1 | FileCheck -check-prefix=ARCH3 %s
+// RUN: %clang -target x86_64-apple-darwin9 -ccc-print-phases -c -x assembler %s 2>&1 | FileCheck -check-prefix=ARCH3 %s
// ARCH3: 2: bind-arch, "x86_64", {1}, object
-// RUN: %clang -ccc-host-triple x86_64-apple-darwin9 -ccc-print-phases -c -x assembler %s -m64 -m32 2>&1 | FileCheck -check-prefix=ARCH4 %s
+// RUN: %clang -target x86_64-apple-darwin9 -ccc-print-phases -c -x assembler %s -m64 -m32 2>&1 | FileCheck -check-prefix=ARCH4 %s
// ARCH4: 2: bind-arch, "i386", {1}, object
// Analyzer
-// RUN: %clang -ccc-host-triple i386-unknown-unknown -ccc-print-phases --analyze %s 2>&1 | FileCheck -check-prefix=ANALYZE %s
+// RUN: %clang -target i386-unknown-unknown -ccc-print-phases --analyze %s 2>&1 | FileCheck -check-prefix=ANALYZE %s
// ANALYZE: 0: input, "{{.*}}phases.c", c
// ANALYZE: 1: preprocessor, {0}, cpp-output
// ANALYZE: 2: analyzer, {1}, plist
// Precompiler
-// RUN: %clang -ccc-host-triple i386-unknown-unknown -ccc-print-phases -x c-header %s 2>&1 | FileCheck -check-prefix=PCH %s
+// RUN: %clang -target i386-unknown-unknown -ccc-print-phases -x c-header %s 2>&1 | FileCheck -check-prefix=PCH %s
// PCH: 0: input, "{{.*}}phases.c", c-header
// PCH: 1: preprocessor, {0}, c-header-cpp-output
// PCH: 2: precompiler, {1}, precompiled-header
// Darwin overrides the handling for .s
// RUN: touch %t.s
-// RUN: %clang -ccc-host-triple i386-unknown-unknown -ccc-print-phases -c %t.s 2>&1 | FileCheck -check-prefix=DARWIN1 %s
+// RUN: %clang -target i386-unknown-unknown -ccc-print-phases -c %t.s 2>&1 | FileCheck -check-prefix=DARWIN1 %s
// DARWIN1: 0: input, "{{.*}}.s", assembler
// DARWIN1: 1: assembler, {0}, object
-// RUN: %clang -ccc-host-triple i386-apple-darwin9 -ccc-print-phases -c %t.s 2>&1 | FileCheck -check-prefix=DARWIN2 %s
+// RUN: %clang -target i386-apple-darwin9 -ccc-print-phases -c %t.s 2>&1 | FileCheck -check-prefix=DARWIN2 %s
// DARWIN2: 0: input, "{{.*}}.s", assembler-with-cpp
// DARWIN2: 1: preprocessor, {0}, assembler
// DARWIN2: 2: assembler, {1}, object
Modified: cfe/branches/tooling/test/Driver/redzone.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Driver/redzone.c?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Driver/redzone.c (original)
+++ cfe/branches/tooling/test/Driver/redzone.c Mon Jan 23 02:39:37 2012
@@ -1,6 +1,6 @@
-// RUN: %clang -ccc-host-triple i386-unknown-unknown -mno-red-zone %s -S -emit-llvm -o %t.log
+// RUN: %clang -target i386-unknown-unknown -mno-red-zone %s -S -emit-llvm -o %t.log
// RUN: grep 'noredzone' %t.log
-// RUN: %clang -ccc-host-triple i386-unknown-unknown -mred-zone %s -S -emit-llvm -o %t.log
+// RUN: %clang -target i386-unknown-unknown -mred-zone %s -S -emit-llvm -o %t.log
// RUN: grep -v 'noredzone' %t.log
int foo() { return 42; }
Modified: cfe/branches/tooling/test/Driver/rewrite-objc.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Driver/rewrite-objc.m?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Driver/rewrite-objc.m (original)
+++ cfe/branches/tooling/test/Driver/rewrite-objc.m Mon Jan 23 02:39:37 2012
@@ -1,4 +1,4 @@
-// RUN: %clang -ccc-host-triple x86_64-apple-macosx10.7.0 -rewrite-objc %s -o - -### 2>&1 | \
+// RUN: %clang -target x86_64-apple-macosx10.7.0 -rewrite-objc %s -o - -### 2>&1 | \
// RUN: FileCheck -check-prefix=TEST0 %s
// TEST0: clang{{.*}}" "-cc1"
// TEST0: "-rewrite-objc"
@@ -6,10 +6,10 @@
// TEST0: "-fmessage-length" "0" "-stack-protector" "1" "-mstackrealign" "-fblocks" "-fobjc-fragile-abi" "-fno-objc-infer-related-result-type" "-fobjc-exceptions" "-fexceptions" "-fdiagnostics-show-option"
// TEST0: rewrite-objc.m"
-// RUN: not %clang -ccc-no-clang -ccc-host-triple unknown -rewrite-objc %s -o - -### 2>&1 | \
+// RUN: not %clang -ccc-no-clang -target unknown -rewrite-objc %s -o - -### 2>&1 | \
// RUN: FileCheck -check-prefix=TEST1 %s
// TEST1: invalid output type 'rewritten-objc' for use with gcc
-// RUN: not %clang -ccc-no-clang -ccc-host-triple i386-apple-darwin10 -rewrite-objc %s -o - -### 2>&1 | \
+// RUN: not %clang -ccc-no-clang -target i386-apple-darwin10 -rewrite-objc %s -o - -### 2>&1 | \
// RUN: FileCheck -check-prefix=TEST2 %s
// TEST2: invalid output type 'rewritten-objc' for use with gcc
Modified: cfe/branches/tooling/test/Driver/sysroot-flags.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Driver/sysroot-flags.c?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Driver/sysroot-flags.c (original)
+++ cfe/branches/tooling/test/Driver/sysroot-flags.c Mon Jan 23 02:39:37 2012
@@ -6,7 +6,7 @@
// Check that we get both isysroot for headers, and pass --sysroot on to GCC to
// produce the final binary.
-// RUN: %clang -### -ccc-host-triple x86_64-unknown-linux-gnu \
+// RUN: %clang -### -target x86_64-unknown-linux-gnu \
// RUN: --sysroot=/foo/bar -o /dev/null %s 2>&1 | \
// RUN: FileCheck %s -check-prefix=SYSROOT_EQ
// SYSROOT_EQ: "-isysroot" "{{[^"]*}}/foo/bar"
@@ -14,14 +14,14 @@
// Check for overriding the header sysroot by providing both --sysroot and
// -isysroot.
-// RUN: %clang -### -ccc-host-triple x86_64-unknown-linux-gnu -isysroot /baz \
+// RUN: %clang -### -target x86_64-unknown-linux-gnu -isysroot /baz \
// RUN: --sysroot=/foo/bar -o /dev/null %s 2>&1 | FileCheck %s \
// RUN: -check-prefix=ISYSROOT_AND_SYSROOT
// ISYSROOT_AND_SYSROOT: "-isysroot" "{{[^"]*}}/baz"
// ISYSROOT_AND_SYSROOT: "--sysroot{{" "|=}}{{[^"]*}}/foo/bar"
// Check that omitting the equals works as well.
-// RUN: %clang -### -ccc-host-triple x86_64-unknown-linux-gnu \
+// RUN: %clang -### -target x86_64-unknown-linux-gnu \
// RUN: --sysroot /foo/bar -o /dev/null %s 2>&1 | \
// RUN: FileCheck %s -check-prefix=SYSROOT_SEPARATE
// SYSROOT_SEPARATE: "-isysroot" "{{[^"]*}}/foo/bar"
Modified: cfe/branches/tooling/test/Driver/sysroot.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Driver/sysroot.c?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Driver/sysroot.c (original)
+++ cfe/branches/tooling/test/Driver/sysroot.c Mon Jan 23 02:39:37 2012
@@ -1,18 +1,18 @@
// Check that --sysroot= also applies to header search paths.
-// RUN: %clang -ccc-host-triple i386-unk-unk --sysroot=/FOO -### -E %s 2> %t1
+// RUN: %clang -target i386-unk-unk --sysroot=/FOO -### -E %s 2> %t1
// RUN: FileCheck --check-prefix=CHECK-SYSROOTEQ < %t1 %s
// CHECK-SYSROOTEQ: "-cc1"{{.*}} "-isysroot" "{{[^"]*}}/FOO"
// Apple Darwin uses -isysroot as the syslib root, too.
// RUN: touch %t2.o
-// RUN: %clang -ccc-host-triple i386-apple-darwin10 \
+// RUN: %clang -target i386-apple-darwin10 \
// RUN: -isysroot /FOO -### %t2.o 2> %t2
// RUN: FileCheck --check-prefix=CHECK-APPLE-ISYSROOT < %t2 %s
// CHECK-APPLE-ISYSROOT: "-arch" "i386"{{.*}} "-syslibroot" "{{[^"]*}}/FOO"
// Check that honor --sysroot= over -isysroot, for Apple Darwin.
// RUN: touch %t3.o
-// RUN: %clang -ccc-host-triple i386-apple-darwin10 \
+// RUN: %clang -target i386-apple-darwin10 \
// RUN: -isysroot /FOO --sysroot=/BAR -### %t3.o 2> %t3
// RUN: FileCheck --check-prefix=CHECK-APPLE-SYSROOT < %t3 %s
// CHECK-APPLE-SYSROOT: "-arch" "i386"{{.*}} "-syslibroot" "{{[^"]*}}/BAR"
Modified: cfe/branches/tooling/test/Driver/unknown-gcc-arch.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Driver/unknown-gcc-arch.c?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Driver/unknown-gcc-arch.c (original)
+++ cfe/branches/tooling/test/Driver/unknown-gcc-arch.c Mon Jan 23 02:39:37 2012
@@ -1,8 +1,8 @@
-// RUN: %clang -ccc-host-triple x86_64-unknown-unknown -c -x assembler %s -### 2> %t.log
+// RUN: %clang -target x86_64-unknown-unknown -c -x assembler %s -### 2> %t.log
// RUN: grep '.*gcc.*"-m64"' %t.log
-// RUN: %clang -ccc-host-triple x86_64-unknown-unknown -c -x assembler %s -### -m32 2> %t.log
+// RUN: %clang -target x86_64-unknown-unknown -c -x assembler %s -### -m32 2> %t.log
// RUN: grep '.*gcc.*"-m32"' %t.log
-// RUN: %clang -ccc-host-triple i386-unknown-unknown -c -x assembler %s -### 2> %t.log
+// RUN: %clang -target i386-unknown-unknown -c -x assembler %s -### 2> %t.log
// RUN: grep '.*gcc.*"-m32"' %t.log
-// RUN: %clang -ccc-host-triple i386-unknown-unknown -c -x assembler %s -### -m64 2> %t.log
+// RUN: %clang -target i386-unknown-unknown -c -x assembler %s -### -m64 2> %t.log
// RUN: grep '.*gcc.*"-m64"' %t.log
Modified: cfe/branches/tooling/test/Driver/x86_features.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Driver/x86_features.c?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Driver/x86_features.c (original)
+++ cfe/branches/tooling/test/Driver/x86_features.c Mon Jan 23 02:39:37 2012
@@ -1,3 +1,3 @@
-// RUN: %clang -ccc-host-triple i386-unknown-unknown -### -S %s -msse -msse4 -mno-sse -mno-mmx -msse 2> %t
+// RUN: %clang -target i386-unknown-unknown -### -S %s -msse -msse4 -mno-sse -mno-mmx -msse 2> %t
// RUN: grep '"pentium4" "-target-feature" "+sse4" "-target-feature" "-mmx" "-target-feature" "+sse"' %t
// Note that we filter out all but the last -m(no)sse.
Modified: cfe/branches/tooling/test/Frontend/darwin-version.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Frontend/darwin-version.c?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Frontend/darwin-version.c (original)
+++ cfe/branches/tooling/test/Frontend/darwin-version.c Mon Jan 23 02:39:37 2012
@@ -1,25 +1,25 @@
-// RUN: %clang -ccc-host-triple armv6-apple-darwin9 -dM -E -o %t %s
+// RUN: %clang -target armv6-apple-darwin9 -dM -E -o %t %s
// RUN: grep '__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__' %t | count 0
// RUN: grep '__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' %t | grep '1050' | count 1
-// RUN: %clang -ccc-host-triple armv6-apple-darwin9 -miphoneos-version-min=3.0 -dM -E -o %t %s
+// RUN: %clang -target armv6-apple-darwin9 -miphoneos-version-min=3.0 -dM -E -o %t %s
// RUN: grep '__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__' %t | grep '30000' | count 1
// RUN: grep '__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' %t | count 0
-// RUN: %clang -ccc-host-triple armv6-apple-darwin9 -miphoneos-version-min=2.0 -dM -E -o %t %s
+// RUN: %clang -target armv6-apple-darwin9 -miphoneos-version-min=2.0 -dM -E -o %t %s
// RUN: grep '__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__' %t | grep '20000' | count 1
// RUN: grep '__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' %t | count 0
-// RUN: %clang -ccc-host-triple armv6-apple-darwin9 -miphoneos-version-min=2.2 -dM -E -o %t %s
+// RUN: %clang -target armv6-apple-darwin9 -miphoneos-version-min=2.2 -dM -E -o %t %s
// RUN: grep '__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__' %t | grep '20200' | count 1
-// RUN: %clang -ccc-host-triple i686-apple-darwin8 -dM -E -o %t %s
+// RUN: %clang -target i686-apple-darwin8 -dM -E -o %t %s
// RUN: grep '__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__' %t | count 0
// RUN: grep '__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' %t | grep '1040' | count 1
-// RUN: %clang -ccc-host-triple i686-apple-darwin9 -dM -E -o %t %s
+// RUN: %clang -target i686-apple-darwin9 -dM -E -o %t %s
// RUN: grep '__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' %t | grep '1050' | count 1
-// RUN: %clang -ccc-host-triple i686-apple-darwin10 -dM -E -o %t %s
+// RUN: %clang -target i686-apple-darwin10 -dM -E -o %t %s
// RUN: grep '__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' %t | grep '1060' | count 1
-// RUN: %clang -ccc-host-triple i686-apple-darwin9 -mmacosx-version-min=10.4 -dM -E -o %t %s
+// RUN: %clang -target i686-apple-darwin9 -mmacosx-version-min=10.4 -dM -E -o %t %s
// RUN: grep '__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__' %t | count 0
// RUN: grep '__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' %t | grep '1040' | count 1
-// RUN: %clang -ccc-host-triple i686-apple-darwin9 -mmacosx-version-min=10.5 -dM -E -o %t %s
+// RUN: %clang -target i686-apple-darwin9 -mmacosx-version-min=10.5 -dM -E -o %t %s
// RUN: grep '__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' %t | grep '1050' | count 1
-// RUN: %clang -ccc-host-triple i686-apple-darwin9 -mmacosx-version-min=10.6 -dM -E -o %t %s
+// RUN: %clang -target i686-apple-darwin9 -mmacosx-version-min=10.6 -dM -E -o %t %s
// RUN: grep '__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' %t | grep '1060' | count 1
Modified: cfe/branches/tooling/test/Headers/c89.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Headers/c89.c?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Headers/c89.c (original)
+++ cfe/branches/tooling/test/Headers/c89.c Mon Jan 23 02:39:37 2012
@@ -1,4 +1,4 @@
-// RUN: %clang -ccc-host-triple i386-apple-darwin10 -fsyntax-only -Xclang -verify -std=c89 %s
+// RUN: %clang -target i386-apple-darwin10 -fsyntax-only -Xclang -verify -std=c89 %s
// FIXME: Disable inclusion of mm_malloc.h, our current implementation is broken
// on win32 since we don't generally know how to find errno.h.
Modified: cfe/branches/tooling/test/Index/annotate-tokens.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Index/annotate-tokens.m?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Index/annotate-tokens.m (original)
+++ cfe/branches/tooling/test/Index/annotate-tokens.m Mon Jan 23 02:39:37 2012
@@ -567,7 +567,7 @@
// CHECK-PROP-AFTER-METHOD: Punctuation: ";" [137:39 - 137:40] ObjCInterfaceDecl=Rdar8062781:134:12
// CHECK-PROP-AFTER-METHOD: Punctuation: "@" [138:1 - 138:2] ObjCInterfaceDecl=Rdar8062781:134:12
-// RUN: c-index-test -test-annotate-tokens=%s:141:1:142:1 %s -DIBOutlet='__attribute__((iboutlet))' -DIBAction='void)__attribute__((ibaction)' -ccc-host-triple x86_64-apple-macosx10.7.0 | FileCheck -check-prefix=CHECK-WITH-WEAK %s
+// RUN: c-index-test -test-annotate-tokens=%s:141:1:142:1 %s -DIBOutlet='__attribute__((iboutlet))' -DIBAction='void)__attribute__((ibaction)' -target x86_64-apple-macosx10.7.0 | FileCheck -check-prefix=CHECK-WITH-WEAK %s
// CHECK-WITH-WEAK: Identifier: "__weak" [141:3 - 141:9] macro expansion
// CHECK-WITH-WEAK: Identifier: "Foo" [141:10 - 141:13] ObjCClassRef=Foo:1:12
// CHECK-WITH-WEAK: Punctuation: "*" [141:14 - 141:15] ObjCIvarDecl=foo:141:15 (Definition)
Modified: cfe/branches/tooling/test/Index/complete-macros.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Index/complete-macros.c?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Index/complete-macros.c (original)
+++ cfe/branches/tooling/test/Index/complete-macros.c Mon Jan 23 02:39:37 2012
@@ -19,6 +19,7 @@
#define variadic2(args...)
#define variadic3(args, ...)
#define variadic4(first, second, args, ...)
+#define variadic5(first, second, args ...)
void test_variadic() {
@@ -34,8 +35,9 @@
// RUN: c-index-test -code-completion-at=%s:15:5 %s | FileCheck -check-prefix=CHECK-CC3 %s
// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:15:5 %s | FileCheck -check-prefix=CHECK-CC3 %s
// CHECK-CC3: macro definition:{TypedText nil} (65)
-// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:24:2 %s | FileCheck -check-prefix=CHECK-VARIADIC %s
+// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:25:2 %s | FileCheck -check-prefix=CHECK-VARIADIC %s
// CHECK-VARIADIC: macro definition:{TypedText variadic1}{LeftParen (}{Placeholder ...}{RightParen )} (70)
// CHECK-VARIADIC: macro definition:{TypedText variadic2}{LeftParen (}{Placeholder args...}{RightParen )} (70)
// CHECK-VARIADIC: macro definition:{TypedText variadic3}{LeftParen (}{Placeholder args, ...}{RightParen )} (70)
-// CHECK-VARIADIC: macro definition:{TypedText variadic4}{LeftParen (}{Placeholder first}{Comma , }{Placeholder second...}{Placeholder first, second...}{RightParen )} (70)
+// CHECK-VARIADIC: macro definition:{TypedText variadic4}{LeftParen (}{Placeholder first}{Comma , }{Placeholder second}{Comma , }{Placeholder args, ...}{RightParen )} (70)
+// CHECK-VARIADIC: macro definition:{TypedText variadic5}{LeftParen (}{Placeholder first}{Comma , }{Placeholder second}{Comma , }{Placeholder args...}{RightParen )} (70)
Modified: cfe/branches/tooling/test/Index/get-cursor.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Index/get-cursor.m?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Index/get-cursor.m (original)
+++ cfe/branches/tooling/test/Index/get-cursor.m Mon Jan 23 02:39:37 2012
@@ -30,7 +30,7 @@
// CHECK-PROP: ObjCPropertyDecl=foo1:4:26
// CHECK-PROP: ObjCPropertyDecl=foo2:5:27
-// RUN: c-index-test -cursor-at=%s:11:11 %s -ccc-host-triple x86_64-apple-macosx10.7.0 | FileCheck -check-prefix=CHECK-WITH-WEAK %s
+// RUN: c-index-test -cursor-at=%s:11:11 %s -target x86_64-apple-macosx10.7.0 | FileCheck -check-prefix=CHECK-WITH-WEAK %s
// CHECK-WITH-WEAK: ObjCClassRef=Foo:8:8
// RUN: c-index-test -cursor-at=%s:20:10 %s | FileCheck -check-prefix=CHECK-METHOD %s
Modified: cfe/branches/tooling/test/Index/invalid-rdar-8236270.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Index/invalid-rdar-8236270.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Index/invalid-rdar-8236270.cpp (original)
+++ cfe/branches/tooling/test/Index/invalid-rdar-8236270.cpp Mon Jan 23 02:39:37 2012
@@ -1,4 +1,4 @@
-// RUN: c-index-test -test-load-source all %s 2>&1 | FileCheck %s
+// RUN: c-index-test -test-load-source all %s | FileCheck %s
// This test case previously just crashed the frontend.
Modified: cfe/branches/tooling/test/Index/retain-target-options.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Index/retain-target-options.c?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Index/retain-target-options.c (original)
+++ cfe/branches/tooling/test/Index/retain-target-options.c Mon Jan 23 02:39:37 2012
@@ -1,6 +1,6 @@
-// RUN: c-index-test -test-load-source all -ccc-host-triple x86_64-apple-darwin10.0.0 -msse4.1 %s 2>&1 | FileCheck %s
-// RUN: c-index-test -test-load-source-reparse 1 all -ccc-host-triple x86_64-apple-darwin10.0.0 -msse4.1 %s 2>&1 | FileCheck %s
-// RUN: c-index-test -test-load-source-reparse 5 all -ccc-host-triple x86_64-apple-darwin10.0.0 -msse4.1 %s 2>&1 | FileCheck %s
+// RUN: c-index-test -test-load-source all -target x86_64-apple-darwin10.0.0 -msse4.1 %s 2>&1 | FileCheck %s
+// RUN: c-index-test -test-load-source-reparse 1 all -target x86_64-apple-darwin10.0.0 -msse4.1 %s 2>&1 | FileCheck %s
+// RUN: c-index-test -test-load-source-reparse 5 all -target x86_64-apple-darwin10.0.0 -msse4.1 %s 2>&1 | FileCheck %s
// CHECK: error: #error SSE4_1 used
#if defined(__SSE4_1__)
Modified: cfe/branches/tooling/test/Index/usrs.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Index/usrs.m?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Index/usrs.m (original)
+++ cfe/branches/tooling/test/Index/usrs.m Mon Jan 23 02:39:37 2012
@@ -88,7 +88,7 @@
@property (assign) id pro_ext;
@end
-// RUN: c-index-test -test-load-source-usrs all -ccc-host-triple x86_64-apple-macosx10.7 %s | FileCheck %s
+// RUN: c-index-test -test-load-source-usrs all -target x86_64-apple-macosx10.7 %s | FileCheck %s
// CHECK: usrs.m c:usrs.m at 67@F at my_helper Extent=[3:1 - 3:60]
// CHECK: usrs.m c:usrs.m at 95@F at my_helper@x Extent=[3:29 - 3:34]
// CHECK: usrs.m c:usrs.m at 102@F at my_helper@y Extent=[3:36 - 3:41]
Modified: cfe/branches/tooling/test/Misc/diag-format.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Misc/diag-format.c?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Misc/diag-format.c (original)
+++ cfe/branches/tooling/test/Misc/diag-format.c Mon Jan 23 02:39:37 2012
@@ -1,10 +1,10 @@
// RUN: %clang -fsyntax-only %s 2>&1 | FileCheck %s -check-prefix=DEFAULT
// RUN: %clang -fsyntax-only -fdiagnostics-format=clang %s 2>&1 | FileCheck %s -check-prefix=DEFAULT
-// RUN: %clang -fsyntax-only -fdiagnostics-format=clang -ccc-host-triple x86_64-pc-win32 %s 2>&1 | FileCheck %s -check-prefix=DEFAULT
+// RUN: %clang -fsyntax-only -fdiagnostics-format=clang -target x86_64-pc-win32 %s 2>&1 | FileCheck %s -check-prefix=DEFAULT
//
// RUN: %clang -fsyntax-only -fdiagnostics-format=msvc %s 2>&1 | FileCheck %s -check-prefix=MSVC
-// RUN: %clang -fsyntax-only -fdiagnostics-format=msvc -ccc-host-triple x86_64-pc-win32 %s 2>&1 | FileCheck %s -check-prefix=MSVC
-// RUN: %clang -fsyntax-only -fdiagnostics-format=msvc -ccc-host-triple x86_64-pc-win32 -fshow-column %s 2>&1 | FileCheck %s -check-prefix=MSVC
+// RUN: %clang -fsyntax-only -fdiagnostics-format=msvc -target x86_64-pc-win32 %s 2>&1 | FileCheck %s -check-prefix=MSVC
+// RUN: %clang -fsyntax-only -fdiagnostics-format=msvc -target x86_64-pc-win32 -fshow-column %s 2>&1 | FileCheck %s -check-prefix=MSVC
//
// RUN: %clang -fsyntax-only -fdiagnostics-format=vi %s 2>&1 | FileCheck %s -check-prefix=VI
//
Modified: cfe/branches/tooling/test/PCH/reloc.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/PCH/reloc.c?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/PCH/reloc.c (original)
+++ cfe/branches/tooling/test/PCH/reloc.c Mon Jan 23 02:39:37 2012
@@ -1,8 +1,8 @@
-// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 --relocatable-pch -o %t \
+// RUN: %clang -target x86_64-apple-darwin10 --relocatable-pch -o %t \
// RUN: -isysroot %S/libroot %S/libroot/usr/include/reloc.h
-// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -fsyntax-only \
+// RUN: %clang -target x86_64-apple-darwin10 -fsyntax-only \
// RUN: -include-pch %t -isysroot %S/libroot %s -Xclang -verify
-// RUN: not %clang -ccc-host-triple x86_64-apple-darwin10 -include-pch %t %s
+// RUN: not %clang -target x86_64-apple-darwin10 -include-pch %t %s
#include <reloc.h>
Modified: cfe/branches/tooling/test/Parser/cxx-class.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Parser/cxx-class.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Parser/cxx-class.cpp (original)
+++ cfe/branches/tooling/test/Parser/cxx-class.cpp Mon Jan 23 02:39:37 2012
@@ -54,6 +54,13 @@
int i;
};
+class F {
+ int F1 { return 1; } // expected-error{{function definition does not declare parameters}}
+ void F2 {} // expected-error{{function definition does not declare parameters}}
+ typedef int F3() { return 0; } // expected-error{{function definition declared 'typedef'}}
+ typedef void F4() {} // expected-error{{function definition declared 'typedef'}}
+};
+
// PR11109 must appear at the end of the source file
class pr11109r3 { // expected-note{{to match this '{'}}
public // expected-error{{expected ':'}} expected-error{{expected '}'}} expected-error{{expected ';' after class}}
Modified: cfe/branches/tooling/test/Preprocessor/pic.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Preprocessor/pic.c?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Preprocessor/pic.c (original)
+++ cfe/branches/tooling/test/Preprocessor/pic.c Mon Jan 23 02:39:37 2012
@@ -1,9 +1,9 @@
-// RUN: %clang -ccc-host-triple i386-unknown-unknown -static -dM -E -o %t %s
+// RUN: %clang -target i386-unknown-unknown -static -dM -E -o %t %s
// RUN: grep '#define __PIC__' %t | count 0
// RUN: grep '#define __pic__' %t | count 0
-// RUN: %clang -ccc-host-triple i386-unknown-unknown -fpic -dM -E -o %t %s
+// RUN: %clang -target i386-unknown-unknown -fpic -dM -E -o %t %s
// RUN: grep '#define __PIC__ 1' %t | count 1
// RUN: grep '#define __pic__ 1' %t | count 1
-// RUN: %clang -ccc-host-triple i386-unknown-unknown -fPIC -dM -E -o %t %s
+// RUN: %clang -target i386-unknown-unknown -fPIC -dM -E -o %t %s
// RUN: grep '#define __PIC__ 2' %t | count 1
// RUN: grep '#define __pic__ 2' %t | count 1
Modified: cfe/branches/tooling/test/Preprocessor/x86_target_features.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Preprocessor/x86_target_features.c?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Preprocessor/x86_target_features.c (original)
+++ cfe/branches/tooling/test/Preprocessor/x86_target_features.c Mon Jan 23 02:39:37 2012
@@ -1,6 +1,4 @@
-// FIXME: Use -triple, not -ccc-host-triple.
-
-// RUN: %clang -ccc-host-triple i386-unknown-unknown -march=core2 -msse4 -x c -E -dM -o %t %s
+// RUN: %clang -target i386-unknown-unknown -march=core2 -msse4 -x c -E -dM -o %t %s
// RUN: grep '#define __SSE2_MATH__ 1' %t
// RUN: grep '#define __SSE2__ 1' %t
// RUN: grep '#define __SSE3__ 1' %t
@@ -10,7 +8,7 @@
// RUN: grep '#define __SSE__ 1' %t
// RUN: grep '#define __SSSE3__ 1' %t
-// RUN: %clang -ccc-host-triple i386-unknown-unknown -march=core2 -msse4 -mno-sse2 -x c -E -dM -o %t %s
+// RUN: %clang -target i386-unknown-unknown -march=core2 -msse4 -mno-sse2 -x c -E -dM -o %t %s
// RUN: grep '#define __SSE2_MATH__ 1' %t | count 0
// RUN: grep '#define __SSE2__ 1' %t | count 0
// RUN: grep '#define __SSE3__ 1' %t | count 0
@@ -20,7 +18,7 @@
// RUN: grep '#define __SSE__ 1' %t
// RUN: grep '#define __SSSE3__ 1' %t | count 0
-// RUN: %clang -ccc-host-triple i386-unknown-unknown -march=pentium-m -x c -E -dM -o %t %s
+// RUN: %clang -target i386-unknown-unknown -march=pentium-m -x c -E -dM -o %t %s
// RUN: grep '#define __SSE2_MATH__ 1' %t
// RUN: grep '#define __SSE2__ 1' %t
// RUN: grep '#define __SSE3__ 1' %t | count 0
Modified: cfe/branches/tooling/test/Sema/block-printf-attribute-1.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Sema/block-printf-attribute-1.c?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Sema/block-printf-attribute-1.c (original)
+++ cfe/branches/tooling/test/Sema/block-printf-attribute-1.c Mon Jan 23 02:39:37 2012
@@ -6,6 +6,6 @@
void (^z) (int arg, const char * format, ...) __attribute__ ((__format__ (__printf__, 2, 3))) = ^ __attribute__ ((__format__ (__printf__, 2, 3))) (int arg, const char * format, ...) {};
- z(1, "%s", 1); // expected-warning{{conversion specifies type 'char *' but the argument has type 'int'}}
+ z(1, "%s", 1); // expected-warning{{format specifies type 'char *' but the argument has type 'int'}}
z(1, "%s", "HELLO"); // no-warning
}
Modified: cfe/branches/tooling/test/Sema/format-strings-c90.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Sema/format-strings-c90.c?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Sema/format-strings-c90.c (original)
+++ cfe/branches/tooling/test/Sema/format-strings-c90.c Mon Jan 23 02:39:37 2012
@@ -21,7 +21,7 @@
scanf("%da", ip);
/* Test argument type check for the 'a' length modifier. */
- scanf("%as", fp); /* expected-warning{{conversion specifies type 'char **' but the argument has type 'float *'}} */
- scanf("%aS", fp); /* expected-warning{{conversion specifies type 'wchar_t **' (aka 'int **') but the argument has type 'float *'}} */
- scanf("%a[abc]", fp); /* expected-warning{{conversion specifies type 'char **' but the argument has type 'float *'}} */
+ scanf("%as", fp); /* expected-warning{{format specifies type 'char **' but the argument has type 'float *'}} */
+ scanf("%aS", fp); /* expected-warning{{format specifies type 'wchar_t **' (aka 'int **') but the argument has type 'float *'}} */
+ scanf("%a[abc]", fp); /* expected-warning{{format specifies type 'char **' but the argument has type 'float *'}} */
}
Modified: cfe/branches/tooling/test/Sema/format-strings-int-typedefs.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Sema/format-strings-int-typedefs.c?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Sema/format-strings-int-typedefs.c (original)
+++ cfe/branches/tooling/test/Sema/format-strings-int-typedefs.c Mon Jan 23 02:39:37 2012
@@ -4,23 +4,23 @@
int scanf(char const *, ...);
void test(void) {
- printf("%jd", 42.0); // expected-warning {{conversion specifies type 'intmax_t' (aka 'long long')}}
- printf("%ju", 42.0); // expected-warning {{conversion specifies type 'uintmax_t' (aka 'unsigned long long')}}
- printf("%zu", 42.0); // expected-warning {{conversion specifies type 'size_t' (aka 'unsigned long')}}
- printf("%td", 42.0); // expected-warning {{conversion specifies type 'ptrdiff_t' (aka 'int')}}
- printf("%lc", 42.0); // expected-warning {{conversion specifies type 'wint_t' (aka 'int')}}
- printf("%ls", 42.0); // expected-warning {{conversion specifies type 'wchar_t *' (aka 'int *')}}
- printf("%S", 42.0); // expected-warning {{conversion specifies type 'wchar_t *' (aka 'int *')}}
- printf("%C", 42.0); // expected-warning {{conversion specifies type 'wchar_t' (aka 'int')}}
+ printf("%jd", 42.0); // expected-warning {{format specifies type 'intmax_t' (aka 'long long')}}
+ printf("%ju", 42.0); // expected-warning {{format specifies type 'uintmax_t' (aka 'unsigned long long')}}
+ printf("%zu", 42.0); // expected-warning {{format specifies type 'size_t' (aka 'unsigned long')}}
+ printf("%td", 42.0); // expected-warning {{format specifies type 'ptrdiff_t' (aka 'int')}}
+ printf("%lc", 42.0); // expected-warning {{format specifies type 'wint_t' (aka 'int')}}
+ printf("%ls", 42.0); // expected-warning {{format specifies type 'wchar_t *' (aka 'int *')}}
+ printf("%S", 42.0); // expected-warning {{format specifies type 'wchar_t *' (aka 'int *')}}
+ printf("%C", 42.0); // expected-warning {{format specifies type 'wchar_t' (aka 'int')}}
- scanf("%jd", 0); // expected-warning {{conversion specifies type 'intmax_t *' (aka 'long long *')}}
- scanf("%ju", 0); // expected-warning {{conversion specifies type 'uintmax_t *' (aka 'unsigned long long *')}}
- scanf("%zu", 0); // expected-warning {{conversion specifies type 'size_t *' (aka 'unsigned long *')}}
- scanf("%td", 0); // expected-warning {{conversion specifies type 'ptrdiff_t *' (aka 'int *')}}
- scanf("%lc", 0); // expected-warning {{conversion specifies type 'wchar_t *' (aka 'int *')}}
- scanf("%ls", 0); // expected-warning {{conversion specifies type 'wchar_t *' (aka 'int *')}}
- scanf("%S", 0); // expected-warning {{conversion specifies type 'wchar_t *' (aka 'int *')}}
- scanf("%C", 0); // expected-warning {{conversion specifies type 'wchar_t *' (aka 'int *')}}
+ scanf("%jd", 0); // expected-warning {{format specifies type 'intmax_t *' (aka 'long long *')}}
+ scanf("%ju", 0); // expected-warning {{format specifies type 'uintmax_t *' (aka 'unsigned long long *')}}
+ scanf("%zu", 0); // expected-warning {{format specifies type 'size_t *' (aka 'unsigned long *')}}
+ scanf("%td", 0); // expected-warning {{format specifies type 'ptrdiff_t *' (aka 'int *')}}
+ scanf("%lc", 0); // expected-warning {{format specifies type 'wchar_t *' (aka 'int *')}}
+ scanf("%ls", 0); // expected-warning {{format specifies type 'wchar_t *' (aka 'int *')}}
+ scanf("%S", 0); // expected-warning {{format specifies type 'wchar_t *' (aka 'int *')}}
+ scanf("%C", 0); // expected-warning {{format specifies type 'wchar_t *' (aka 'int *')}}
// typedef size_t et al. to something crazy.
@@ -30,8 +30,8 @@
typedef void *ptrdiff_t;
// The warning still fires, because it checks the underlying type.
- printf("%jd", (intmax_t)42); // expected-warning {{conversion specifies type 'intmax_t' (aka 'long long') but the argument has type 'intmax_t' (aka 'void *')}}
- printf("%ju", (uintmax_t)42); // expected-warning {{conversion specifies type 'uintmax_t' (aka 'unsigned long long') but the argument has type 'uintmax_t' (aka 'void *')}}
- printf("%zu", (size_t)42); // expected-warning {{conversion specifies type 'size_t' (aka 'unsigned long') but the argument has type 'size_t' (aka 'void *')}}
- printf("%td", (ptrdiff_t)42); // expected-warning {{conversion specifies type 'ptrdiff_t' (aka 'int') but the argument has type 'ptrdiff_t' (aka 'void *')}}
+ printf("%jd", (intmax_t)42); // expected-warning {{format specifies type 'intmax_t' (aka 'long long') but the argument has type 'intmax_t' (aka 'void *')}}
+ printf("%ju", (uintmax_t)42); // expected-warning {{format specifies type 'uintmax_t' (aka 'unsigned long long') but the argument has type 'uintmax_t' (aka 'void *')}}
+ printf("%zu", (size_t)42); // expected-warning {{format specifies type 'size_t' (aka 'unsigned long') but the argument has type 'size_t' (aka 'void *')}}
+ printf("%td", (ptrdiff_t)42); // expected-warning {{format specifies type 'ptrdiff_t' (aka 'int') but the argument has type 'ptrdiff_t' (aka 'void *')}}
}
Modified: cfe/branches/tooling/test/Sema/format-strings-scanf.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Sema/format-strings-scanf.c?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Sema/format-strings-scanf.c (original)
+++ cfe/branches/tooling/test/Sema/format-strings-scanf.c Mon Jan 23 02:39:37 2012
@@ -59,9 +59,9 @@
FILE *f = 0;
char buf[100];
- fscanf(f, "%ld", i); // expected-warning{{conversion specifies type 'long *' but the argument has type 'int *'}}
- sscanf(buf, "%ld", i); // expected-warning{{conversion specifies type 'long *' but the argument has type 'int *'}}
- my_scanf("%ld", i); // expected-warning{{conversion specifies type 'long *' but the argument has type 'int *'}}
+ fscanf(f, "%ld", i); // expected-warning{{format specifies type 'long *' but the argument has type 'int *'}}
+ sscanf(buf, "%ld", i); // expected-warning{{format specifies type 'long *' but the argument has type 'int *'}}
+ my_scanf("%ld", i); // expected-warning{{format specifies type 'long *' but the argument has type 'int *'}}
va_list ap;
va_start(ap, s);
@@ -71,18 +71,20 @@
vsscanf(buf, "%[abc", ap); // expected-warning{{no closing ']' for '%[' in scanf format string}}
}
-void test_scanlist(int *ip, char *sp) {
- scanf("%[abc]", ip); // expected-warning{{conversion specifies type 'char *' but the argument has type 'int *'}}
+void test_scanlist(int *ip, char *sp, wchar_t *ls) {
+ scanf("%[abc]", ip); // expected-warning{{format specifies type 'char *' but the argument has type 'int *'}}
scanf("%h[abc]", sp); // expected-warning{{length modifier 'h' results in undefined behavior or no effect with '[' conversion specifier}}
+ scanf("%l[xyx]", ls); // no-warning
+ scanf("%ll[xyx]", ls); // expected-warning {{length modifier 'll' results in undefined behavior or no effect with '[' conversion specifier}}
}
void test_alloc_extension(char **sp, wchar_t **lsp, float *fp) {
/* Make sure "%a" gets parsed as a conversion specifier for float,
* even when followed by an 's', 'S' or '[', which would cause it to be
* parsed as a length modifier in C90. */
- scanf("%as", sp); // expected-warning{{conversion specifies type 'float *' but the argument has type 'char **'}}
- scanf("%aS", lsp); // expected-warning{{conversion specifies type 'float *' but the argument has type 'wchar_t **'}}
- scanf("%a[bcd]", sp); // expected-warning{{conversion specifies type 'float *' but the argument has type 'char **'}}
+ scanf("%as", sp); // expected-warning{{format specifies type 'float *' but the argument has type 'char **'}}
+ scanf("%aS", lsp); // expected-warning{{format specifies type 'float *' but the argument has type 'wchar_t **'}}
+ scanf("%a[bcd]", sp); // expected-warning{{format specifies type 'float *' but the argument has type 'char **'}}
// Test that the 'm' length modifier is only allowed with s, S, c, C or [.
// TODO: Warn that 'm' is an extension.
@@ -94,9 +96,10 @@
scanf("%md", sp); // expected-warning{{length modifier 'm' results in undefined behavior or no effect with 'd' conversion specifier}}
// Test argument type check for the 'm' length modifier.
- scanf("%ms", fp); // expected-warning{{conversion specifies type 'char **' but the argument has type 'float *'}}
- scanf("%mS", fp); // expected-warning{{conversion specifies type 'wchar_t **' (aka 'int **') but the argument has type 'float *'}}
- scanf("%mc", fp); // expected-warning{{conversion specifies type 'char **' but the argument has type 'float *'}}
- scanf("%mC", fp); // expected-warning{{conversion specifies type 'wchar_t **' (aka 'int **') but the argument has type 'float *'}}
- scanf("%m[abc]", fp); // expected-warning{{conversion specifies type 'char **' but the argument has type 'float *'}}
+ scanf("%ms", fp); // expected-warning{{format specifies type 'char **' but the argument has type 'float *'}}
+ scanf("%mS", fp); // expected-warning{{format specifies type 'wchar_t **' (aka 'int **') but the argument has type 'float *'}}
+ scanf("%mc", fp); // expected-warning{{format specifies type 'char **' but the argument has type 'float *'}}
+ scanf("%mC", fp); // expected-warning{{format specifies type 'wchar_t **' (aka 'int **') but the argument has type 'float *'}}
+ scanf("%m[abc]", fp); // expected-warning{{format specifies type 'char **' but the argument has type 'float *'}}
}
+
Modified: cfe/branches/tooling/test/Sema/format-strings-size_t.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Sema/format-strings-size_t.c?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Sema/format-strings-size_t.c (original)
+++ cfe/branches/tooling/test/Sema/format-strings-size_t.c Mon Jan 23 02:39:37 2012
@@ -4,12 +4,12 @@
void test(void) {
// size_t
- printf("%zu", (double)42); // expected-warning {{conversion specifies type 'size_t' (aka 'unsigned long') but the argument has type 'double'}}
+ printf("%zu", (double)42); // expected-warning {{format specifies type 'size_t' (aka 'unsigned long') but the argument has type 'double'}}
// intmax_t / uintmax_t
- printf("%jd", (double)42); // expected-warning {{conversion specifies type 'intmax_t' (aka 'long') but the argument has type 'double'}}
- printf("%ju", (double)42); // expected-warning {{conversion specifies type 'uintmax_t' (aka 'unsigned long') but the argument has type 'double'}}
+ printf("%jd", (double)42); // expected-warning {{format specifies type 'intmax_t' (aka 'long') but the argument has type 'double'}}
+ printf("%ju", (double)42); // expected-warning {{format specifies type 'uintmax_t' (aka 'unsigned long') but the argument has type 'double'}}
// ptrdiff_t
- printf("%td", (double)42); // expected-warning {{conversion specifies type 'ptrdiff_t' (aka 'long') but the argument has type 'double'}}
+ printf("%td", (double)42); // expected-warning {{format specifies type 'ptrdiff_t' (aka 'long') but the argument has type 'double'}}
}
Modified: cfe/branches/tooling/test/Sema/format-strings.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Sema/format-strings.c?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Sema/format-strings.c (original)
+++ cfe/branches/tooling/test/Sema/format-strings.c Mon Jan 23 02:39:37 2012
@@ -71,8 +71,8 @@
{
printf("%s%lb%d","unix",10,20); // expected-warning {{invalid conversion specifier 'b'}}
fprintf(fp,"%%%l"); // expected-warning {{incomplete format specifier}}
- sprintf(buf,"%%%%%ld%d%d", 1, 2, 3); // expected-warning{{conversion specifies type 'long' but the argument has type 'int'}}
- snprintf(buf, 2, "%%%%%ld%;%d", 1, 2, 3); // expected-warning{{conversion specifies type 'long' but the argument has type 'int'}} expected-warning {{invalid conversion specifier ';'}}
+ sprintf(buf,"%%%%%ld%d%d", 1, 2, 3); // expected-warning{{format specifies type 'long' but the argument has type 'int'}}
+ snprintf(buf, 2, "%%%%%ld%;%d", 1, 2, 3); // expected-warning{{format specifies type 'long' but the argument has type 'int'}} expected-warning {{invalid conversion specifier ';'}}
}
void check_null_char_string(char* b)
@@ -166,33 +166,33 @@
printf("%"); // expected-warning{{incomplete format specifier}}
printf("%.d", x); // no-warning
printf("%.", x); // expected-warning{{incomplete format specifier}}
- printf("%f", 4); // expected-warning{{conversion specifies type 'double' but the argument has type 'int'}}
+ printf("%f", 4); // expected-warning{{format specifies type 'double' but the argument has type 'int'}}
printf("%qd", lli);
printf("hhX %hhX", (unsigned char)10); // no-warning
printf("llX %llX", (long long) 10); // no-warning
// This is fine, because there is an implicit conversion to an int.
printf("%d", (unsigned char) 10); // no-warning
- printf("%d", (long long) 10); // expected-warning{{conversion specifies type 'int' but the argument has type 'long long'}}
+ printf("%d", (long long) 10); // expected-warning{{format specifies type 'int' but the argument has type 'long long'}}
printf("%Lf\n", (long double) 1.0); // no-warning
- printf("%f\n", (long double) 1.0); // expected-warning{{conversion specifies type 'double' but the argument has type 'long double'}}
+ printf("%f\n", (long double) 1.0); // expected-warning{{format specifies type 'double' but the argument has type 'long double'}}
// The man page says that a zero precision is okay.
printf("%.0Lf", (long double) 1.0); // no-warning
- printf("%c\n", "x"); // expected-warning{{conversion specifies type 'int' but the argument has type 'char *'}}
- printf("%c\n", 1.23); // expected-warning{{conversion specifies type 'int' but the argument has type 'double'}}
+ printf("%c\n", "x"); // expected-warning{{format specifies type 'int' but the argument has type 'char *'}}
+ printf("%c\n", 1.23); // expected-warning{{format specifies type 'int' but the argument has type 'double'}}
printf("Format %d, is %! %f", 1, 2, 4.4); // expected-warning{{invalid conversion specifier '!'}}
}
typedef unsigned char uint8_t;
void should_understand_small_integers() {
- printf("%hhu", (short) 10); // expected-warning{{conversion specifies type 'unsigned char' but the argument has type 'short'}}
- printf("%hu\n", (unsigned char) 1); // expected-warning{{conversion specifies type 'unsigned short' but the argument has type 'unsigned char'}}
- printf("%hu\n", (uint8_t)1); // expected-warning{{conversion specifies type 'unsigned short' but the argument has type 'uint8_t'}}
+ printf("%hhu", (short) 10); // expected-warning{{format specifies type 'unsigned char' but the argument has type 'short'}}
+ printf("%hu\n", (unsigned char) 1); // expected-warning{{format specifies type 'unsigned short' but the argument has type 'unsigned char'}}
+ printf("%hu\n", (uint8_t)1); // expected-warning{{format specifies type 'unsigned short' but the argument has type 'uint8_t'}}
}
void test11(void *p, char *s) {
printf("%p", p); // no-warning
- printf("%p", 123); // expected-warning{{conversion specifies type 'void *' but the argument has type 'int'}}
+ printf("%p", 123); // expected-warning{{format specifies type 'void *' but the argument has type 'int'}}
printf("%.4p", p); // expected-warning{{precision used with 'p' conversion specifier, resulting in undefined behavior}}
printf("%+p", p); // expected-warning{{flag '+' results in undefined behavior with 'p' conversion specifier}}
printf("% p", p); // expected-warning{{flag ' ' results in undefined behavior with 'p' conversion specifier}}
@@ -206,16 +206,16 @@
void test12(char *b) {
unsigned char buf[4];
printf ("%.4s\n", buf); // no-warning
- printf ("%.4s\n", &buf); // expected-warning{{conversion specifies type 'char *' but the argument has type 'unsigned char (*)[4]'}}
+ printf ("%.4s\n", &buf); // expected-warning{{format specifies type 'char *' but the argument has type 'unsigned char (*)[4]'}}
// Verify that we are checking asprintf
- asprintf(&b, "%d", "asprintf"); // expected-warning{{conversion specifies type 'int' but the argument has type 'char *'}}
+ asprintf(&b, "%d", "asprintf"); // expected-warning{{format specifies type 'int' but the argument has type 'char *'}}
}
void test13(short x) {
char bel = 007;
printf("bel: '0%hhd'\n", bel); // no-warning
- printf("x: '0%hhd'\n", x); // expected-warning {{conversion specifies type 'char' but the argument has type 'short'}}
+ printf("x: '0%hhd'\n", x); // expected-warning {{format specifies type 'char' but the argument has type 'short'}}
}
typedef struct __aslclient *aslclient;
@@ -237,7 +237,7 @@
void test_unicode_conversions(wchar_t *s) {
printf("%S", s); // no-warning
- printf("%s", s); // expected-warning{{conversion specifies type 'char *' but the argument has type 'wchar_t *'}}
+ printf("%s", s); // expected-warning{{format specifies type 'char *' but the argument has type 'wchar_t *'}}
printf("%C", s[0]); // no-warning
printf("%c", s[0]);
// FIXME: This test reports inconsistent results. On Windows, '%C' expects
@@ -255,7 +255,7 @@
printf("%1$*0$d", (int) 2); // expected-warning{{position arguments in format strings start counting at 1 (not 0)}}
printf("%1$d", (int) 2); // no-warning
printf("%1$d", (int) 2, 2); // expected-warning{{data argument not used by format string}}
- printf("%1$d%1$f", (int) 2); // expected-warning{{conversion specifies type 'double' but the argument has type 'int'}}
+ printf("%1$d%1$f", (int) 2); // expected-warning{{format specifies type 'double' but the argument has type 'int'}}
printf("%1$2.2d", (int) 2); // no-warning
printf("%2$*1$.2d", (int) 2, (int) 3); // no-warning
printf("%2$*8$d", (int) 2, (int) 3); // expected-warning{{specified field width is missing a matching 'int' argument}}
@@ -267,13 +267,13 @@
void myprintf_PR_6697(const char *format, int x, ...) __attribute__((__format__(printf,1, 3)));
void test_pr_6697() {
myprintf_PR_6697("%s\n", 1, "foo"); // no-warning
- myprintf_PR_6697("%s\n", 1, (int)0); // expected-warning{{conversion specifies type 'char *' but the argument has type 'int'}}
+ myprintf_PR_6697("%s\n", 1, (int)0); // expected-warning{{format specifies type 'char *' but the argument has type 'int'}}
// FIXME: Not everything should clearly support positional arguments,
// but we need a way to identify those cases.
myprintf_PR_6697("%1$s\n", 1, "foo"); // no-warning
myprintf_PR_6697("%2$s\n", 1, "foo"); // expected-warning{{data argument position '2' exceeds the number of data arguments (1)}}
myprintf_PR_6697("%18$s\n", 1, "foo"); // expected-warning{{data argument position '18' exceeds the number of data arguments (1)}}
- myprintf_PR_6697("%1$s\n", 1, (int) 0); // expected-warning{{conversion specifies type 'char *' but the argument has type 'int'}}
+ myprintf_PR_6697("%1$s\n", 1, (int) 0); // expected-warning{{format specifies type 'char *' but the argument has type 'int'}}
}
void rdar8026030(FILE *fp) {
@@ -359,7 +359,7 @@
#pragma GCC diagnostic ignored "-Wformat-security"
void pr8486() {
- printf("%s", 1); // expected-warning{{conversion specifies type 'char *' but the argument has type 'int'}}
+ printf("%s", 1); // expected-warning{{format specifies type 'char *' but the argument has type 'int'}}
}
// PR9314
@@ -372,7 +372,7 @@
int printf(const char * restrict, ...) __attribute__((__format__ (__printf__, 1, 2)));
void rdar9612060(void) {
- printf("%s", 2); // expected-warning{{conversion specifies type 'char *' but the argument has type 'int'}}
+ printf("%s", 2); // expected-warning{{format specifies type 'char *' but the argument has type 'int'}}
}
void check_char(unsigned char x, signed char y) {
@@ -421,8 +421,8 @@
printf("%.", 5); // expected-warning{{incomplete format specifier}}
const char kFormat6[] = "%s"; // expected-note{{format string is defined here}}
- printf(kFormat6, 5); // expected-warning{{conversion specifies type 'char *' but the argument has type 'int'}}
- printf("%s", 5); // expected-warning{{conversion specifies type 'char *' but the argument has type 'int'}}
+ printf(kFormat6, 5); // expected-warning{{format specifies type 'char *' but the argument has type 'int'}}
+ printf("%s", 5); // expected-warning{{format specifies type 'char *' but the argument has type 'int'}}
const char kFormat7[] = "%0$"; // expected-note{{format string is defined here}}
printf(kFormat7, 5); // expected-warning{{position arguments in format strings start counting at 1 (not 0)}}
Modified: cfe/branches/tooling/test/Sema/i-c-e.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Sema/i-c-e.c?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Sema/i-c-e.c (original)
+++ cfe/branches/tooling/test/Sema/i-c-e.c Mon Jan 23 02:39:37 2012
@@ -54,24 +54,21 @@
char z[__builtin_constant_p(4) ? 1 : -1];
// Comma tests
-int comma1[0?1,2:3]; // expected-warning {{expression result unused}}
-int comma2[1||(1,2)]; // expected-warning {{expression result unused}} \
- // expected-warning {{use of logical '||' with constant operand}} \
+int comma1[0?1,2:3];
+int comma2[1||(1,2)]; // expected-warning {{use of logical '||' with constant operand}} \
// expected-note {{use '|' for a bitwise operation}}
-int comma3[(1,2)]; // expected-warning {{size of static array must be an integer constant expression}} \
- // expected-warning {{expression result unused}}
+int comma3[(1,2)]; // expected-warning {{size of static array must be an integer constant expression}}
// Pointer + __builtin_constant_p
char pbcp[__builtin_constant_p(4) ? (intptr_t)&expr : 0]; // expected-error {{variable length array declaration not allowed at file scope}}
-int illegaldiv1a[1 || 1/0]; // expected-warning {{division by zero is undefined}}
-int illegaldiv1b[1 && 1/0]; // expected-warning {{division by zero is undefined}} expected-error{{variable length array declaration not allowed at file scope}}
+int illegaldiv1a[1 || 1/0];
+int illegaldiv1b[1 && 1/0]; //expected-error{{variable length array declaration not allowed at file scope}}
-int illegaldiv2[1/0]; // expected-error {{variable length array declaration not allowed at file scope}} \
- // expected-warning {{division by zero is undefined}}
+int illegaldiv2[1/0]; // expected-error {{variable length array declaration not allowed at file scope}}
int illegaldiv3[INT_MIN / -1]; // expected-error {{variable length array declaration not allowed at file scope}}
// PR9262
-int illegaldiv4[0 / (1 / 0)]; // expected-warning {{division by zero is undefined}} expected-error {{variable length array declaration not allowed at file scope}}
+int illegaldiv4[0 / (1 / 0)]; // expected-error {{variable length array declaration not allowed at file scope}}
int chooseexpr[__builtin_choose_expr(1, 1, expr)];
int realop[(__real__ 4) == 4 ? 1 : -1];
Modified: cfe/branches/tooling/test/Sema/no-format-y2k-turnsoff-format.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Sema/no-format-y2k-turnsoff-format.c?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Sema/no-format-y2k-turnsoff-format.c (original)
+++ cfe/branches/tooling/test/Sema/no-format-y2k-turnsoff-format.c Mon Jan 23 02:39:37 2012
@@ -4,6 +4,6 @@
void foo(const char *, ...) __attribute__((__format__ (__printf__, 1, 2)));
void bar(unsigned int a) {
- foo("%s", a); // expected-warning {{conversion specifies type 'char *' but the argument has type 'unsigned int'}}
+ foo("%s", a); // expected-warning {{format specifies type 'char *' but the argument has type 'unsigned int'}}
}
Modified: cfe/branches/tooling/test/Sema/switch.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Sema/switch.c?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Sema/switch.c (original)
+++ cfe/branches/tooling/test/Sema/switch.c Mon Jan 23 02:39:37 2012
@@ -288,3 +288,20 @@
case 0: return;
}
}
+
+int test18() {
+ enum { A, B } a;
+ switch (a) {
+ case A: return 0;
+ case B: return 1;
+ default: return 2; // expected-warning {{default is unreachable as all enumeration values are accounted for}}
+ }
+}
+
+int test19() {
+ enum { A, B } a;
+ switch (a) {
+ case 7: return 1; // expected-warning {{case value not in enumerated type}}
+ default: return 3;
+ }
+}
Modified: cfe/branches/tooling/test/Sema/warn-unreachable.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Sema/warn-unreachable.c?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/Sema/warn-unreachable.c (original)
+++ cfe/branches/tooling/test/Sema/warn-unreachable.c Mon Jan 23 02:39:37 2012
@@ -1,4 +1,4 @@
-// RUN: %clang %s -fsyntax-only -Xclang -verify -fblocks -Wunreachable-code -Wno-unused-value
+// RUN: %clang %s -fsyntax-only -Xclang -verify -fblocks -Wunreachable-code -Wno-unused-value -Wno-switch-redundant-default
int halt() __attribute__((noreturn));
int live();
Modified: cfe/branches/tooling/test/SemaCXX/MicrosoftCompatibility.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/MicrosoftCompatibility.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/MicrosoftCompatibility.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/MicrosoftCompatibility.cpp Mon Jan 23 02:39:37 2012
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -triple i686-pc-win32 -fsyntax-only -Wmicrosoft -verify -fms-compatibility -fexceptions -fcxx-exceptions
+// RUN: %clang_cc1 %s -triple i686-pc-win32 -fsyntax-only -std=c++11 -Wmicrosoft -verify -fms-compatibility -fexceptions -fcxx-exceptions
@@ -68,72 +68,109 @@
}
+namespace PR11826 {
+ struct pair {
+ pair(int v) { }
+ void operator=(pair&& rhs) { }
+ };
+ void f() {
+ pair p0(3);
+ pair p = p0;
+ }
+}
+
+namespace PR11826_for_symmetry {
+ struct pair {
+ pair(int v) { }
+ pair(pair&& rhs) { }
+ };
+ void f() {
+ pair p0(3);
+ pair p(4);
+ p = p0;
+ }
+}
+
+namespace ms_using_declaration_bug {
+
+class A {
+public:
+ int f();
+};
+
+class B : public A {
+private:
+ using A::f;
+};
+
+class C : public B {
+private:
+ using B::f; // expected-warning {{using declaration referring to inaccessible member 'ms_using_declaration_bug::B::f' (which refers to accessible member 'ms_using_declaration_bug::A::f') is a Microsoft compatibility extension}}
+};
+
+}
-namespace ms_using_declaration_bug {
-
-class A {
-public:
- int f();
-};
-
-class B : public A {
-private:
- using A::f;
-};
-
-class C : public B {
-private:
- using B::f; // expected-warning {{using declaration referring to inaccessible member 'ms_using_declaration_bug::B::f' (which refers to accessible member 'ms_using_declaration_bug::A::f') is a Microsoft compatibility extension}}
-};
-
-}
-
-
-namespace MissingTypename {
-
-template<class T> class A {
-public:
- typedef int TYPE;
-};
-
-template<class T> class B {
-public:
- typedef int TYPE;
-};
-
-
-template<class T, class U>
-class C : private A<T>, public B<U> {
-public:
- typedef A<T> Base1;
- typedef B<U> Base2;
- typedef A<U> Base3;
-
- A<T>::TYPE a1; // expected-warning {{missing 'typename' prior to dependent type name}}
- Base1::TYPE a2; // expected-warning {{missing 'typename' prior to dependent type name}}
-
- B<U>::TYPE a3; // expected-warning {{missing 'typename' prior to dependent type name}}
- Base2::TYPE a4; // expected-warning {{missing 'typename' prior to dependent type name}}
-
- A<U>::TYPE a5; // expected-error {{missing 'typename' prior to dependent type name}}
- Base3::TYPE a6; // expected-error {{missing 'typename' prior to dependent type name}}
- };
-
-class D {
-public:
- typedef int Type;
-};
-
-template <class T>
-void function_missing_typename(const T::Type param)// expected-warning {{missing 'typename' prior to dependent type name}}
-{
- const T::Type var = 2; // expected-warning {{missing 'typename' prior to dependent type name}}
-}
-
-template void function_missing_typename<D>(const D::Type param);
-
-}
-
-
-
+namespace MissingTypename {
+
+template<class T> class A {
+public:
+ typedef int TYPE;
+};
+
+template<class T> class B {
+public:
+ typedef int TYPE;
+};
+
+
+template<class T, class U>
+class C : private A<T>, public B<U> {
+public:
+ typedef A<T> Base1;
+ typedef B<U> Base2;
+ typedef A<U> Base3;
+
+ A<T>::TYPE a1; // expected-warning {{missing 'typename' prior to dependent type name}}
+ Base1::TYPE a2; // expected-warning {{missing 'typename' prior to dependent type name}}
+
+ B<U>::TYPE a3; // expected-warning {{missing 'typename' prior to dependent type name}}
+ Base2::TYPE a4; // expected-warning {{missing 'typename' prior to dependent type name}}
+
+ A<U>::TYPE a5; // expected-error {{missing 'typename' prior to dependent type name}}
+ Base3::TYPE a6; // expected-error {{missing 'typename' prior to dependent type name}}
+ };
+
+class D {
+public:
+ typedef int Type;
+};
+
+template <class T>
+void function_missing_typename(const T::Type param)// expected-warning {{missing 'typename' prior to dependent type name}}
+{
+ const T::Type var = 2; // expected-warning {{missing 'typename' prior to dependent type name}}
+}
+
+template void function_missing_typename<D>(const D::Type param);
+
+}
+
+enum ENUM2 {
+ ENUM2_a = (enum ENUM2) 4,
+ ENUM2_b = 0x9FFFFFFF, // expected-warning {{enumerator value is not representable in the underlying type 'int'}}
+ ENUM2_c = 0x100000000 // expected-warning {{enumerator value is not representable in the underlying type 'int'}}
+};
+
+
+namespace PR11791 {
+ template<class _Ty>
+ void del(_Ty *_Ptr) {
+ _Ptr->~_Ty(); // expected-warning {{pseudo-destructors on type void are a Microsoft extension}}
+ }
+
+ void f() {
+ int* a = 0;
+ del((void*)a); // expected-note {{in instantiation of function template specialization}}
+ }
+}
Modified: cfe/branches/tooling/test/SemaCXX/MicrosoftExtensions.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/MicrosoftExtensions.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/MicrosoftExtensions.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/MicrosoftExtensions.cpp Mon Jan 23 02:39:37 2012
@@ -99,11 +99,6 @@
enum ENUM1* var3 = 0;// expected-warning {{forward references to 'enum' types are a Microsoft extension}}
-enum ENUM2 {
- ENUM2_a = (enum ENUM2) 4,
- ENUM2_b = 0x9FFFFFFF, // expected-warning {{enumerator value is not representable in the underlying type 'int'}}
- ENUM2_c = 0x100000000 // expected-warning {{enumerator value is not representable in the underlying type 'int'}}
-};
void f(long long);
Modified: cfe/branches/tooling/test/SemaCXX/format-strings-0x.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/format-strings-0x.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/format-strings-0x.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/format-strings-0x.cpp Mon Jan 23 02:39:37 2012
@@ -6,7 +6,7 @@
}
void f(char **sp, float *fp) {
- scanf("%as", sp); // expected-warning{{conversion specifies type 'float *' but the argument has type 'char **'}}
+ scanf("%as", sp); // expected-warning{{format specifies type 'float *' but the argument has type 'char **'}}
printf("%a", 1.0);
scanf("%afoobar", fp);
Modified: cfe/branches/tooling/test/SemaCXX/gnu-case-ranges.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/gnu-case-ranges.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/gnu-case-ranges.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/gnu-case-ranges.cpp Mon Jan 23 02:39:37 2012
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -verify %s
+// RUN: %clang_cc1 -verify -Wno-switch-redundant-default %s
enum E {
one,
Modified: cfe/branches/tooling/test/SemaCXX/microsoft-cxx0x.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/microsoft-cxx0x.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/microsoft-cxx0x.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/microsoft-cxx0x.cpp Mon Jan 23 02:39:37 2012
@@ -6,5 +6,3 @@
};
int b = 3;
A var = { b }; // expected-warning {{ cannot be narrowed }} expected-note {{override}}
-
-
Modified: cfe/branches/tooling/test/SemaCXX/return-noreturn.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/return-noreturn.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/return-noreturn.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/return-noreturn.cpp Mon Jan 23 02:39:37 2012
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 %s -fsyntax-only -verify -Wreturn-type -Wmissing-noreturn -Wno-unreachable-code
-// RUN: %clang_cc1 %s -fsyntax-only -std=c++11 -verify -Wreturn-type -Wmissing-noreturn -Wno-unreachable-code
+// RUN: %clang_cc1 %s -fsyntax-only -verify -Wreturn-type -Wmissing-noreturn -Wno-unreachable-code -Wno-switch-redundant-default
+// RUN: %clang_cc1 %s -fsyntax-only -std=c++11 -verify -Wreturn-type -Wmissing-noreturn -Wno-unreachable-code -Wno-switch-redundant-default
// A destructor may be marked noreturn and should still influence the CFG.
void pr6884_abort() __attribute__((noreturn));
Modified: cfe/branches/tooling/test/SemaCXX/switch.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/switch.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/switch.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/switch.cpp Mon Jan 23 02:39:37 2012
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify -Wswitch-enum %s
+// RUN: %clang_cc1 -fsyntax-only -verify %s
void test() {
bool x = true;
Modified: cfe/branches/tooling/test/SemaCXX/vararg-non-pod.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/vararg-non-pod.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/vararg-non-pod.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/vararg-non-pod.cpp Mon Jan 23 02:39:37 2012
@@ -118,3 +118,8 @@
(void)__builtin_va_arg(list, Abstract); // expected-error{{second argument to 'va_arg' is of abstract type 'Abstract'}}
__builtin_va_end(list);
}
+
+int t9(int n) {
+ // Make sure the error works in potentially-evaluated sizeof
+ return (int)sizeof(*(Helper(Foo()), (int (*)[n])0)); // expected-warning{{cannot pass object of non-POD type}}
+}
Modified: cfe/branches/tooling/test/SemaCXX/warn-thread-safety-analysis.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/warn-thread-safety-analysis.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/warn-thread-safety-analysis.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/warn-thread-safety-analysis.cpp Mon Jan 23 02:39:37 2012
@@ -1605,7 +1605,6 @@
} // end namespace test_scoped_lockable
-
namespace FunctionAttrTest {
class Foo {
@@ -1727,4 +1726,178 @@
}; // end TestTrylock
+namespace TestTemplateAttributeInstantiation {
+
+class Foo1 {
+public:
+ Mutex mu_;
+ int a GUARDED_BY(mu_);
+};
+
+class Foo2 {
+public:
+ int a GUARDED_BY(mu_);
+ Mutex mu_;
+};
+
+
+class Bar {
+public:
+ // Test non-dependent expressions in attributes on template functions
+ template <class T>
+ void barND(Foo1 *foo, T *fooT) EXCLUSIVE_LOCKS_REQUIRED(foo->mu_) {
+ foo->a = 0;
+ }
+
+ // Test dependent expressions in attributes on template functions
+ template <class T>
+ void barD(Foo1 *foo, T *fooT) EXCLUSIVE_LOCKS_REQUIRED(fooT->mu_) {
+ fooT->a = 0;
+ }
+};
+
+
+template <class T>
+class BarT {
+public:
+ Foo1 fooBase;
+ T fooBaseT;
+
+ // Test non-dependent expression in ordinary method on template class
+ void barND() EXCLUSIVE_LOCKS_REQUIRED(fooBase.mu_) {
+ fooBase.a = 0;
+ }
+
+ // Test dependent expressions in ordinary methods on template class
+ void barD() EXCLUSIVE_LOCKS_REQUIRED(fooBaseT.mu_) {
+ fooBaseT.a = 0;
+ }
+
+ // Test dependent expressions in template method in template class
+ template <class T2>
+ void barTD(T2 *fooT) EXCLUSIVE_LOCKS_REQUIRED(fooBaseT.mu_, fooT->mu_) {
+ fooBaseT.a = 0;
+ fooT->a = 0;
+ }
+};
+
+template <class T>
+class Cell {
+public:
+ Mutex mu_;
+ // Test dependent guarded_by
+ T data GUARDED_BY(mu_);
+
+ void fooEx() EXCLUSIVE_LOCKS_REQUIRED(mu_) {
+ data = 0;
+ }
+
+ void foo() {
+ mu_.Lock();
+ data = 0;
+ mu_.Unlock();
+ }
+};
+
+void test() {
+ Bar b;
+ BarT<Foo2> bt;
+ Foo1 f1;
+ Foo2 f2;
+
+ f1.mu_.Lock();
+ f2.mu_.Lock();
+ bt.fooBase.mu_.Lock();
+ bt.fooBaseT.mu_.Lock();
+
+ b.barND(&f1, &f2);
+ b.barD(&f1, &f2);
+ bt.barND();
+ bt.barD();
+ bt.barTD(&f2);
+
+ f1.mu_.Unlock();
+ bt.barTD(&f1); // \
+ // expected-warning {{calling function 'barTD' requires exclusive lock on 'mu_'}}
+
+ bt.fooBase.mu_.Unlock();
+ bt.fooBaseT.mu_.Unlock();
+ f2.mu_.Unlock();
+
+ Cell<int> cell;
+ cell.data = 0; // \
+ // expected-warning {{writing variable 'data' requires locking 'mu_' exclusively}}
+ cell.foo();
+ cell.mu_.Lock();
+ cell.fooEx();
+ cell.mu_.Unlock();
+}
+
+
+template <class T>
+class CellDelayed {
+public:
+ // Test dependent guarded_by
+ T data GUARDED_BY(mu_);
+
+ void fooEx(CellDelayed<T> *other) EXCLUSIVE_LOCKS_REQUIRED(mu_, other->mu_) {
+ this->data = other->data;
+ }
+
+ template <class T2>
+ void fooExT(CellDelayed<T2> *otherT) EXCLUSIVE_LOCKS_REQUIRED(mu_, otherT->mu_) {
+ this->data = otherT->data;
+ }
+
+ void foo() {
+ mu_.Lock();
+ data = 0;
+ mu_.Unlock();
+ }
+
+ Mutex mu_;
+};
+
+void testDelayed() {
+ CellDelayed<int> celld;
+ CellDelayed<int> celld2;
+ celld.foo();
+ celld.mu_.Lock();
+ celld2.mu_.Lock();
+
+ celld.fooEx(&celld2);
+ celld.fooExT(&celld2);
+
+ celld2.mu_.Unlock();
+ celld.mu_.Unlock();
+}
+
+}; // end namespace TestTemplateAttributeInstantiation
+
+
+namespace FunctionDeclDefTest {
+
+class Foo {
+public:
+ Mutex mu_;
+ int a GUARDED_BY(mu_);
+
+ virtual void foo1(Foo *f_declared) EXCLUSIVE_LOCKS_REQUIRED(f_declared->mu_);
+};
+
+// EXCLUSIVE_LOCKS_REQUIRED should be applied, and rewritten to f_defined->mu_
+void Foo::foo1(Foo *f_defined) {
+ f_defined->a = 0;
+};
+
+void test() {
+ Foo myfoo;
+ myfoo.foo1(&myfoo); // \
+ // expected-warning {{calling function 'foo1' requires exclusive lock on 'mu_'}}
+ myfoo.mu_.Lock();
+ myfoo.foo1(&myfoo);
+ myfoo.mu_.Unlock();
+}
+
+};
Propchange: cfe/branches/tooling/test/SemaCXX/warn-unreachable.cpp
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Jan 23 02:39:37 2012
@@ -1,2 +1,2 @@
/cfe/branches/type-system-rewrite/test/SemaCXX/warn-unreachable.cpp:134693-134817
-/cfe/trunk/test/SemaCXX/warn-unreachable.cpp:121961,146581-148539
+/cfe/trunk/test/SemaCXX/warn-unreachable.cpp:121961,146581-148688
Modified: cfe/branches/tooling/test/SemaObjC/format-strings-objc.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaObjC/format-strings-objc.m?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaObjC/format-strings-objc.m (original)
+++ cfe/branches/tooling/test/SemaObjC/format-strings-objc.m Mon Jan 23 02:39:37 2012
@@ -47,8 +47,8 @@
// <rdar://problem/7068334> - Catch use of long long with int arguments.
void rdar_7068334() {
long long test = 500;
- printf("%i ",test); // expected-warning{{conversion specifies type 'int' but the argument has type 'long long'}}
- NSLog(@"%i ",test); // expected-warning{{conversion specifies type 'int' but the argument has type 'long long'}}
+ printf("%i ",test); // expected-warning{{format specifies type 'int' but the argument has type 'long long'}}
+ NSLog(@"%i ",test); // expected-warning{{format specifies type 'int' but the argument has type 'long long'}}
}
// <rdar://problem/7697748>
Modified: cfe/branches/tooling/tools/arcmt-test/arcmt-test.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/tools/arcmt-test/arcmt-test.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/tools/arcmt-test/arcmt-test.cpp (original)
+++ cfe/branches/tooling/tools/arcmt-test/arcmt-test.cpp Mon Jan 23 02:39:37 2012
@@ -129,9 +129,7 @@
if (!CI.getLangOpts()->ObjC1)
return false;
- arcmt::checkForManualIssues(CI,
- CI.getFrontendOpts().Inputs[0].second,
- CI.getFrontendOpts().Inputs[0].first,
+ arcmt::checkForManualIssues(CI, CI.getFrontendOpts().Inputs[0],
Diags->getClient());
return Diags->getClient()->getNumErrors() > 0;
}
Modified: cfe/branches/tooling/tools/driver/driver.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/tools/driver/driver.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/tools/driver/driver.cpp (original)
+++ cfe/branches/tooling/tools/driver/driver.cpp Mon Jan 23 02:39:37 2012
@@ -271,7 +271,7 @@
// the function tries to identify a target as prefix. E.g.
// "x86_64-linux-clang" as interpreted as suffix "clang" with
// target prefix "x86_64-linux". If such a target prefix is found,
- // is gets added via -ccc-host-triple as implicit first argument.
+ // is gets added via -target as implicit first argument.
static const struct {
const char *Suffix;
bool IsCXX;
@@ -331,7 +331,7 @@
++it;
ArgVector.insert(it, SaveStringInSet(SavedStrings, Prefix));
ArgVector.insert(it,
- SaveStringInSet(SavedStrings, std::string("-ccc-host-triple")));
+ SaveStringInSet(SavedStrings, std::string("-target")));
}
}
Modified: cfe/branches/tooling/tools/libclang/CIndexCodeCompletion.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/tools/libclang/CIndexCodeCompletion.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/tools/libclang/CIndexCodeCompletion.cpp (original)
+++ cfe/branches/tooling/tools/libclang/CIndexCodeCompletion.cpp Mon Jan 23 02:39:37 2012
@@ -141,8 +141,7 @@
return createCXString("");
}
- // Should be unreachable, but let's be careful.
- return createCXString((const char*)0);
+ llvm_unreachable("Invalid CodeCompletionString Kind!");
}
Modified: cfe/branches/tooling/tools/libclang/Indexing.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/tools/libclang/Indexing.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/tools/libclang/Indexing.cpp (original)
+++ cfe/branches/tooling/tools/libclang/Indexing.cpp Mon Jan 23 02:39:37 2012
@@ -18,6 +18,7 @@
#include "clang/Frontend/ASTUnit.h"
#include "clang/Frontend/CompilerInvocation.h"
#include "clang/Frontend/CompilerInstance.h"
+#include "clang/Frontend/FrontendAction.h"
#include "clang/Frontend/Utils.h"
#include "clang/Sema/SemaConsumer.h"
#include "clang/AST/ASTConsumer.h"
Modified: cfe/branches/tooling/unittests/Frontend/FrontendActionTest.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/unittests/Frontend/FrontendActionTest.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/unittests/Frontend/FrontendActionTest.cpp (original)
+++ cfe/branches/tooling/unittests/Frontend/FrontendActionTest.cpp Mon Jan 23 02:39:37 2012
@@ -55,8 +55,8 @@
CompilerInvocation *invocation = new CompilerInvocation;
invocation->getPreprocessorOpts().addRemappedFile(
"test.cc", MemoryBuffer::getMemBuffer("int main() { float x; }"));
- invocation->getFrontendOpts().Inputs.push_back(
- std::make_pair(IK_CXX, "test.cc"));
+ invocation->getFrontendOpts().Inputs.push_back(FrontendInputFile("test.cc",
+ IK_CXX));
invocation->getFrontendOpts().ProgramAction = frontend::ParseSyntaxOnly;
invocation->getTargetOpts().Triple = "i386-unknown-linux-gnu";
CompilerInstance compiler;
Modified: cfe/branches/tooling/unittests/Lex/LexerTest.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/unittests/Lex/LexerTest.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/unittests/Lex/LexerTest.cpp (original)
+++ cfe/branches/tooling/unittests/Lex/LexerTest.cpp Mon Jan 23 02:39:37 2012
@@ -58,7 +58,8 @@
TEST_F(LexerTest, LexAPI) {
const char *source =
"#define M(x) [x]\n"
- "M(foo)";
+ "#define N(x) x\n"
+ "M(foo) N([bar])";
MemoryBuffer *buf = MemoryBuffer::getMemBuffer(source);
SourceMgr.createMainFileIDForMemBuffer(buf);
@@ -82,10 +83,13 @@
}
// Make sure we got the tokens that we expected.
- ASSERT_EQ(3U, toks.size());
+ ASSERT_EQ(6U, toks.size());
ASSERT_EQ(tok::l_square, toks[0].getKind());
ASSERT_EQ(tok::identifier, toks[1].getKind());
ASSERT_EQ(tok::r_square, toks[2].getKind());
+ ASSERT_EQ(tok::l_square, toks[3].getKind());
+ ASSERT_EQ(tok::identifier, toks[4].getKind());
+ ASSERT_EQ(tok::r_square, toks[5].getKind());
SourceLocation lsqrLoc = toks[0].getLocation();
SourceLocation idLoc = toks[1].getLocation();
@@ -119,6 +123,34 @@
CharSourceRange::getTokenRange(SourceRange(lsqrLoc, rsqrLoc)),
SourceMgr, LangOpts);
EXPECT_EQ(text, "M(foo)");
+
+ SourceLocation macroLsqrLoc = toks[3].getLocation();
+ SourceLocation macroIdLoc = toks[4].getLocation();
+ SourceLocation macroRsqrLoc = toks[5].getLocation();
+ SourceLocation fileLsqrLoc = SourceMgr.getSpellingLoc(macroLsqrLoc);
+ SourceLocation fileIdLoc = SourceMgr.getSpellingLoc(macroIdLoc);
+ SourceLocation fileRsqrLoc = SourceMgr.getSpellingLoc(macroRsqrLoc);
+
+ range = Lexer::makeFileCharRange(SourceRange(macroLsqrLoc, macroIdLoc),
+ SourceMgr, LangOpts);
+ EXPECT_EQ(SourceRange(fileLsqrLoc, fileIdLoc.getLocWithOffset(3)),
+ range.getAsRange());
+
+ range = Lexer::makeFileCharRange(SourceRange(macroIdLoc, macroRsqrLoc),
+ SourceMgr, LangOpts);
+ EXPECT_EQ(SourceRange(fileIdLoc, fileRsqrLoc.getLocWithOffset(1)),
+ range.getAsRange());
+
+ macroPair = SourceMgr.getExpansionRange(macroLsqrLoc);
+ range = Lexer::makeFileCharRange(SourceRange(macroLsqrLoc, macroRsqrLoc),
+ SourceMgr, LangOpts);
+ EXPECT_EQ(SourceRange(macroPair.first, macroPair.second.getLocWithOffset(1)),
+ range.getAsRange());
+
+ text = Lexer::getSourceText(
+ CharSourceRange::getTokenRange(SourceRange(macroLsqrLoc, macroIdLoc)),
+ SourceMgr, LangOpts);
+ EXPECT_EQ(text, "[bar");
}
} // anonymous namespace
Modified: cfe/branches/tooling/utils/TableGen/ClangAttrEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/utils/TableGen/ClangAttrEmitter.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/utils/TableGen/ClangAttrEmitter.cpp (original)
+++ cfe/branches/tooling/utils/TableGen/ClangAttrEmitter.cpp Mon Jan 23 02:39:37 2012
@@ -89,6 +89,8 @@
virtual void writeAccessors(raw_ostream &OS) const = 0;
virtual void writeAccessorDefinitions(raw_ostream &OS) const {}
virtual void writeCloneArgs(raw_ostream &OS) const = 0;
+ virtual void writeTemplateInstantiationArgs(raw_ostream &OS) const = 0;
+ virtual void writeTemplateInstantiation(raw_ostream &OS) const {};
virtual void writeCtorBody(raw_ostream &OS) const {}
virtual void writeCtorInitializers(raw_ostream &OS) const = 0;
virtual void writeCtorParameters(raw_ostream &OS) const = 0;
@@ -107,6 +109,8 @@
: Argument(Arg, Attr), type(T)
{}
+ std::string getType() const { return type; }
+
void writeAccessors(raw_ostream &OS) const {
OS << " " << type << " get" << getUpperName() << "() const {\n";
OS << " return " << getLowerName() << ";\n";
@@ -115,6 +119,9 @@
void writeCloneArgs(raw_ostream &OS) const {
OS << getLowerName();
}
+ void writeTemplateInstantiationArgs(raw_ostream &OS) const {
+ OS << "A->get" << getUpperName() << "()";
+ }
void writeCtorInitializers(raw_ostream &OS) const {
OS << getLowerName() << "(" << getUpperName() << ")";
}
@@ -176,6 +183,9 @@
void writeCloneArgs(raw_ostream &OS) const {
OS << "get" << getUpperName() << "()";
}
+ void writeTemplateInstantiationArgs(raw_ostream &OS) const {
+ OS << "A->get" << getUpperName() << "()";
+ }
void writeCtorBody(raw_ostream &OS) const {
OS << " std::memcpy(" << getLowerName() << ", " << getUpperName()
<< ".data(), " << getLowerName() << "Length);";
@@ -266,6 +276,10 @@
<< "Expr) : " << getLowerName()
<< "Type";
}
+ void writeTemplateInstantiationArgs(raw_ostream &OS) const {
+ // FIXME: move the definition in Sema::InstantiateAttrs to here.
+ // In the meantime, aligned attributes are cloned.
+ }
void writeCtorBody(raw_ostream &OS) const {
OS << " if (is" << getLowerName() << "Expr)\n";
OS << " " << getLowerName() << "Expr = reinterpret_cast<Expr *>("
@@ -335,12 +349,17 @@
<< "Size;\n";
OS << " }\n";
OS << " unsigned " << getLowerName() << "_size() const {\n"
- << " return " << getLowerName() << "Size;\n;";
+ << " return " << getLowerName() << "Size;\n";
OS << " }";
}
void writeCloneArgs(raw_ostream &OS) const {
OS << getLowerName() << ", " << getLowerName() << "Size";
}
+ void writeTemplateInstantiationArgs(raw_ostream &OS) const {
+ // This isn't elegant, but we have to go through public methods...
+ OS << "A->" << getLowerName() << "_begin(), "
+ << "A->" << getLowerName() << "_size()";
+ }
void writeCtorBody(raw_ostream &OS) const {
// FIXME: memcpy is not safe on non-trivial types.
OS << " std::memcpy(" << getLowerName() << ", " << getUpperName()
@@ -412,6 +431,9 @@
void writeCloneArgs(raw_ostream &OS) const {
OS << getLowerName();
}
+ void writeTemplateInstantiationArgs(raw_ostream &OS) const {
+ OS << "A->get" << getUpperName() << "()";
+ }
void writeCtorInitializers(raw_ostream &OS) const {
OS << getLowerName() << "(" << getUpperName() << ")";
}
@@ -475,6 +497,9 @@
void writeCloneArgs(raw_ostream &OS) const {
OS << "get" << getUpperName() << "()";
}
+ void writeTemplateInstantiationArgs(raw_ostream &OS) const {
+ OS << "A->get" << getUpperName() << "()";
+ }
void writeCtorBody(raw_ostream &OS) const {
}
void writeCtorInitializers(raw_ostream &OS) const {
@@ -500,6 +525,61 @@
OS << getLowerName() << "=\" << get" << getUpperName() << "() << \"";
}
};
+
+ class ExprArgument : public SimpleArgument {
+ public:
+ ExprArgument(Record &Arg, StringRef Attr)
+ : SimpleArgument(Arg, Attr, "Expr *")
+ {}
+
+ void writeTemplateInstantiationArgs(raw_ostream &OS) const {
+ OS << "tempInst" << getUpperName();
+ }
+
+ void writeTemplateInstantiation(raw_ostream &OS) const {
+ OS << " " << getType() << " tempInst" << getUpperName() << ";\n";
+ OS << " {\n";
+ OS << " EnterExpressionEvaluationContext "
+ << "Unevaluated(S, Sema::Unevaluated);\n";
+ OS << " ExprResult " << "Result = S.SubstExpr("
+ << "A->get" << getUpperName() << "(), TemplateArgs);\n";
+ OS << " tempInst" << getUpperName() << " = "
+ << "Result.takeAs<Expr>();\n";
+ OS << " }\n";
+ }
+ };
+
+ class VariadicExprArgument : public VariadicArgument {
+ public:
+ VariadicExprArgument(Record &Arg, StringRef Attr)
+ : VariadicArgument(Arg, Attr, "Expr *")
+ {}
+
+ void writeTemplateInstantiationArgs(raw_ostream &OS) const {
+ OS << "tempInst" << getUpperName() << ", "
+ << "A->" << getLowerName() << "_size()";
+ }
+
+ void writeTemplateInstantiation(raw_ostream &OS) const {
+ OS << " " << getType() << " *tempInst" << getUpperName()
+ << " = new (C, 16) " << getType()
+ << "[A->" << getLowerName() << "_size()];\n";
+ OS << " {\n";
+ OS << " EnterExpressionEvaluationContext "
+ << "Unevaluated(S, Sema::Unevaluated);\n";
+ OS << " " << getType() << " *TI = tempInst" << getUpperName()
+ << ";\n";
+ OS << " " << getType() << " *I = A->" << getLowerName()
+ << "_begin();\n";
+ OS << " " << getType() << " *E = A->" << getLowerName()
+ << "_end();\n";
+ OS << " for (; I != E; ++I, ++TI) {\n";
+ OS << " ExprResult Result = S.SubstExpr(*I, TemplateArgs);\n";
+ OS << " *TI = Result.takeAs<Expr>();\n";
+ OS << " }\n";
+ OS << " }\n";
+ }
+ };
}
static Argument *createArgument(Record &Arg, StringRef Attr,
@@ -512,8 +592,7 @@
if (ArgName == "AlignedArgument") Ptr = new AlignedArgument(Arg, Attr);
else if (ArgName == "EnumArgument") Ptr = new EnumArgument(Arg, Attr);
- else if (ArgName == "ExprArgument") Ptr = new SimpleArgument(Arg, Attr,
- "Expr *");
+ else if (ArgName == "ExprArgument") Ptr = new ExprArgument(Arg, Attr);
else if (ArgName == "FunctionArgument")
Ptr = new SimpleArgument(Arg, Attr, "FunctionDecl *");
else if (ArgName == "IdentifierArgument")
@@ -531,7 +610,7 @@
else if (ArgName == "VariadicUnsignedArgument")
Ptr = new VariadicArgument(Arg, Attr, "unsigned");
else if (ArgName == "VariadicExprArgument")
- Ptr = new VariadicArgument(Arg, Attr, "Expr *");
+ Ptr = new VariadicExprArgument(Arg, Attr);
else if (ArgName == "VersionArgument")
Ptr = new VersionArgument(Arg, Attr);
@@ -630,6 +709,11 @@
<< "attr::" << R.getName() << "; }\n";
OS << " static bool classof(const " << R.getName()
<< "Attr *) { return true; }\n";
+
+ bool LateParsed = R.getValueAsBit("LateParsed");
+ OS << " virtual bool isLateParsed() const { return "
+ << LateParsed << "; }\n";
+
OS << "};\n\n";
}
@@ -851,3 +935,63 @@
}
}
}
+
+
+void ClangAttrTemplateInstantiateEmitter::run(raw_ostream &OS) {
+ OS << "// This file is generated by TableGen. Do not edit.\n\n";
+
+ std::vector<Record*> Attrs = Records.getAllDerivedDefinitions("Attr");
+
+ OS << "Attr* instantiateTemplateAttribute(const Attr *At, ASTContext &C, "
+ << "Sema &S,\n"
+ << " const MultiLevelTemplateArgumentList &TemplateArgs) {\n"
+ << " switch (At->getKind()) {\n"
+ << " default:\n"
+ << " break;\n";
+
+ for (std::vector<Record*>::iterator I = Attrs.begin(), E = Attrs.end();
+ I != E; ++I) {
+ Record &R = **I;
+
+ OS << " case attr::" << R.getName() << ": {\n";
+ OS << " const " << R.getName() << "Attr *A = cast<"
+ << R.getName() << "Attr>(At);\n";
+ bool TDependent = R.getValueAsBit("TemplateDependent");
+
+ if (!TDependent) {
+ OS << " return A->clone(C);\n";
+ OS << " }\n";
+ continue;
+ }
+
+ std::vector<Record*> ArgRecords = R.getValueAsListOfDefs("Args");
+ std::vector<Argument*> Args;
+ std::vector<Argument*>::iterator ai, ae;
+ Args.reserve(ArgRecords.size());
+
+ for (std::vector<Record*>::iterator ri = ArgRecords.begin(),
+ re = ArgRecords.end();
+ ri != re; ++ri) {
+ Record &ArgRecord = **ri;
+ Argument *Arg = createArgument(ArgRecord, R.getName());
+ assert(Arg);
+ Args.push_back(Arg);
+ }
+ ae = Args.end();
+
+ for (ai = Args.begin(); ai != ae; ++ai) {
+ (*ai)->writeTemplateInstantiation(OS);
+ }
+ OS << " return new (C) " << R.getName() << "Attr(A->getLocation(), C";
+ for (ai = Args.begin(); ai != ae; ++ai) {
+ OS << ", ";
+ (*ai)->writeTemplateInstantiationArgs(OS);
+ }
+ OS << ");\n }\n";
+ }
+ OS << " } // end switch\n"
+ << " llvm_unreachable(\"Unknown attribute!\");\n"
+ << " return 0;\n"
+ << "}\n\n";
+}
+
Modified: cfe/branches/tooling/utils/TableGen/ClangAttrEmitter.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/utils/TableGen/ClangAttrEmitter.h?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/utils/TableGen/ClangAttrEmitter.h (original)
+++ cfe/branches/tooling/utils/TableGen/ClangAttrEmitter.h Mon Jan 23 02:39:37 2012
@@ -109,6 +109,19 @@
void run(raw_ostream &OS);
};
+/// ClangAttrTemplateInstantiateEmitter emits code to instantiate dependent
+/// attributes on templates.
+class ClangAttrTemplateInstantiateEmitter : public TableGenBackend {
+ RecordKeeper &Records;
+
+ public:
+ explicit ClangAttrTemplateInstantiateEmitter(RecordKeeper &R)
+ : Records(R)
+ {}
+
+ void run(raw_ostream &OS);
+};
+
}
#endif
Modified: cfe/branches/tooling/utils/TableGen/TableGen.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/utils/TableGen/TableGen.cpp?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/utils/TableGen/TableGen.cpp (original)
+++ cfe/branches/tooling/utils/TableGen/TableGen.cpp Mon Jan 23 02:39:37 2012
@@ -36,6 +36,7 @@
GenClangAttrPCHWrite,
GenClangAttrSpellingList,
GenClangAttrLateParsedList,
+ GenClangAttrTemplateInstantiate,
GenClangDiagsDefs,
GenClangDiagGroups,
GenClangDiagsIndexName,
@@ -71,6 +72,9 @@
clEnumValN(GenClangAttrLateParsedList,
"gen-clang-attr-late-parsed-list",
"Generate a clang attribute LateParsed list"),
+ clEnumValN(GenClangAttrTemplateInstantiate,
+ "gen-clang-attr-template-instantiate",
+ "Generate a clang template instantiate code"),
clEnumValN(GenClangDiagsDefs, "gen-clang-diags-defs",
"Generate Clang diagnostics definitions"),
clEnumValN(GenClangDiagGroups, "gen-clang-diag-groups",
@@ -122,6 +126,9 @@
case GenClangAttrLateParsedList:
ClangAttrLateParsedListEmitter(Records).run(OS);
break;
+ case GenClangAttrTemplateInstantiate:
+ ClangAttrTemplateInstantiateEmitter(Records).run(OS);
+ break;
case GenClangDiagsDefs:
ClangDiagsDefsEmitter(Records, ClangComponent).run(OS);
break;
Modified: cfe/branches/tooling/utils/analyzer/SATestBuild.py
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/utils/analyzer/SATestBuild.py?rev=148690&r1=148689&r2=148690&view=diff
==============================================================================
--- cfe/branches/tooling/utils/analyzer/SATestBuild.py (original)
+++ cfe/branches/tooling/utils/analyzer/SATestBuild.py Mon Jan 23 02:39:37 2012
@@ -72,7 +72,7 @@
# The list of checkers used during analyzes.
# Currently, consists of all the non experimental checkers.
-Checkers="core,deadcode,cplusplus,security,unix,osx,cocoa"
+Checkers="experimental.security.taint,core,deadcode,cplusplus,security,unix,osx,cocoa"
Verbose = 1
More information about the llvm-branch-commits
mailing list