[cfe-commits] r167566 - in /cfe/trunk: include/clang/Driver/Driver.h lib/Driver/Driver.cpp lib/Driver/ToolChains.cpp lib/Frontend/CreateInvocationFromCommandLine.cpp test/Driver/apple-kext-i386.cpp

Chad Rosier mcrosier at apple.com
Fri Nov 9 10:31:14 PST 2012


+1; very awesome!!

On Nov 9, 2012, at 8:48 AM, Rafael EspĂ­ndola <rafael.espindola at gmail.com> wrote:

> This is awesome!
> 
> On 7 November 2012 17:03, Bob Wilson <bob.wilson at apple.com> wrote:
>> Author: bwilson
>> Date: Wed Nov  7 19:03:29 2012
>> New Revision: 167566
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=167566&view=rev
>> Log:
>> Remove code to fall back to llvm-gcc for i386 kexts.
>> 
>> More cleanups to follow in separate commits....
>> 
>> Removed:
>>    cfe/trunk/test/Driver/apple-kext-i386.cpp
>> Modified:
>>    cfe/trunk/include/clang/Driver/Driver.h
>>    cfe/trunk/lib/Driver/Driver.cpp
>>    cfe/trunk/lib/Driver/ToolChains.cpp
>>    cfe/trunk/lib/Frontend/CreateInvocationFromCommandLine.cpp
>> 
>> Modified: cfe/trunk/include/clang/Driver/Driver.h
>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Driver.h?rev=167566&r1=167565&r2=167566&view=diff
>> ==============================================================================
>> --- cfe/trunk/include/clang/Driver/Driver.h (original)
>> +++ cfe/trunk/include/clang/Driver/Driver.h Wed Nov  7 19:03:29 2012
>> @@ -146,9 +146,6 @@
>>   /// jobs.
>>   unsigned CheckInputsExist : 1;
>> 
>> -  /// \brief Force use of clang frontend.
>> -  unsigned ForcedClangUse : 1;
>> -
>> public:
>>   /// Use lazy precompiled headers for PCH support.
>>   unsigned CCCUsePCH : 1;
>> @@ -218,9 +215,6 @@
>>     InstalledDir = Value;
>>   }
>> 
>> -  bool shouldForceClangUse() const { return ForcedClangUse; }
>> -  void setForcedClangUse(bool V = true) { ForcedClangUse = V; }
>> -
>>   /// @}
>>   /// @name Primary Functionality
>>   /// @{
>> 
>> Modified: cfe/trunk/lib/Driver/Driver.cpp
>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Driver.cpp?rev=167566&r1=167565&r2=167566&view=diff
>> ==============================================================================
>> --- cfe/trunk/lib/Driver/Driver.cpp (original)
>> +++ cfe/trunk/lib/Driver/Driver.cpp Wed Nov  7 19:03:29 2012
>> @@ -58,7 +58,7 @@
>>     CCCIsCPP(false),CCCEcho(false), CCCPrintBindings(false),
>>     CCPrintOptions(false), CCPrintHeaders(false), CCLogDiagnostics(false),
>>     CCGenDiagnostics(false), CCCGenericGCCName(""), CheckInputsExist(true),
>> -    ForcedClangUse(false), CCCUsePCH(true), SuppressMissingInputWarning(false) {
>> +    CCCUsePCH(true), SuppressMissingInputWarning(false) {
>> 
>>   Name = llvm::sys::path::stem(ClangExecutable);
>>   Dir  = llvm::sys::path::parent_path(ClangExecutable);
>> 
>> Modified: cfe/trunk/lib/Driver/ToolChains.cpp
>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.cpp?rev=167566&r1=167565&r2=167566&view=diff
>> ==============================================================================
>> --- cfe/trunk/lib/Driver/ToolChains.cpp (original)
>> +++ cfe/trunk/lib/Driver/ToolChains.cpp Wed Nov  7 19:03:29 2012
>> @@ -183,24 +183,11 @@
>> Tool &Darwin::SelectTool(const Compilation &C, const JobAction &JA,
>>                          const ActionList &Inputs) const {
>>   Action::ActionClass Key = JA.getKind();
>> -  bool useClang = false;
>> 
>>   if (getDriver().ShouldUseClangCompiler(C, JA, getTriple())) {
>> -    useClang = true;
>> -    // Fallback to llvm-gcc for i386 kext compiles, we don't support that ABI.
>> -    if (!getDriver().shouldForceClangUse() &&
>> -        Inputs.size() == 1 &&
>> -        types::isCXX(Inputs[0]->getType()) &&
>> -        getTriple().isOSDarwin() &&
>> -        getTriple().getArch() == llvm::Triple::x86 &&
>> -        (C.getArgs().getLastArg(options::OPT_fapple_kext) ||
>> -         C.getArgs().getLastArg(options::OPT_mkernel)))
>> -      useClang = false;
>> -  }
>> -
>> -  // FIXME: This seems like a hacky way to choose clang frontend.
>> -  if (useClang)
>> +    // FIXME: This seems like a hacky way to choose clang frontend.
>>     Key = Action::AnalyzeJobClass;
>> +  }
>> 
>>   bool UseIntegratedAs = C.getArgs().hasFlag(options::OPT_integrated_as,
>>                                              options::OPT_no_integrated_as,
>> 
>> Modified: cfe/trunk/lib/Frontend/CreateInvocationFromCommandLine.cpp
>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CreateInvocationFromCommandLine.cpp?rev=167566&r1=167565&r2=167566&view=diff
>> ==============================================================================
>> --- cfe/trunk/lib/Frontend/CreateInvocationFromCommandLine.cpp (original)
>> +++ cfe/trunk/lib/Frontend/CreateInvocationFromCommandLine.cpp Wed Nov  7 19:03:29 2012
>> @@ -49,11 +49,6 @@
>>   // FIXME: We shouldn't have to pass in the path info.
>>   driver::Driver TheDriver("clang", llvm::sys::getDefaultTargetTriple(),
>>                            "a.out", false, *Diags);
>> -  // Force driver to use clang.
>> -  // FIXME: This seems like a hack. Maybe the "Clang" tool subclass should be
>> -  // available for using it to get the arguments, thus avoiding the overkill
>> -  // of using the driver.
>> -  TheDriver.setForcedClangUse();
>> 
>>   // Don't check that inputs exist, they may have been remapped.
>>   TheDriver.setCheckInputsExist(false);
>> 
>> Removed: cfe/trunk/test/Driver/apple-kext-i386.cpp
>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/apple-kext-i386.cpp?rev=167565&view=auto
>> ==============================================================================
>> --- cfe/trunk/test/Driver/apple-kext-i386.cpp (original)
>> +++ cfe/trunk/test/Driver/apple-kext-i386.cpp (removed)
>> @@ -1,59 +0,0 @@
>> -// Check that we transparently fallback to llvm-gcc for i386 kexts, we don't
>> -// support the ABI they use (yet).
>> -
>> -// 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 -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 -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:   -Wno-int-conversion -Wconstant-conversion -Wenum-conversion \
>> -// RUN:   -fapple-kext -### -fsyntax-only %s 2> %t
>> -// RUN: FileCheck --check-prefix=CHECK-UNSUPPORTED < %t %s
>> -
>> -// CHECK-UNSUPPORTED: cc1plus"
>> -// CHECK-UNSUPPORTED-NOT: "-Wno-self-assign"
>> -// CHECK-UNSUPPORTED-NOT: "-Wc++11-extensions"
>> -// CHECK-UNSUPPORTED-NOT: "-Wno-microsoft"
>> -// CHECK-UNSUPPORTED-NOT: "-Wmicrosoft"
>> -// CHECK-UNSUPPORTED-NOT: "-Wvla"
>> -// CHECK-UNSUPPORTED-NOT: "-faltivec"
>> -// CHECK-UNSUPPORTED-NOT: "-mthumb"
>> -// CHECK-UNSUPPORTED-NOT: "-mlongcall"
>> -// CHECK-UNSUPPORTED: "-mno-longcall"
>> -// CHECK-UNSUPPORTED: "-msoft-float"
>> -// CHECK-UNSUPPORTED-NOT: "-Wno-int-conversion"
>> -// CHECK-UNSUPPORTED-NOT: "-Wconstant-conversion"
>> -// CHECK-UNSUPPORTED-NOT: "-Wenum-conversion"
>> -
>> -// 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
>> -
>> -// CHECK-UNSUPPORTED2: cc1plus"
>> -// CHECK-UNSUPPORTED2-NOT: "-Wconstant-logical-operand"
>> -
>> -// Check that -serialize-diagnostics does not cause an "argument unused" error.
>> -// RUN: %clang -target i386-apple-darwin10 \
>> -// RUN:   -Wall -fapple-kext -### -serialize-diagnostics %t.dia -c %s 2>&1 | \
>> -// RUN:   FileCheck --check-prefix=CHECK-UNUSED %s
>> -
>> -// Check that --serialize-diagnostics does not cause an "argument unused" error.
>> -// RUN: %clang -target i386-apple-darwin10 \
>> -// RUN:   -Wall -fapple-kext -### --serialize-diagnostics %t.dia -c %s 2>&1 | \
>> -// RUN:   FileCheck --check-prefix=CHECK-UNUSED %s
>> -
>> -// CHECK-UNUSED-NOT: argument unused
>> -// CHECK-UNUSED: cc1plus
>> 
>> 
>> _______________________________________________
>> cfe-commits mailing list
>> cfe-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits





More information about the cfe-commits mailing list