[clang] 8dd5ef0 - [clang-repl] Better match the underlying architecture.

Vassil Vassilev via cfe-commits cfe-commits at lists.llvm.org
Tue May 18 12:14:45 PDT 2021


Author: Vassil Vassilev
Date: 2021-05-18T19:14:33Z
New Revision: 8dd5ef01ef13e402784bba47f7a24175f5f00325

URL: https://github.com/llvm/llvm-project/commit/8dd5ef01ef13e402784bba47f7a24175f5f00325
DIFF: https://github.com/llvm/llvm-project/commit/8dd5ef01ef13e402784bba47f7a24175f5f00325.diff

LOG: [clang-repl] Better match the underlying architecture.

In cases where -fno-integrated-as is specified we should overwrite the
EmitAssembly action as well.

We also should rely on the target triple from the process at least until we
implement out-of-process execution.

This patch should improve clang-repl on AIX.

Discussion available at: https://reviews.llvm.org/D96033

Differential revision: https://reviews.llvm.org/D102688

Added: 
    

Modified: 
    clang/lib/Interpreter/IncrementalParser.cpp
    clang/lib/Interpreter/Interpreter.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Interpreter/IncrementalParser.cpp b/clang/lib/Interpreter/IncrementalParser.cpp
index 70baabfeb8fbd..84b4d779d43c5 100644
--- a/clang/lib/Interpreter/IncrementalParser.cpp
+++ b/clang/lib/Interpreter/IncrementalParser.cpp
@@ -54,7 +54,8 @@ class IncrementalAction : public WrapperFrontendAction {
             Err = llvm::createStringError(
                 std::errc::state_not_recoverable,
                 "Driver initialization failed. "
-                "Incremental mode for action is not supported");
+                "Incremental mode for action %d is not supported",
+                CI.getFrontendOpts().ProgramAction);
             return Act;
           case frontend::ASTDump:
             LLVM_FALLTHROUGH;
@@ -63,6 +64,8 @@ class IncrementalAction : public WrapperFrontendAction {
           case frontend::ParseSyntaxOnly:
             Act = CreateFrontendAction(CI);
             break;
+          case frontend::EmitAssembly:
+            LLVM_FALLTHROUGH;
           case frontend::EmitObj:
             LLVM_FALLTHROUGH;
           case frontend::EmitLLVMOnly:

diff  --git a/clang/lib/Interpreter/Interpreter.cpp b/clang/lib/Interpreter/Interpreter.cpp
index 8de38c0afcd91..79acb5bd68982 100644
--- a/clang/lib/Interpreter/Interpreter.cpp
+++ b/clang/lib/Interpreter/Interpreter.cpp
@@ -157,7 +157,7 @@ IncrementalCompilerBuilder::create(std::vector<const char *> &ClangArgv) {
   ParseDiagnosticArgs(*DiagOpts, ParsedArgs, &Diags);
 
   driver::Driver Driver(/*MainBinaryName=*/ClangArgv[0],
-                        llvm::sys::getDefaultTargetTriple(), Diags);
+                        llvm::sys::getProcessTriple(), Diags);
   Driver.setCheckInputsExist(false); // the input comes from mem buffers
   llvm::ArrayRef<const char *> RF = llvm::makeArrayRef(ClangArgv);
   std::unique_ptr<driver::Compilation> Compilation(Driver.BuildCompilation(RF));


        


More information about the cfe-commits mailing list