[llvm-commits] [llvm] r80829 - in /llvm/trunk/tools/llc: Makefile llc.cpp

Daniel Dunbar daniel at zuster.org
Wed Sep 2 14:12:23 PDT 2009


Yay, yay, yay!

The llc tool documentation should probably be updated to mention this
incredible convenience.

How do you feel about the same change to opt, since we commonly put it
in pipelines?

 - Daniel

On Wed, Sep 2, 2009 at 12:35 PM, Dan Gohman<gohman at apple.com> wrote:
> Author: djg
> Date: Wed Sep  2 14:35:19 2009
> New Revision: 80829
>
> URL: http://llvm.org/viewvc/llvm-project?rev=80829&view=rev
> Log:
> Switch llc from ParseBitcodeFile to ParseIRFile. This lets llc
> transparently read either LLVM Assembly or LLVM Bitcode files.
>
> Modified:
>    llvm/trunk/tools/llc/Makefile
>    llvm/trunk/tools/llc/llc.cpp
>
> Modified: llvm/trunk/tools/llc/Makefile
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llc/Makefile?rev=80829&r1=80828&r2=80829&view=diff
>
> ==============================================================================
> --- llvm/trunk/tools/llc/Makefile (original)
> +++ llvm/trunk/tools/llc/Makefile Wed Sep  2 14:35:19 2009
> @@ -15,7 +15,7 @@
>  # early so we can set up LINK_COMPONENTS before including Makefile.rules
>  include $(LEVEL)/Makefile.config
>
> -LINK_COMPONENTS := $(TARGETS_TO_BUILD) bitreader
> +LINK_COMPONENTS := $(TARGETS_TO_BUILD) bitreader asmparser
>
>  include $(LLVM_SRC_ROOT)/Makefile.rules
>
>
> Modified: llvm/trunk/tools/llc/llc.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llc/llc.cpp?rev=80829&r1=80828&r2=80829&view=diff
>
> ==============================================================================
> --- llvm/trunk/tools/llc/llc.cpp (original)
> +++ llvm/trunk/tools/llc/llc.cpp Wed Sep  2 14:35:19 2009
> @@ -20,7 +20,7 @@
>  #include "llvm/Pass.h"
>  #include "llvm/ADT/Triple.h"
>  #include "llvm/Analysis/Verifier.h"
> -#include "llvm/Bitcode/ReaderWriter.h"
> +#include "llvm/Support/IRReader.h"
>  #include "llvm/CodeGen/FileWriters.h"
>  #include "llvm/CodeGen/LinkAllAsmWriterComponents.h"
>  #include "llvm/CodeGen/LinkAllCodegenComponents.h"
> @@ -218,16 +218,12 @@
>   cl::ParseCommandLineOptions(argc, argv, "llvm system compiler\n");
>
>   // Load the module to be compiled...
> -  std::string ErrorMessage;
> +  SMDiagnostic Err;
>   std::auto_ptr<Module> M;
>
> -  std::auto_ptr<MemoryBuffer> Buffer(
> -                   MemoryBuffer::getFileOrSTDIN(InputFilename, &ErrorMessage));
> -  if (Buffer.get())
> -    M.reset(ParseBitcodeFile(Buffer.get(), Context, &ErrorMessage));
> +  M.reset(ParseIRFile(InputFilename, Err, Context));
>   if (M.get() == 0) {
> -    errs() << argv[0] << ": bitcode didn't read correctly.\n";
> -    errs() << "Reason: " << ErrorMessage << "\n";
> +    Err.Print(argv[0], errs());
>     return 1;
>   }
>   Module &mod = *M.get();
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>




More information about the llvm-commits mailing list