mirror of
https://github.com/intel/llvm.git
synced 2026-02-03 10:39:35 +08:00
-------------------------------------------------
Feature: OpenMP support in CLANG: Sub-Feature: Support for option -fopenmp Files Changed/Added: * include/clang/Driver/Options.td (C) * include/clang/Basic/LangOptions.def (C) * lib/Driver/Tools.cpp (C) * lib/Frontend/CompilerInvocation.cpp (C) Test Cases Changed/Added: * test/Driver/clang_fopenmp_opt.c (A) ------------------------------------------------- llvm-svn: 166868
This commit is contained in:
@@ -167,6 +167,8 @@ LANGOPT(ApplePragmaPack, 1, 0, "Apple gcc-compatible #pragma pack handling")
|
||||
BENIGN_LANGOPT(EmitMicrosoftInlineAsm , 1, 0,
|
||||
"Enable emission of MS-style inline assembly.")
|
||||
|
||||
LANGOPT(OpenMP, 1, 0, "Enables OpenMP support.")
|
||||
|
||||
BENIGN_LANGOPT(RetainCommentsFromSystemHeaders, 1, 0, "retain documentation comments from system headers in the AST")
|
||||
|
||||
#undef LANGOPT
|
||||
|
||||
@@ -594,7 +594,7 @@ def fno_objc_nonfragile_abi : Flag<["-"], "fno-objc-nonfragile-abi">, Group<f_Gr
|
||||
def fobjc_sender_dependent_dispatch : Flag<["-"], "fobjc-sender-dependent-dispatch">, Group<f_Group>;
|
||||
def fobjc : Flag<["-"], "fobjc">, Group<f_Group>;
|
||||
def fomit_frame_pointer : Flag<["-"], "fomit-frame-pointer">, Group<f_Group>;
|
||||
def fopenmp : Flag<["-"], "fopenmp">, Group<f_Group>;
|
||||
def fopenmp : Flag<["-"], "fopenmp">, Group<f_Group>, Flags<[CC1Option]>;
|
||||
def fno_optimize_sibling_calls : Flag<["-"], "fno-optimize-sibling-calls">, Group<f_Group>;
|
||||
def foptimize_sibling_calls : Flag<["-"], "foptimize-sibling-calls">, Group<f_Group>;
|
||||
def force__cpusubtype__ALL : Flag<["-"], "force_cpusubtype_ALL">;
|
||||
|
||||
@@ -2412,6 +2412,8 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
|
||||
|
||||
Args.AddLastArg(CmdArgs, options::OPT_pthread);
|
||||
|
||||
Args.AddLastArg(CmdArgs, options::OPT_fopenmp);
|
||||
|
||||
// -stack-protector=0 is default.
|
||||
unsigned StackProtectorLevel = 0;
|
||||
if (Arg *A = Args.getLastArg(options::OPT_fno_stack_protector,
|
||||
|
||||
@@ -870,6 +870,8 @@ static void LangOptsToArgs(const LangOptions &Opts, ToArgsList &Res) {
|
||||
Res.push_back("-fapple-pragma-pack");
|
||||
if (!Opts.CurrentModule.empty())
|
||||
Res.push_back("-fmodule-name=" + Opts.CurrentModule);
|
||||
if (Opts.OpenMP)
|
||||
Res.push_back("-fopenmp");
|
||||
}
|
||||
|
||||
static void PreprocessorOptsToArgs(const PreprocessorOptions &Opts,
|
||||
@@ -2143,6 +2145,7 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK,
|
||||
Opts.ThreadSanitizer = Args.hasArg(OPT_fthread_sanitizer);
|
||||
Opts.ApplePragmaPack = Args.hasArg(OPT_fapple_pragma_pack);
|
||||
Opts.CurrentModule = Args.getLastArgValue(OPT_fmodule_name);
|
||||
Opts.OpenMP = Args.hasArg(OPT_fopenmp);
|
||||
|
||||
// Record whether the __DEPRECATED define was requested.
|
||||
Opts.Deprecated = Args.hasFlag(OPT_fdeprecated_macro,
|
||||
|
||||
2
clang/test/Driver/clang_fopenmp_opt.c
Normal file
2
clang/test/Driver/clang_fopenmp_opt.c
Normal file
@@ -0,0 +1,2 @@
|
||||
// RUN: %clang -### -S -o %t %s 2>&1 | not grep -w -- -fopenmp
|
||||
// RUN: %clang -### -S -o %t %s -fopenmp 2>&1 | grep -w -- -fopenmp
|
||||
Reference in New Issue
Block a user