Index: include/clang/Driver/CC1Options.td =================================================================== --- include/clang/Driver/CC1Options.td +++ include/clang/Driver/CC1Options.td @@ -189,7 +189,7 @@ HelpText<"Disable adding the optnone attribute to functions at O0">; def disable_red_zone : Flag<["-"], "disable-red-zone">, HelpText<"Do not emit code that uses the red zone.">; -def dwarf_column_info : Flag<["-"], "dwarf-column-info">, +def debug_column_info : Flag<["-"], "debug-column-info">, HelpText<"Turn on column location information.">; def split_dwarf : Flag<["-"], "split-dwarf">, HelpText<"Split out the dwarf .dwo sections">; Index: lib/AST/Expr.cpp =================================================================== --- lib/AST/Expr.cpp +++ lib/AST/Expr.cpp @@ -549,7 +549,7 @@ Out << "static "; } - PrintingPolicy Policy(Context.getLangOpts()); + PrintingPolicy Policy(Context.getPrintingPolicy()); std::string Proto; llvm::raw_string_ostream POut(Proto); Index: lib/CodeGen/CGDebugInfo.cpp =================================================================== --- lib/CodeGen/CGDebugInfo.cpp +++ lib/CodeGen/CGDebugInfo.cpp @@ -234,6 +234,9 @@ if (CGM.getCodeGenOpts().EmitCodeView) PP.MSVCFormatting = true; + if (!CGM.getCodeGenOpts().DebugColumnInfo) + PP.AnonymousTagLocations = false; + return PP; } Index: lib/Driver/ToolChains/Clang.cpp =================================================================== --- lib/Driver/ToolChains/Clang.cpp +++ lib/Driver/ToolChains/Clang.cpp @@ -2907,7 +2907,7 @@ // include any column info. if (Args.hasFlag(options::OPT_gcolumn_info, options::OPT_gno_column_info, /*Default=*/ !IsPS4CPU && !(IsWindowsMSVC && EmitCodeView))) - CmdArgs.push_back("-dwarf-column-info"); + CmdArgs.push_back("-debug-column-info"); // FIXME: Move backend command line options to the module. // If -gline-tables-only is the last option it wins. Index: lib/Frontend/CompilerInstance.cpp =================================================================== --- lib/Frontend/CompilerInstance.cpp +++ lib/Frontend/CompilerInstance.cpp @@ -488,6 +488,10 @@ PP.getIdentifierTable(), PP.getSelectorTable(), PP.getBuiltinInfo()); Context->InitBuiltinTypes(getTarget(), getAuxTarget()); + PrintingPolicy Policy = Context->getPrintingPolicy(); + if (!getCodeGenOpts().DebugColumnInfo) + Policy.AnonymousTagLocations = false; + Context->setPrintingPolicy(Policy); setASTContext(Context); } Index: lib/Frontend/CompilerInvocation.cpp =================================================================== --- lib/Frontend/CompilerInvocation.cpp +++ lib/Frontend/CompilerInvocation.cpp @@ -518,7 +518,7 @@ Opts.setDebuggerTuning(static_cast(Val)); } Opts.DwarfVersion = getLastArgIntValue(Args, OPT_dwarf_version_EQ, 0, Diags); - Opts.DebugColumnInfo = Args.hasArg(OPT_dwarf_column_info); + Opts.DebugColumnInfo = Args.hasArg(OPT_debug_column_info); Opts.EmitCodeView = Args.hasArg(OPT_gcodeview); Opts.MacroDebugInfo = Args.hasArg(OPT_debug_info_macro); Opts.WholeProgramVTables = Args.hasArg(OPT_fwhole_program_vtables); Index: test/CXX/expr/expr.prim/expr.prim.lambda/default-arguments.cpp =================================================================== --- test/CXX/expr/expr.prim/expr.prim.lambda/default-arguments.cpp +++ test/CXX/expr/expr.prim/expr.prim.lambda/default-arguments.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fsyntax-only -std=c++11 %s -verify +// RUN: %clang_cc1 -debug-column-info -fsyntax-only -std=c++11 %s -verify void defargs() { auto l1 = [](int i, int j = 17, int k = 18) { return i + j + k; }; Index: test/CodeGen/code-coverage.c =================================================================== --- test/CodeGen/code-coverage.c +++ test/CodeGen/code-coverage.c @@ -1,6 +1,6 @@ // RUN: %clang_cc1 -emit-llvm -disable-red-zone -femit-coverage-data %s -o - | FileCheck %s // RUN: %clang_cc1 -emit-llvm -disable-red-zone -femit-coverage-data -coverage-no-function-names-in-data %s -o - | FileCheck %s --check-prefix WITHOUTNAMES -// RUN: %clang_cc1 -emit-llvm -disable-red-zone -femit-coverage-data -coverage-notes-file=aaa.gcno -coverage-data-file=bbb.gcda -dwarf-column-info -debug-info-kind=limited -dwarf-version=4 %s -o - | FileCheck %s --check-prefix GCOV_FILE_INFO +// RUN: %clang_cc1 -emit-llvm -disable-red-zone -femit-coverage-data -coverage-notes-file=aaa.gcno -coverage-data-file=bbb.gcda -debug-column-info -debug-info-kind=limited -dwarf-version=4 %s -o - | FileCheck %s --check-prefix GCOV_FILE_INFO // Index: test/CodeGen/opt-record-MIR.c =================================================================== --- test/CodeGen/opt-record-MIR.c +++ test/CodeGen/opt-record-MIR.c @@ -1,7 +1,7 @@ // REQUIRES: aarch64-registered-target -// RUN: %clang_cc1 -triple arm64-apple-ios -S -o /dev/null %s -O2 -dwarf-column-info -Rpass-missed=regalloc 2>&1 | FileCheck -check-prefix=REMARK %s -// RUN: %clang_cc1 -triple arm64-apple-ios -S -o /dev/null %s -O2 -dwarf-column-info 2>&1 | FileCheck -allow-empty -check-prefix=NO_REMARK %s -// RUN: %clang_cc1 -triple arm64-apple-ios -S -o /dev/null %s -O2 -dwarf-column-info -opt-record-file %t.yaml +// RUN: %clang_cc1 -triple arm64-apple-ios -S -o /dev/null %s -O2 -debug-column-info -Rpass-missed=regalloc 2>&1 | FileCheck -check-prefix=REMARK %s +// RUN: %clang_cc1 -triple arm64-apple-ios -S -o /dev/null %s -O2 -debug-column-info 2>&1 | FileCheck -allow-empty -check-prefix=NO_REMARK %s +// RUN: %clang_cc1 -triple arm64-apple-ios -S -o /dev/null %s -O2 -debug-column-info -opt-record-file %t.yaml // RUN: cat %t.yaml | FileCheck -check-prefix=YAML %s void bar(float); Index: test/CodeGen/opt-record.c =================================================================== --- test/CodeGen/opt-record.c +++ test/CodeGen/opt-record.c @@ -1,7 +1,7 @@ -// RUN: %clang_cc1 -O3 -triple x86_64-unknown-linux-gnu -target-cpu x86-64 %s -o %t -dwarf-column-info -opt-record-file %t.yaml -emit-obj +// RUN: %clang_cc1 -O3 -triple x86_64-unknown-linux-gnu -target-cpu x86-64 %s -o %t -debug-column-info -opt-record-file %t.yaml -emit-obj // RUN: cat %t.yaml | FileCheck %s // RUN: llvm-profdata merge %S/Inputs/opt-record.proftext -o %t.profdata -// RUN: %clang_cc1 -O3 -triple x86_64-unknown-linux-gnu -target-cpu x86-64 -fprofile-instrument-use-path=%t.profdata %s -o %t -dwarf-column-info -opt-record-file %t.yaml -emit-obj +// RUN: %clang_cc1 -O3 -triple x86_64-unknown-linux-gnu -target-cpu x86-64 -fprofile-instrument-use-path=%t.profdata %s -o %t -debug-column-info -opt-record-file %t.yaml -emit-obj // RUN: cat %t.yaml | FileCheck -check-prefix=CHECK -check-prefix=CHECK-PGO %s // REQUIRES: x86-registered-target Index: test/CodeGenCXX/debug-info-member-call.cpp =================================================================== --- test/CodeGenCXX/debug-info-member-call.cpp +++ test/CodeGenCXX/debug-info-member-call.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple x86_64-unknown_unknown -emit-llvm -debug-info-kind=standalone -dwarf-column-info %s -o - | FileCheck %s +// RUN: %clang_cc1 -triple x86_64-unknown_unknown -emit-llvm -debug-info-kind=standalone -debug-column-info %s -o - | FileCheck %s void ext(); struct Bar { Index: test/CodeGenCXX/debug-info-nested-exprs.cpp =================================================================== --- test/CodeGenCXX/debug-info-nested-exprs.cpp +++ test/CodeGenCXX/debug-info-nested-exprs.cpp @@ -2,12 +2,12 @@ // RUN: -std=c++11 -gcodeview -emit-llvm -o - %s \ // RUN: | FileCheck -check-prefix=NONEST %s // RUN: %clang_cc1 -triple=x86_64-pc-windows-msvc -debug-info-kind=limited \ -// RUN: -std=c++11 -gcodeview -dwarf-column-info -emit-llvm -o - %s \ +// RUN: -std=c++11 -gcodeview -debug-column-info -emit-llvm -o - %s \ // RUN: | FileCheck -check-prefix=COLUMNS %s // RUN: %clang_cc1 -triple=x86_64-unknown-linux-gnu -debug-info-kind=limited \ // RUN: -std=c++11 -emit-llvm -o - %s | FileCheck -check-prefix=NESTED %s // RUN: %clang_cc1 -triple=x86_64-unknown-linux-gnu -debug-info-kind=limited \ -// RUN: -std=c++11 -dwarf-column-info -emit-llvm -o - %s \ +// RUN: -std=c++11 -debug-column-info -emit-llvm -o - %s \ // RUN: | FileCheck -check-prefix=COLUMNS %s class Foo { Index: test/Driver/cl-options.c =================================================================== --- test/Driver/cl-options.c +++ test/Driver/cl-options.c @@ -54,13 +54,13 @@ // fpstrict-NOT: -ffast-math // RUN: %clang_cl /Z7 -gcolumn-info -### -- %s 2>&1 | FileCheck -check-prefix=gcolumn %s -// gcolumn: -dwarf-column-info +// gcolumn: -debug-column-info // RUN: %clang_cl /Z7 -gno-column-info -### -- %s 2>&1 | FileCheck -check-prefix=gnocolumn %s -// gnocolumn-NOT: -dwarf-column-info +// gnocolumn-NOT: -debug-column-info // RUN: %clang_cl /Z7 -### -- %s 2>&1 | FileCheck -check-prefix=gdefcolumn %s -// gdefcolumn-NOT: -dwarf-column-info +// gdefcolumn-NOT: -debug-column-info // RUN: %clang_cl -### /FA -fprofile-instr-generate -- %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-GENERATE %s // RUN: %clang_cl -### /FA -fprofile-instr-generate=/tmp/somefile.profraw -- %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-GENERATE-FILE %s Index: test/Driver/debug-options.c =================================================================== --- test/Driver/debug-options.c +++ test/Driver/debug-options.c @@ -227,9 +227,9 @@ // // NOFDTS-NOT: "-backend-option" "-generate-type-units" // -// CI: "-dwarf-column-info" +// CI: "-debug-column-info" // -// NOCI-NOT: "-dwarf-column-info" +// NOCI-NOT: "-debug-column-info" // // GEXTREFS: "-dwarf-ext-refs" "-fmodule-format=obj" "-debug-info-kind={{standalone|limited}}" Index: test/Frontend/optimization-remark-line-directive.c =================================================================== --- test/Frontend/optimization-remark-line-directive.c +++ test/Frontend/optimization-remark-line-directive.c @@ -2,7 +2,7 @@ // directives. We cannot map #line directives back to // a SourceLocation. -// RUN: %clang_cc1 %s -Rpass=inline -debug-info-kind=line-tables-only -dwarf-column-info -emit-llvm-only -verify +// RUN: %clang_cc1 %s -Rpass=inline -debug-info-kind=line-tables-only -debug-column-info -emit-llvm-only -verify int foo(int x, int y) __attribute__((always_inline)); int foo(int x, int y) { return x + y; } Index: test/Sema/assign.c =================================================================== --- test/Sema/assign.c +++ test/Sema/assign.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fsyntax-only -verify %s +// RUN: %clang_cc1 -debug-column-info -fsyntax-only -verify %s void *test1(void) { return 0; } Index: test/Sema/enum.c =================================================================== --- test/Sema/enum.c +++ test/Sema/enum.c @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -triple %itanium_abi_triple %s -fsyntax-only -verify -pedantic -enum e {A, +// RUN: %clang_cc1 -triple %itanium_abi_triple %s -debug-column-info -fsyntax-only -verify -pedantic +enum e {A, B = 42LL << 32, // expected-warning {{ISO C restricts enumerator values to range of 'int'}} C = -4, D = 12456 }; @@ -11,7 +11,7 @@ enum h { e = -2147483648, // too pos f = 2147483648, // expected-warning {{ISO C restricts enumerator values to range of 'int'}} i = 0xFFFF0000 // expected-warning {{too large}} -}; +}; // minll maxull enum x // expected-warning {{enumeration values exceed range of largest integer}} Index: test/Sema/switch.c =================================================================== --- test/Sema/switch.c +++ test/Sema/switch.c @@ -1,8 +1,8 @@ -// RUN: %clang_cc1 -fsyntax-only -verify -Wswitch-enum -Wcovered-switch-default -triple x86_64-linux-gnu %s -void f (int z) { - while (z) { +// RUN: %clang_cc1 -debug-column-info -fsyntax-only -verify -Wswitch-enum -Wcovered-switch-default -triple x86_64-linux-gnu %s +void f (int z) { + while (z) { default: z--; // expected-error {{statement not in switch}} - } + } } void foo(int X) { @@ -22,7 +22,7 @@ } } -void test3(void) { +void test3(void) { // empty switch; switch (0); // expected-warning {{no case matching constant switch condition '0'}} \ // expected-warning {{switch statement has empty body}} \ @@ -45,18 +45,18 @@ case 0 ... g(): // expected-error {{expression is not an integer constant expression}} break; } - + switch (cond) { case 0 && g() ... 1 || g(): break; } - + switch (cond) { case g() // expected-error {{expression is not an integer constant expression}} && 0: break; } - + switch (cond) { case 0 ... g() // expected-error {{expression is not an integer constant expression}} @@ -65,13 +65,13 @@ } } -void test5(int z) { +void test5(int z) { switch(z) { default: // expected-note {{previous case defined here}} default: // expected-error {{multiple default labels in one switch}} break; } -} +} void test6() { char ch = 'a'; @@ -187,7 +187,7 @@ case 0 ... //expected-warning{{case value not in enumerated type 'enum (anonymous enum}} 1: //expected-warning{{case value not in enumerated type 'enum (anonymous enum}} case 2 ... 4: - case 5 ... //expected-warning{{case value not in enumerated type 'enum (anonymous enum}} + case 5 ... //expected-warning{{case value not in enumerated type 'enum (anonymous enum}} 9: //expected-warning{{case value not in enumerated type 'enum (anonymous enum}} case 10 ... 12: case 13 ... //expected-warning{{case value not in enumerated type 'enum (anonymous enum}} @@ -212,7 +212,7 @@ case B: case C: break; - + default: break; } @@ -308,13 +308,13 @@ typedef enum { kOne = 1, } Ints; - + void rdar110822110(Ints i) { switch (i) { case kOne: break; - case 2: // expected-warning {{case value not in enumerated type 'Ints'}} + case 2: // expected-warning {{case value not in enumerated type 'Ints'}} break; default: // expected-warning {{default label in switch which covers all enumeration values}} break; Index: test/SemaCXX/condition.cpp =================================================================== --- test/SemaCXX/condition.cpp +++ test/SemaCXX/condition.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s +// RUN: %clang_cc1 -debug-column-info -fsyntax-only -verify -std=c++11 %s void test() { int x; Index: test/SemaCXX/enum.cpp =================================================================== --- test/SemaCXX/enum.cpp +++ test/SemaCXX/enum.cpp @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -fsyntax-only -pedantic -std=c++98 -verify -triple x86_64-apple-darwin %s -// RUN: %clang_cc1 -fsyntax-only -pedantic -std=c++11 -verify -triple x86_64-apple-darwin %s +// RUN: %clang_cc1 -debug-column-info -fsyntax-only -pedantic -std=c++98 -verify -triple x86_64-apple-darwin %s +// RUN: %clang_cc1 -debug-column-info -fsyntax-only -pedantic -std=c++11 -verify -triple x86_64-apple-darwin %s enum E { // expected-note{{previous definition is here}} Val1, Val2 Index: test/SemaCXX/lambda-expressions.cpp =================================================================== --- test/SemaCXX/lambda-expressions.cpp +++ test/SemaCXX/lambda-expressions.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -std=c++14 -Wno-unused-value -fsyntax-only -verify -fblocks %s +// RUN: %clang_cc1 -std=c++14 -Wno-unused-value -debug-column-info -fsyntax-only -verify -fblocks %s namespace std { class type_info; }; Index: test/SemaCXX/pass-object-size.cpp =================================================================== --- test/SemaCXX/pass-object-size.cpp +++ test/SemaCXX/pass-object-size.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++11 +// RUN: %clang_cc1 -debug-column-info -fsyntax-only -verify %s -std=c++11 namespace simple { int Foo(void *const p __attribute__((pass_object_size(0)))); Index: test/SemaCXX/warn-sign-conversion.cpp =================================================================== --- test/SemaCXX/warn-sign-conversion.cpp +++ test/SemaCXX/warn-sign-conversion.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple %itanium_abi_triple -verify -fsyntax-only -Wsign-conversion %s +// RUN: %clang_cc1 -triple %itanium_abi_triple -debug-column-info -verify -fsyntax-only -Wsign-conversion %s // NOTE: When a 'enumeral mismatch' warning is implemented then expect several // of the following cases to be impacted.